• Resolved robwent

    (@robwent)


    Hi,

    I have your plugin running on some sites with PHP 8.2 with no issues.

    On another, I’m getting fatal errors that the class EWWWIO_GD_Editor isn’t a valid callback.

    It happens when any plugin or theme calls the wp_enqueue_media() function in the admin. If I comment that out then the admin loads but those plugins and themes are broken (Mostly commercial, revslider, newspaper theme and a custom plugin).

    If I disable ewww then everything works.

    This happens with any PHP version from 8.0 up.

    General stack trace:

    [19-Jun-2023 21:25:23 UTC] PHP Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "EWWWIO_GD_Editor" not found in path\wp-includes\media.php:3934
    Stack trace: 0 path\wp-includes\media.php(3905): _wp_image_editor_choose(Array) 1 path\wp-includes\media.php(4019): wp_image_editor_supports(Array) 2 path\wp-includes\media.php(4748): wp_plupload_default_settings() 3 path\wp-content\plugins\wp-templater\modules\scripts.php(10): wp_enqueue_media() 4 path\wp-includes\class-wp-hook.php(308): wt_add_script_fn('') 5 path\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) 6 path\wp-includes\plugin.php(517): WP_Hook->do_action(Array) 7 path\wp-includes\script-loader.php(2026): do_action('wp_print_script…') 8 path\wp-includes\class-wp-hook.php(308): print_head_scripts('') 9 path\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) 10 path\wp-includes\plugin.php(517): WP_Hook->do_action(Array) 11 path\wp-admin\admin-header.php(146): do_action('admin_print_scr…') 12 path\wp-admin\plugins.php(605): require_once('D:\laragon\www\…') 13 {main} thrown in path\wp-includes\media.php on line 3934

    Possibly has something to do with removing the wp_image_editors filter?

    Is that enough info to test?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    Hmm, I was thinking also that perhaps if another plugin removed our wp_image_editors filter/function, it might cause issues. But, both the class declarations and the addition of the EWWWIO_GD_Editor to the list of available image editors happen in the filter function: ewww_image_optimizer_load_editor().

    The only way I can see for the EWWWIO_GD_Editor class to be “registered” in the list of editors and yet not exist, is if the Bbpp_Animated_Gif class exists. This is from a very old (and unmaintained) Animated GIF Resize plugin. Don’t suppose you have that plugin on the site?

    I do see that our “deprecation” of support for AGR wasn’t done very well, so I’m going to see if we can improve that in the next release and make sure to avoid this sort of error, whatever the cause might be.

    Thread Starter robwent

    (@robwent)

    Yes!

    That’s one I had to fix: https://github.com/robwent/animated-gif-resize

    Unfortunatly I might need to keep it as core still doesn’t seem to support it.

    I’ll have a look through the code and see what I can do. Odd that the behaviour changes with PHP versions.

    Thanks for looking into it!

    Plugin Author nosilver4u

    (@nosilver4u)

    FYI, part of the reason we stopped supporting AGR is that EWWW IO has built-in support for resizing animated GIFs–using gifsicle, so long as your server supports running that locally and/or you’re using the Compress API with an active key.

    If you’re using free/local mode and you’re not sure, you can check the System Info on the Support tab to see if the plugin is able to detect gifsicle. You can also post the System Info via pastebin and we can double-check it for you.

    Thread Starter robwent

    (@robwent)

    Looks like it’s there:

    enabled: gifsicle
    enabled: jpegtran
    enabled: optipng
    wp-content/ewww permissions: 0755
    EWWW\Local::install_paths()
    CPU architecture: x86_64
    generated paths:
    path/wp-content/plugins/ewww-image-optimizer/binaries/jpegtran-linux
    path/wp-content/plugins/ewww-image-optimizer/binaries/optipng-linux
    path/wp-content/plugins/ewww-image-optimizer/binaries/gifsicle-linux
    path/wp-content/plugins/ewww-image-optimizer/binaries/pngquant-linux
    path/wp-content/plugins/ewww-image-optimizer/binaries/cwebp-linux
    path/wp-content/ewww/jpegtran
    path/wp-content/ewww/optipng
    path/wp-content/ewww/gifsicle
    path/wp-content/ewww/pngquant
    path/wp-content/ewww/cwebp
    Linux/UNIX style OS, checking permissions
    EWWW\Local::check_permissions()
    permissions for path/wp-content/ewww/jpegtran: 0755
    permissions ok
    EWWW\Local::check_permissions()
    permissions for path/wp-content/ewww/gifsicle: 0755
    permissions ok
    EWWW\Local::check_permissions()
    permissions for path/wp-content/ewww/optipng: 0755
    permissions ok
    ewww_image_optimizer_load_editor()
    loading image editors: EWWWIO_Imagick_Editor
    EWWWIO_GD_Editor
    WP_Image_Editor_Imagick
    Bbpp_Animated_Gif
    WP_Image_Editor_GD
    ewww_image_optimizer_bulk_script()
    ewww_image_optimizer_tool_script()
    ewww_image_optimizer_webp_script()
    ewww_image_optimizer_settings_script()
    EWWW\Base::content_url()
    site/upload url: https://www.goodnewsnetwork.org
    site/upload domain: www.goodnewsnetwork.org
    upload_url: https://www.goodnewsnetwork.org/wp-content/uploads/
    ewww_image_optimizer_easy_site_registered()
    EWWW\Plugin::notice_utils()
    EWWW\Local::exec_check()
    EWWW\Local::check_all_tools()
    EWWW\Local::check_tool()
    EWWW\Local::find_nix_binary()
    checking bundled tool
    found path/wp-content/ewww/gifsicle, testing…
    EWWW\Local::check_integrity()
    path/wp-content/ewww/gifsicle: 205abe804d1060375f713d990c45b0285cbc4b56226da1612e9f1d2d2e2c5369
    checksum verified, binary is intact
    EWWW\Base::mimetype()
    testing mimetype: path/wp-content/ewww/gifsicle
    7f454c46
    ewwwio type: application/x-executable
    EWWW\Local::test_binary()
    testing case: gifsicle at path/wp-content/ewww/gifsicle
    path/wp-content/ewww/gifsicle: LCDF Gifsicle 1.93
    optimizer found
    using: path/wp-content/ewww/gifsicle
    EWWW\Local::check_tool()
    EWWW\Local::find_nix_binary()

    So I can just disable the other plugin?

    Thread Starter robwent

    (@robwent)

    I’ve just tested with a large sized animated gif with AGR off.

    There’s no animated resized versions, but there’s also no static ones either.

    With EWWW off and AGR enabled, static thumbs are created. So it’s not working anyway.

    Case closed. Thanks for taking a look!

    Update: Testing on the live site, animated thumbs are created. exec was disabled for the dev domain.

    • This reply was modified 1 year, 5 months ago by robwent.
    • This reply was modified 1 year, 5 months ago by robwent.
    Plugin Author nosilver4u

    (@nosilver4u)

    Yup, if exec() is disabled, then the site would be using free+API mode which is JPG-only, so that makes sense. Glad you got it working!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP >= 8.0 fatal errors’ is closed to new replies.