• Resolved nickb26

    (@nickb26)


    I am using Yoast SEO Premium in combination with Wordfence. I have created 301 redirects, which gives the (critical WP) error below.
    I am using multisite also.

    My problem corresponds to this issue

    I have sent the diagnostic report to [email protected].

    [19-Jul-2022 16:55:48 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "SECURE_AUTH_COOKIE" in /var/www/comeru-valisoara/wordpress/current/wp-includes/pluggable.php:928
    Stack trace:
    #0 /var/www/comeru-valisoara/wordpress/current/wp-includes/pluggable.php(694): wp_parse_auth_cookie()
    #1 /var/www/comeru-valisoara/wordpress/current/wp-includes/class-wp-hook.php(307): wp_validate_auth_cookie()
    #2 /var/www/comeru-valisoara/wordpress/current/wp-includes/plugin.php(191): WP_Hook->apply_filters()
    #3 /var/www/comeru-valisoara/wordpress/current/wp-includes/user.php(3583): apply_filters()
    #4 /var/www/comeru-valisoara/wordpress/current/wp-includes/pluggable.php(70): _wp_get_current_user()
    #5 /var/www/comeru-valisoara/wordpress/current/wp-includes/user.php(628): wp_get_current_user()
    #6 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordfence/lib/wfLog.php(497): get_current_user_id()
    #7 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordfence/lib/wfLog.php(255): wfLog->logHitOK()
    #8 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordfence/lib/wordfenceClass.php(1445): wfLog->logHit()
    #9 /var/www/comeru-valisoara/wordpress/current/wp-includes/class-wp-hook.php(307): wordfence::wpRedirectStatusFilter()
    #10 /var/www/comeru-valisoara/wordpress/current/wp-includes/plugin.php(191): WP_Hook->apply_filters()
    #11 /var/www/comeru-valisoara/wordpress/current/wp-includes/pluggable.php(1392): apply_filters()
    #12 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo-premium/src/initializers/redirect-handler.php(670): wp_redirect()
    #13 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo-premium/src/initializers/redirect-handler.php(306): Yoast\WP\SEO\Premium\Initializers\Redirect_Handler->redirect()
    #14 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo-premium/src/initializers/redirect-handler.php(195): Yoast\WP\SEO\Premium\Initializers\Redirect_Handler->do_redirect()
    #15 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo-premium/src/initializers/redirect-handler.php(89): Yoast\WP\SEO\Premium\Initializers\Redirect_Handler->handle_normal_redirects()
    #16 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo/src/loader.php(186): Yoast\WP\SEO\Premium\Initializers\Redirect_Handler->initialize()
    #17 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo/src/loader.php(131): Yoast\WP\SEO\Loader->load_initializers()
    #18 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo/lib/abstract-main.php(43): Yoast\WP\SEO\Loader->load()
    #19 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo-premium/src/functions.php(28): Yoast\WP\Lib\Abstract_Main->load()
    #20 /var/www/comeru-valisoara/wordpress/current/wp-includes/class-wp-hook.php(307): YoastSEOPremium()
    #21 /var/www/comeru-valisoara/wordpress/current/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #22 /var/www/comeru-valisoara/wordpress/current/wp-includes/plugin.php(476): WP_Hook->do_action()
    #23 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo/wp-seo-main.php(493): do_action()
    #24 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordpress-seo/wp-seo.php(50): require_once('...')
    #25 /var/www/comeru-valisoara/wordpress/current/wp-settings.php(373): include_once('...')
    #26 /var/www/comeru-valisoara/wordpress/current/wp-config.php(102): require_once('...')
    #27 /var/www/comeru-valisoara/wordpress/current/wp-load.php(50): require_once('...')
    #28 /var/www/comeru-valisoara/wordpress/current/wp-blog-header.php(13): require_once('...')
    #29 /var/www/comeru-valisoara/wordpress/current/index.php(17): require('...')
    #30 {main}
      thrown in /var/www/comeru-valisoara/wordpress/current/wp-includes/pluggable.php on line 928
    [19-Jul-2022 16:55:48 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "SECURE_AUTH_COOKIE" in /var/www/comeru-valisoara/wordpress/current/wp-includes/pluggable.php:928
    Stack trace:
    #0 /var/www/comeru-valisoara/wordpress/current/wp-includes/pluggable.php(694): wp_parse_auth_cookie()
    #1 /var/www/comeru-valisoara/wordpress/current/wp-includes/class-wp-hook.php(307): wp_validate_auth_cookie()
    #2 /var/www/comeru-valisoara/wordpress/current/wp-includes/plugin.php(191): WP_Hook->apply_filters()
    #3 /var/www/comeru-valisoara/wordpress/current/wp-includes/user.php(3583): apply_filters()
    #4 /var/www/comeru-valisoara/wordpress/current/wp-includes/pluggable.php(70): _wp_get_current_user()
    #5 /var/www/comeru-valisoara/wordpress/current/wp-includes/user.php(628): wp_get_current_user()
    #6 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordfence/lib/wfLog.php(497): get_current_user_id()
    #7 /var/www/comeru-valisoara/wordpress/current/wp-content/plugins/wordfence/lib/wfLog.php(255): wfLog->logHitOK()
    #8 [internal function]: wfLog->logHit()
    #9 {main}
      thrown in /var/www/comeru-valisoara/wordpress/current/wp-includes/pluggable.php on line 928

    `

    • This topic was modified 2 years, 7 months ago by nickb26.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @nickb26, thanks for getting in touch.

    The Undefined constant "SECURE_AUTH_COOKIE" issue broadly speaking suggests that a plugin or mu-plugin is loading a core WordPress file out of order. It may not be Yoast itself that’s doing it, but we have seen it on sites running Yoast before.

    Please see a solution that worked for this user, and a little more background/information in my response here: https://www.ads-software.com/support/topic/php-fatal-error-uncaught-error-undefined-constant-secure_auth_cookie/

    It would be interesting to know if the same solution works in your case.

    Peter.

    Thread Starter nickb26

    (@nickb26)

    Thanks for your reply Peter.

    I added the suggested code to my functions.php but I keep getting a 500 error when I try one of the redirects.

    Plugin Support wfpeter

    (@wfpeter)

    Hi @nickb26,

    I’m sorry to see that didn’t work for you. The error does seem to point to a plugin loading a core file out of order as originally specified, but might need more investigation as to whether the cause is Yoast or another that you have installed.

    You may need to install a maintenance mode plugin and try running Yoast/Wordfence together as the only enabled plugins. If this results in a resolution to the issue, re-enable your plugins one-by-one until the issue returns to find the cause. You may also need to disable your theme during this time and run with a default such as Twenty Twenty-Two as it’s not unheard of for themes rather than plugins to contribute to issues. Again, reenable your theme on its own like you have been doing with the plugins to see if the issue returns when reintroduced.

    Thanks,

    Peter.

    Hi @wfpeter,
    I have the exact same issue and it’s clearly a conflict between Yoast and Wordfence, I contacted Yoast support and here’s what they said:
    “We’d still expect Yoast to work with WordFence. However, as WordFence sometimes modifies parts of the server for security purposes, it takes some additional steps and configuration to make it work with Yoast…we’d recommend you work directly with WordFence to resolve the issue, as there is the expectation that the WordFence plugin needs to be configured first to be able to work with Yoast.”
    Yoast works fine on staging (where Wordfence is not installed) but on production where we have Worfence, it just returns this error and redirections returns 500:
    PHP Fatal error: Uncaught Error: Undefined constant "SECURE_AUTH_COOKIE"
    Please look into and let me know if there is an extra configuration to do.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Yoast SEO premium conflict with’ is closed to new replies.