Support » Plugin: W3 Total Cache » Fatal Error: Redis object/db cache with Redux and/or _deprecated_function

  • Resolved KZeni

    (@kzeni)


    I had a site-wide fatal error come up after W3TC updated on a site of mine.

    It looks to be a conflict with https://wordpress.org/plugins/redux-framework/ (a 1+ million installations plugin) where it was working perfectly fine until the 2.2.2 update of W3TC.

    WP_DEBUG output the following:

    Fatal error: Uncaught ErrorException: Function Redux::setHelpTab is <strong>deprecated</strong> since version Redux 4.3! Use Redux::set_help_tab( $opt_name, $tab ) instead. in /wp-includes/functions.php:5379 Stack trace:
    #0 [internal function]: W3TC\Cache_Redis->W3TC\{closure}(16384, 'Function Redux:...', '/usr/local/apac...', 5379, Array)
    #1 /usr/local/apache/htdocs/wp-includes/functions.php(5379): trigger_error('Function Redux:...', 16384)
    #2 /usr/local/apache/htdocs/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-api.php(1050): _deprecated_function('Redux::setHelpT...', 'Redux 4.3', 'Redux::set_help...')
    #3 /usr/local/apache/htdocs/wp-content/themes/coill/framework/theme-configs.php(176): Redux::setHelpTab('coill_options', Array)
    #4 /usr/local/apache/htdocs/wp-content/themes/coill/functions.php(3): require_once('/usr/local/apac...')
    #5 /usr/local/apache/htdocs/wp-sett in /usr/local/apache/htdocs/wp-includes/functions.php on line 5379

    Not sure how/why, but it appears that _deprecated_function being used by Redux Framework is then being interpreted as Redis caching (via W3TC for object, DB, or both caches) as an exception that causes a site-wide fatal error.

    Of course, a deprecated function warning should definitely not be resulting in a site-wide fatal error so something is misbehaving.

    The WT3C v2.2.2 changelog has “Fix: Convert Redis warnings to exceptions” which has me thinking this is related to whatever changed there. Somehow, it’s taking a plugin using _deprecated_function() and turning it into a fatal exception causing the whole site to go down unless Redis caching via W3TC is disabled (in v2.2.2, anyway.)

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter KZeni

    (@kzeni)

    My workaround (at least to bring the site back online) was to edit the W3TC config (via wp-content/w3tc-config/master.php since the site admin’s inaccessible in order to change it) and disable any/all caching that was set to use Redis (alternatively, I imagine rolling the plugin back to a previous version would work as well.)

    Also, those caches appear to work with other caching methods (APC/etc.) in v2.2.2. It just seems to be an issue with the updates that were made to the Redis caching in W3TC’s most recent update.

    The way Redux Framework is using _deprecated_function (which WP_DEBUG appears to be pointing to as the source of the error… with W3TC appearing to elevate the deprecation warning to a fatal exception) really doesn’t appear to be anything special so this might be a rather hot item as others using Redis caching could find their sites going down with it not being specific to a conflict with Redux Framework.

    Just in case it’s PHP version specific, this site is currently running PHP 7.2.34.

    Of course, I’d love to be able to set this site back to using Redis once this issue has been resolved as it’s been totally trouble-free until now.

    Let me know if there’s anything else that should be provided to help resolve this issue.

    Thread Starter KZeni

    (@kzeni)

    Okay… I checked another site that has Redux Framework (same version) as well as W3TC v2.2.2 with Redis object & db caching enabled on the same exact server as the problematic site & it looks to be working perfectly fine.

    So there might be some other aspect that’s causing the warning to elevate to an error (which didn’t happen until v2.2.2 of W3TC, regardless.)

    Then again, this is probably due to the theme/content on that problematic site triggering the deprecated function warning whereas the other doesn’t (can’t elevate a PHP warning to a fatal exception if there isn’t one.)

    Thread Starter KZeni

    (@kzeni)

    Wait… I am now seeing another site with:

    Fatal error: Uncaught ErrorException: Undefined index: id in /usr/local/apache/htdocs/wp-content/plugins/collaboration/togetherjs.php:183 Stack trace:
    #0 /usr/local/apache/htdocs/wp-content/plugins/collaboration/togetherjs.php(183): W3TC\Cache_Redis->W3TC\{closure}(8, 'Undefined index...', '/usr/local/apac...', 183, Array)
    #1 /usr/local/apache/htdocs/wp-content/plugins/collaboration/togetherjs.php(42): together_js->populate_settings()
    #2 /usr/local/apache/htdocs/wp-content/plugins/collaboration/togetherjs.php(603): together_js->__construct()
    #3 /usr/local/apache/htdocs/wp-includes/class-wp-hook.php(307): together_js_init('')
    #4 /usr/local/apache/htdocs/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #5 /usr/local/apache/htdocs/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #6 /usr/local/apache/htdocs/wp-settings.php(5 in /usr/local/apache/htdocs/wp-content/plugins/collaboration/togetherjs.php on line 183

    So this is another case where something that was previously a notice/warning from some plugin is being elevated to a fatal exception by W3TC’s new Redis behavior (which, again, definitely shouldn’t be the case.)

    Thread Starter KZeni

    (@kzeni)

    Here’s another error from another site with this happening:

    Fatal error: Uncaught ErrorException: Function register_rest_route was called <strong>incorrectly</strong>. The REST API route definition for <code>boldlab-core/v1/registration</code> is missing the required <code>permission_callback</code> argument. For REST API routes that are intended to be public, use <code>__return_true</code> as the permission callback. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.5.0.) in /usr/local/apache/htdocs/wp-includes/functions.php:5831 Stack trace:
    #0 [internal function]: W3TC\Cache_Redis->W3TC\{closure}(1024, 'Function regist...', '/usr/local/apac...', 5831, Array)
    #1 /usr/local/apache/htdocs/wp-includes/functions.php(5831): trigger_error('Function regist...', 1024)
    #2 /usr/local/apache/htdocs/wp-includes/rest-api.php(103): _doing_it_wrong('register_rest_r...', 'The REST API ro...', '(This message w...' in /usr/local/apache/htdocs/wp-includes/functions.php on line 5831

    Again, it really seems like any site set to use W3TC’s Redis caching is having any PHP warning be escalated to a fatal error per the v2.2.2 update.

    It actually has nothing to do with Redux Framework or _deprecated_function, specifically, regardless of what my initial debugging showed & is actually much more widespread than that (any PHP warning encountered site-wide appears to become a fatal error when Redis is enabled).

    Thread Starter KZeni

    (@kzeni)

    Okay… I found https://github.com/W3EDGE/w3-total-cache/pull/518/commits/12080e27a941aa2893ac74634bcf114d63977b21 is the likely culprit (at least it’s isolated to whatever changes were made to Cache_Redis.php from v2.2.1 to v2.2.2).

    As a workaround for now, I took the Cache_Redis.php file from 2.2.1 and overwrote the file from 2.2.2 with that. I then updated the w3-total-cache.php file to have it be version 2.2.2.1 so it serves as a hotfix until 2.2.3 comes out as an official fix to this issue. I then uploaded the zip to a temporary URL and then I’m using wp plugin install *insert URL where I've uploaded a zip of my patched plugin* --force across all my sites with W3TC installed (since they all use Redis & auto-update; hence why I’m having so many sites with issues per the v2.2.2 release appearing to escalate PHP warnings to fatal errors.)

    This appears to resolve the issue for now in a scalable way (with 2.2.3 hopefully on the way soon to fix it officially) since the rest of 2.2.2 seems to be fine and it’s just that updated Redis error/exception handling that’s really made 2.2.2 cause issues across a ton of sites.

    Thread Starter KZeni

    (@kzeni)

    I’ve submitted this as an issue on GitHub at https://github.com/W3EDGE/w3-total-cache/issues/523 just in case people check there first or vice-versa.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @kzeni

    Thank you for taking the time to report the problem and open a GH issue for this.
    As I’ve mentioned already, we are checking this and working on a fix asap.
    Once again thank you for your patience!

    Thread Starter KZeni

    (@kzeni)

    @vmarko Thanks for the update & jumping on this! I’ll keep an eye out for the patched release.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @kzeni

    Just a quick FYI, the fix for the issue is done, and we are running some final tests before the patch release.
    Once again, thank you for your patience!

    Thread Starter KZeni

    (@kzeni)

    Thanks for the update! Marking as resolved with anticipation of the issue being resolved in the next release.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @kzeni

    Thank you for your patience.
    The issue is now fixed. Please update the plugin to the latest 2.2.3 release.
    Thanks!

    Thread Starter KZeni

    (@kzeni)

    Confirmed to be as working as expected. Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @kzeni

    You are most welcome!

    We would really appreciate it if you could take a minute and post a review here. This will help us to continue offering a top-notch product to users.
    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.