• Resolved strarsis

    (@strarsis)


    Suddenly the crop editor doesn’t open anymore (blank page) and a PHP error is logged:

    WARNING: [pool www] child 17 said into stderr: “NOTICE: PHP message: PHP Fatal error: Uncaught Error: Maximum function nesting level of ‘256’ reached, aborting! in /srv/www/web/app/plugins/crop-thumbnails/functions/editor.php:258”
    WARNING: [pool www] child 17 said into stderr: “Stack trace:”
    WARNING: [pool www] child 17 said into stderr: “#0 /srv/www/web/app/plugins/crop-thumbnails/functions/editor.php(258): abs(893)”
    WARNING: [pool www] child 17 said into stderr: “#1 /srv/www/web/app/plugins/crop-thumbnails/functions/editor.php(258): CropPostThumbnailsEditor::my_gcd(903, 10)”
    WARNING: [pool www] child 17 said into stderr: “#2 /srv/www/web/app/plugins/crop-thumbnails/functions/editor.php(258): CropPostThumbnailsEditor::my_gcd(913, 903)”
    WARNING: [pool www] child 17 said into stderr: “#3 /srv/www/web/app/plugins/crop-thumbnails/functions/editor.php(258): CropPostThumbnailsEditor::my_gcd(10, 913)”
    WARNING: [pool www] child 17 said into stderr: “#4 /srv/www/web/app/plugins/crop-thumbnails/functions/editor.php(258): CropPostThumbnailsEditor::my_gcd(923, 10)”
    WARNING: [pool www] child 17 said into stderr: “#5 /srv/www/web/app/plugins/crop-thumbnails/functions/editor.php(258): CropPostThumbnailsEditor::my_gcd(933, 923)”
    WARNING: [pool www] child 17 said into stderr: “#6 /srv/www/web/app/plugins/crop-thumbnails/functions/editor.php(258): CropPostThumbnailsEditor::my_gcd(10, 933)”
    WARNING: [pool www] child 17 said into stderr: “#7 /srv/www/web/app/plugins/crop-thumbnails/functions/editor.php…”

    Only this plugin was enabled on the site.

    • This topic was modified 6 years, 9 months ago by strarsis.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    Hi,
    thank you for sharing this. I have a couple of questions to get this bug fixed:

    • What image-sizes do you have registered (name and pixel-sizes please)?
    • On settings screen of the plugin is a plugin-test. Please post your results.
    • What′s your PHP version?
    • What′s your WordPress Version?
    • What′s your Crop-Thumbnails Version?
    Thread Starter strarsis

    (@strarsis)

    The issue was a too small function nesting level in xdebug.
    The issue was fixed by increasing it to a higher number.
    However, it would be a better solution if a non-recursive approach is used for that part of code because this will avoid any deep function nesting.

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    Thanks for responding and get in touch with the issue. Can you please provide me the image-size that caused the large recrusion.

    Thread Starter strarsis

    (@strarsis)

        // Images
        define('WP_IMAGE_AUTO_WIDTH', 9999);
    
        // Slide
        $image_slide_base_width    = 600;
        $image_slide_base_height   = 482;
        $image_slide_base_wh_ratio = $image_slide_base_height / $image_slide_base_width;
    
        add_image_size(
            'slide',
            $image_slide_base_width,
            $image_slide_base_height,
            true
        );
    
        $image_slide_widths = array(
            2   * $image_slide_base_width,
            2.5 * $image_slide_base_width,
            3   * $image_slide_base_width,
            0.5 * $image_slide_base_width,
        );
        foreach($image_slide_widths as $image_slide_width) {
            add_image_size(
                'slide-' . $image_slide_width,
                      $image_slide_width,
                round($image_slide_width * $image_slide_base_wh_ratio),
                true
            );
        }
    
        // Service
        $image_service_base_width    = 336;
        $image_service_base_height   = 164;
        $image_service_base_wh_ratio = $image_service_base_height / $image_service_base_width;
    
        add_image_size(
            'service',
            $image_service_base_width,
            $image_service_base_height,
            true
        );
    
        $image_service_widths = array(
            2   * $image_service_base_width,
            2.5 * $image_service_base_width,
            3   * $image_service_base_width,
            0.5 * $image_service_base_width,
        );
        foreach($image_service_widths as $image_service_width) {
            add_image_size(
                'service-' . $image_service_width,
                      $image_service_width,
                round($image_service_width * $image_service_base_wh_ratio),
                true
            );
        }
    
        // Photo (large)
        $image_photo_large_base_width  = 567;
        $image_photo_large_base_height = 600;
        $image_photo_large_base_wh_ratio = $image_photo_large_base_width / $image_photo_large_base_height;
    
        add_image_size(
            'photo_large',
            $image_photo_large_base_width,
            $image_photo_large_base_height,
            true
        );
    
        $image_photo_large_widths = array(
            2   * $image_photo_large_base_width,
            2.5 * $image_photo_large_base_width,
            3   * $image_photo_large_base_width,
            0.5 * $image_photo_large_base_width,
        );
        foreach($image_photo_large_widths as $image_photo_large_width) {
            add_image_size(
                'photo_large-' . $image_photo_large_width,
                $image_photo_large_width,
                round($image_photo_large_width * $image_service_base_wh_ratio),
                true
            );
        }
    
        // Photo (small)
        $image_photo_small_base_height = 150;
    
        add_image_size(
            'photo_small',
            WP_IMAGE_AUTO_WIDTH,
            $image_photo_small_base_height,
            false
        );
    
        $image_photo_small_heights = array(
            2   * $image_photo_small_base_height,
            2.5 * $image_photo_small_base_height,
            3   * $image_photo_small_base_height,
            0.5 * $image_photo_small_base_height,
        );
        foreach($image_photo_small_heights as $image_photo_small_height) {
            add_image_size(
                'photo_small-' . $image_photo_small_height,
                WP_IMAGE_AUTO_WIDTH,
                $image_photo_small_height,
                false
            );
        }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Maximum function nesting level of ‘256’’ is closed to new replies.