• Seeing the following fatal with 2.9.1 update:

    Fatal error: Uncaught Error: Undefined constant "IMSANITY_DEFAULT_MAX_WIDTH" in /srv/htdocs/wp-content/plugins/imsanity/settings.php:686
    Stack trace:
    #0 /wordpress/core/7.0/wp-includes/class-wp-hook.php(343): imsanity_adjust_default_threshold(false, Array, '')
    #1 /wordpress/core/7.0/wp-includes/plugin.php(205): WP_Hook->apply_filters(false, Array)
    #2 /srv/htdocs/wp-content/plugins/imagify/inc/classes/class-imagify-options.php(87): apply_filters('big_image_size_...', 2560, Array, '', 0)
    #3 /srv/htdocs/wp-content/plugins/imagify/classes/Traits/InstanceGetterTrait.php(36): Imagify_Options->__construct()
    #4 /srv/htdocs/wp-content/plugins/imagify/classes/Plugin.php(108): Imagify_Options::get_instance()
    #5 /srv/htdocs/wp-content/plugins/imagify/inc/main.php(33): Imagify\Plugin->init(Array)
    #6 /wordpress/core/7.0/wp-includes/class-wp-hook.php(341): imagify_init('')
    #7 /wordpress/core/7.0/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array)
    #8 /wordpress/core/7.0/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
    #9 /wordpress/core/7.0/wp-settings.php(622): do_action('plugins_loaded')
    #10 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1374): require('/wordpress/core...')
    #11 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1293): WP_CLI\Runner->load_wordpress()
    #12 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
    #13 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(84): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
    #14 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(35): WP_CLI\bootstrap()
    #15 phar:///usr/local/bin/wp-cli/php/boot-phar.php(20): include('phar:///usr/loc...')
    #16 /usr/local/bin/wp-cli(4): include('phar:///usr/loc...')
    #17 {main}
    thrown in /srv/htdocs/wp-content/plugins/imsanity/settings.php on line 686
Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter mtg169

    (@mtg169)

    Seems to be a conflict with imagify and both having a big_image_size_threshold filter. Deactivating imagify prevents the fatal, but one or the other plugin should probably have better handling for this.

    One of our clients has the same issue, however the PHP fatal is rendered from imsanity_adjust_default_threshold();

    PHP Fatal error:  Uncaught Error: Undefined constant "IMSANITY_DEFAULT_MAX_WIDTH" in /home/user/domains/domain.ext/public_html/wp-content/plugins/imsanity/settings.php:686\nStack trace:\n#0 /home/user/domains/domain.ext/public_html/wp-includes/class-wp-hook.php(343): imsanity_adjust_default_threshold()

    Confirming suspicion of conflict with imagify. Subscribing this thread for updates.

    same issue here. created a ticket for imagify support: https://wordpress.org/support/topic/2-2-8-critical-error/#post-18929898

    Several sites have the same issue, crashing the entire site.

    Plugin Support adamewww

    (@adamewww)

    Hey all, thank you for all the feedback and information! We’re checking into it!

    Plugin Author Shane Bishop

    (@nosilver4u)

    We’ve identified the source of the issue in Imsanity and will push out an Imsanity bugfix release early next week. Fix currently available at https://github.com/nosilver4u/imsanity/

    Hi,

    I’m reporting a fatal error too caused by a conflict between Imsanity and the Imagify plugin.

    Environment

    • WordPress 6.7+
    • Imsanity (latest)
    • Imagify (latest)

    What happens

    When both plugins are active, WordPress throws a fatal error on load and the site becomes inaccessible:

    Fatal error: Uncaught Error: Undefined constant "IMSANITY_DEFAULT_MAX_WIDTH"
    in .../wp-content/plugins/imsanity/settings.php:686

    Root cause

    Imagify initializes early via the init hook and calls apply_filters() inside Imagify_Options::__construct(). This triggers imsanity_adjust_default_threshold(), a callback registered by Imsanity on that filter — but at that point Imsanity hasn’t yet defined IMSANITY_DEFAULT_MAX_WIDTH, causing the fatal error.

    The stack trace confirms the call order:

    Imagify_Options->__construct()
      → apply_filters()
        → imsanity_adjust_default_threshold()
          → IMSANITY_DEFAULT_MAX_WIDTH (undefined)

    Steps to reproduce

    1. Install and activate Imsanity.
    2. Install and activate Imagify.
    3. Load any page — fatal error is thrown immediately.

    Workaround
    Deactivating Imsanity resolves the issue.

    Expected behavior
    IMSANITY_DEFAULT_MAX_WIDTH should be defined before any filter callback referencing it can be executed.

    Please let me know if you need additional information.

    Thanks.

    Plugin Author Shane Bishop

    (@nosilver4u)

    @glycymeris Thanks for your report, see my prior reply.

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.