Title: Fatal Errors
Last modified: June 29, 2023

---

# Fatal Errors

 *  Resolved [tbvdg](https://wordpress.org/support/users/tbvdg/)
 * (@tbvdg)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/fatal-errors-90/)
 *     ```wp-block-code
       [29-Jun-2023 14:05:56 UTC] PHP Fatal error: Uncaught Error: Call to a member function find() on bool in /home/saunapla/web/live/public_html/wp-content/plugins/accessibility-plus/accessibility.php:110Stack trace:
   
       0 /home/saunapla/web/live/public_html/wp-content/plugins/accessibility-plus/accessibility.php(274): easywpstuff_assesplus_add_aria_labels_to_buttons('')
   
       1 [internal function]: easywpstuff_assesplus_bstr_template_redirect('', 9)
   
       2 /home/saunapla/web/live/public_html/wp-includes/functions.php(5309): ob_end_flush()
   
       3 /home/saunapla/web/live/public_html/wp-includes/class-wp-hook.php(308): wp_ob_end_flush_all('')
   
       4 /home/saunapla/web/live/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
   
       5 /home/saunapla/web/live/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
   
       6 /home/saunapla/web/live/public_html/wp-includes/load.php(1144): do_action('shutdown')
   
       7 [internal function]: shutdown_action_hook()
   
       8 {main}
   
       thrown in /home/saunapla/web/live/public_html/wp-content/plugins/accessibility-plus/accessibility.php on line 110
       ```
   
 * Hi,
   This is an error that is showing up occasionally in the debug log. I ended
   up putting if(!empty($dom)){} around it as a quick fix. That seems to have resolved
   it so far. Thanks,Toby
 *     ```wp-block-code
       function easywpstuff_assesplus_add_aria_labels_to_buttons($html) {
   
         $dom = lhb_str_get_html($html, false, true, 'UTF-8', false, PHP_EOL, ' ');
   
         if(!empty($dom)){
           $buttons = $dom->find('button');  
   
           foreach ($buttons as $button) {
             if (!trim($button->plaintext) && !$button->getattribute('aria-label')) {
               $child_elements = $button->find('*');
               if (empty($child_elements)) {
                 $button->setattribute('aria-label', 'button');
               } else {
                 $button->setattribute('aria-label', 'button');
               }
             }
         	  if (!$button->getattribute('aria-label')) {
             $svg = $button->find('svg',0);
             $path = $button->find('path',0);
             $span = $button->find('span',0);
             if($svg && $path){
               $button->setattribute('aria-label', 'button');
             }elseif($span){
               $span_text = trim($span->plaintext);
               if($span_text){
                 $button->setattribute('aria-label', $span_text);
               }
             }
           }
           }
           return $dom->save();
         }
       }
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [FluxPress](https://wordpress.org/support/users/easywpstuff/)
 * (@easywpstuff)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/fatal-errors-90/#post-16955849)
 * Hi,
 * The issue has been fixed in the latest update

Viewing 1 replies (of 1 total)

The topic ‘Fatal Errors’ is closed to new replies.

 * ![](https://ps.w.org/accessibility-plus/assets/icon.svg?rev=3340026)
 * [Accessibility Tool Kit: WP Accessibility checker plugin for WCAG, Section 508, ADA, EAA Compliance](https://wordpress.org/plugins/accessibility-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/accessibility-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/accessibility-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/accessibility-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/accessibility-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/accessibility-plus/reviews/)

## Tags

 * [bool](https://wordpress.org/support/topic-tag/bool/)
 * [find](https://wordpress.org/support/topic-tag/find/)

 * 1 reply
 * 2 participants
 * Last reply from: [FluxPress](https://wordpress.org/support/users/easywpstuff/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/fatal-errors-90/#post-16955849)
 * Status: resolved