• Resolved Christian Chung

    (@christian1012)


    Hi there. I see you’ve been dealing with quite a few reported issues of white screen errors in the past few months. Thankfully, I have some additional information which may help you track this down.

    I am helping out with a site that uses your plugin, hosted on SiteGround on highest level hosting plan. Most directory sublistings throw 500 errors, but don’t write anything to the log. Locally, (xdebug installed), xdebug throws an error trying to write the stack trace to the log. I will post an excerpt of it here.

    From what I can tell, in class-fieldtypes-textarea.php:L125, WPBDP_FieldTypes_TextArea::get_field_html_value() which sends the script into an infinite loop.

    Hope the above and following stack trace will help…

    
    [31-Jan-2017 03:32:29 UTC] PHP Fatal error:  Maximum function nesting level of '256' reached, aborting! in /var/www/html/wp-includes/cache.php on line 724
    [31-Jan-2017 03:32:29 UTC] PHP Stack trace:
    [31-Jan-2017 03:32:29 UTC] PHP   1. {main}() /var/www/html/index.php:0
    [31-Jan-2017 03:32:29 UTC] PHP   2. require() /var/www/html/index.php:17
    [31-Jan-2017 03:32:29 UTC] PHP   3. require_once() /var/www/html/wp-blog-header.php:19
    [31-Jan-2017 03:32:29 UTC] PHP   4. do_action() /var/www/html/wp-includes/template-loader.php:12
    [31-Jan-2017 03:32:29 UTC] PHP   5. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:453
    [31-Jan-2017 03:32:29 UTC] PHP   6. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-hook.php:323
    [31-Jan-2017 03:32:29 UTC] PHP   7. WPBDP__Dispatcher->_execute_view() /var/www/html/wp-includes/class-wp-hook.php:298
    [31-Jan-2017 03:32:29 UTC] PHP   8. WPBDP__Views__Show_Category->dispatch() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-dispatcher.php:56
    [31-Jan-2017 03:32:29 UTC] PHP   9. WPBDP_NView->_render() /var/www/html/wp-content/plugins/business-directory-plugin/core/views/show_category.php:21
    [31-Jan-2017 03:32:29 UTC] PHP  10. wpbdp_x_render() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-view.php:61
    [31-Jan-2017 03:32:29 UTC] PHP  11. WPBDP_Themes->render() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:785
    [31-Jan-2017 03:32:29 UTC] PHP  12. WPBDP_Themes->render_template_file() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:468
    [31-Jan-2017 03:32:29 UTC] PHP  13. include() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:493
    [31-Jan-2017 03:32:29 UTC] PHP  14. wpbdp_x_render() /var/www/html/wp-content/plugins/business-directory-plugin/core/templates/category.tpl.php:6
    [31-Jan-2017 03:32:29 UTC] PHP  15. WPBDP_Themes->render() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:785
    [31-Jan-2017 03:32:29 UTC] PHP  16. WPBDP_Themes->render_template_file() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:468
    [31-Jan-2017 03:32:29 UTC] PHP  17. include() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:493
    [31-Jan-2017 03:32:29 UTC] PHP  18. wpbdp_render_listing() /var/www/html/wp-content/plugins/business-directory-plugin/core/templates/listings.tpl.php:10
    [31-Jan-2017 03:32:29 UTC] PHP  19. WPBDP_Listing_Display_Helper::excerpt() /var/www/html/wp-content/plugins/business-directory-plugin/core/templates-listings.php:26
    [31-Jan-2017 03:32:29 UTC] PHP  20. wpbdp_x_render() /var/www/html/wp-content/plugins/business-directory-plugin/core/helpers/class-listing-display-helper.php:27
    [31-Jan-2017 03:32:29 UTC] PHP  21. WPBDP_Themes->render() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:785
    [31-Jan-2017 03:32:29 UTC] PHP  22. WPBDP_Themes->render_template_file() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:468
    [31-Jan-2017 03:32:29 UTC] PHP  23. include() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:493
    [31-Jan-2017 03:32:29 UTC] PHP  24. wpbdp_x_part() /var/www/html/wp-content/plugins/business-directory-plugin/core/templates/excerpt.tpl.php:9
    [31-Jan-2017 03:32:29 UTC] PHP  25. WPBDP_Themes->render_part() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:794
    [31-Jan-2017 03:32:29 UTC] PHP  26. WPBDP_Themes->render() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:578
    [31-Jan-2017 03:32:29 UTC] PHP  27. WPBDP_Themes->render_template_file() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:468
    [31-Jan-2017 03:32:29 UTC] PHP  28. include() /var/www/html/wp-content/plugins/business-directory-plugin/core/themes.php:493
    [31-Jan-2017 03:32:29 UTC] PHP  29. WPBDP_Field_Display_List->__get() /var/www/html/wp-content/plugins/business-directory-plugin/themes/default/templates/excerpt_content.tpl.php:18
    [31-Jan-2017 03:32:29 UTC] PHP  30. wp_list_pluck() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-field-display-list.php:133
    [31-Jan-2017 03:32:29 UTC] PHP  31. WP_List_Util->pluck() /var/www/html/wp-includes/functions.php:3637
    [31-Jan-2017 03:32:29 UTC] PHP  32. _WPBDP_Lightweight_Field_Display_Item->__get() /var/www/html/wp-includes/class-wp-list-util.php:155
    [31-Jan-2017 03:32:29 UTC] PHP  33. WPBDP_Form_Field->display() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-field-display-list.php:218
    [31-Jan-2017 03:32:29 UTC] PHP  34. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:462
    [31-Jan-2017 03:32:29 UTC] PHP  35. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  36. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  37. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    [31-Jan-2017 03:32:29 UTC] PHP  38. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  39. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  40. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    [31-Jan-2017 03:32:29 UTC] PHP  41. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  42. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  43. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    [31-Jan-2017 03:32:29 UTC] PHP  44. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  45. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  46. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    [31-Jan-2017 03:32:29 UTC] PHP  47. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  48. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  49. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    [31-Jan-2017 03:32:29 UTC] PHP  50. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  51. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  52. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    [31-Jan-2017 03:32:29 UTC] PHP  53. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  54. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  55. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    [31-Jan-2017 03:32:29 UTC] PHP  56. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  57. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  58. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    [31-Jan-2017 03:32:29 UTC] PHP  59. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  60. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  61. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    [31-Jan-2017 03:32:29 UTC] PHP  62. WPBDP_FieldTypes_TextArea->get_field_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/class-form-field.php:344
    [31-Jan-2017 03:32:29 UTC] PHP  63. WPBDP_FieldTypes_TextArea->get_field_html_value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:119
    [31-Jan-2017 03:32:29 UTC] PHP  64. WPBDP_Form_Field->value() /var/www/html/wp-content/plugins/business-directory-plugin/core/fieldtypes/class-fieldtypes-textarea.php:125
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Christian Chung

    (@christian1012)

    Btw, bypassing the call to WPBDP_FieldTypes_TextArea::get_field_html_value() fixes it:

    
    public function get_field_value( &$field, $post_id ) {
            $value = parent::get_field_value( $field, $post_id );
    
            // Only return auto-generated excerpt if there's no value at all.
            if ( 'excerpt' == $field->get_association() && $field->data( 'auto_excerpt') && ! $value )
                $value = 'This fixes it.';
                //$value = $this->get_field_html_value( $field, $post_id );
    
            return $value;
        }
    

    Hope that helps!

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi Christian,

    Thanks for that! White screen errors don’t have a universal cause, unfortunately–there’s a lot of things that can happen to create one of those. I’d like to understand what you’re doing in more detail.

    Can you tell me a bit more?
    – What version of WP are you running here?
    – What exact version of BD? (number, please)
    – Do you have any premium modules installed?
    – What are you doing to reproduce this error under xdebug? A set of steps would help.

    What it looks like is something went haywire and you went into recursion–but that’s definitely not a normal thing. Calling that function is how fields get displayed, so it’s not something that can be bypassed.

    Is this running under a default theme and only BD active?

    There’s one issue we have with a setting that has a patch available–regarding auto-generating the excerpt. It could be what you’re seeing. Contact us here and we can provide it for you to test, if you like: https://businessdirectoryplugin.com/contact/

    The code above, though, is not a long term solution…

    Thread Starter Christian Chung

    (@christian1012)

    WP Version: 4.7.2
    BD Version: 4.1.7
    BD Google Maps: 4.0.6
    BD Zip Search: 4.0.6

    Difficult to provide steps to reproduce as I inherited the site pre-configured, I didn’t do the migration and didn’t set up the fields correctly. From what I can tell just by looking at things:
    1. Set a TextArea field representing Content
    2. Set a TextArea field representing Excerpt
    3. Set Excerpt TextArea to auto-generate from Content

    Irregardless, from the way that I’m reading your source code, I don’t see a way this wouldn’t cause an infinite loop. Considering the following object dump (this is the actual offending object instance):

    
    object(WPBDP_FormField)[4529]
      private 'id' (WPBDP_Form_Field) => int 3
      private 'type' (WPBDP_Form_Field) => 
        object(WPBDP_FieldTypes_TextArea)[2630]
          private 'name' (WPBDP_Form_Field_Type) => string 'Textarea' (length=8)
      private 'association' (WPBDP_Form_Field) => string 'excerpt' (length=7)
      private 'shortname' (WPBDP_Form_Field) => string 'description' (length=11)
      private 'label' (WPBDP_Form_Field) => string 'Description' (length=11)
      private 'description' (WPBDP_Form_Field) => string '' (length=0)
      private 'tag' (WPBDP_Form_Field) => string 'excerpt' (length=7)
      private 'weight' (WPBDP_Form_Field) => int 4
      private 'validators' (WPBDP_Form_Field) => 
        array (size=0)
          empty
      private 'display_flags' (WPBDP_Form_Field) => 
        array (size=2)
          0 => string 'excerpt' (length=7)
          1 => string 'search' (length=6)
      private 'field_data' (WPBDP_Form_Field) => 
        array (size=7)
          'allow_html' => boolean false
          'allow_iframes' => boolean false
          'allow_filters' => boolean false
          'allow_shortcodes' => boolean false
          'wysiwyg_editor' => boolean false
          'wysiwyg_images' => boolean false
          'auto_excerpt' => boolean true
      public 'css_classes' => 
        array (size=0)
          empty
      public 'html_attributes' => 
        array (size=0)
          empty
    

    This would execute the following given the above steps as far as I can tell:
    (WPBDP_FormField is an empty wrapper for WPBDP_Form_Field)

    1. WPBDP_Form_Field::value( int $post_id, bool $raw )
    2. WPBDP_FieldTypes_TextArea::get_field_value( WPBDP_Form_Field $field, int $post_id ) where $field is the WPBDP_Form_Field instance from step 1
    3. WPBDP_FieldTypes_TextArea::get_field_html_value ( WPBDP_Form_Field $field, int $post_id )
    4. WPBDP_Form_Field::value( int $post_id ) (same as #1, with no instance changes)

    Hope this helps. I’ll reach out via the contact form for the patch and apply.

    Thanks,
    Christian

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi Christian,

    The key step above is your step 3:

    3. Set Excerpt TextArea to auto-generate from Content

    We have a bug with that–it’s fixed in the current dev version. When it happens, you get a white screen–so you hit that exact issue. While the code may not appear to be able to do this, it’s a bug that we found and fixed already.

    We have a patch. Contact us here to get it: https://businessdirectoryplugin.com/contact/

    We’ll be releasing it publicly in a bit, but that’s what happened.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Maximum function nest level of 256 reached.’ is closed to new replies.