PHP Error When Viewing Custom Post Type

#17975
  • Resolved Gareth Daine
    Rank Math free

    Hey,

    When I am trying to view one of my custom post types, I’m getting the following error:

    Fatal error: Uncaught InvalidArgumentException: The $example is required for variable name. in wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-variable.php:92 Stack trace: #0 wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-manager.php(97): RankMath\Replace_Variables\Variable::from('name', Array) #1 wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-author-variables.php(56): RankMath\Replace_Variables\Manager->register_replacement('name', Array, Array) #2 wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-manager.php(154): RankMath\Replace_Variables\Author_Variables->setup_author_variables() #3 wp-includes/class-wp-hook.php(286): RankMath\Replace_Variables\Manager->setup('post.php') #4 wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #5 /hom in wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-variable.php on line 92
    
    The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

    I have then received an email from my site stating…

    Howdy!

    Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

    In this case, WordPress caught an error with one of your plugins, Rank Math SEO.

    First, visit your website and check for any visible issues. Next, visit the page where the error was caught (/wp-admin/post.php?post=4343&action=edit) and check for any visible issues.

    Please contact your host for assistance with investigating this issue further.

    If your site appears broken and you can’t access your dashboard normally, WordPress now has a special “recovery mode”. This lets you safely login to your dashboard and investigate further.

    To keep your site safe, this link will expire in 1 day. Don’t worry about that, though: a new link will be emailed to you if the error occurs again after it expires.

    Can you please advise/fix. Thanks.

    Gareth

    • This topic was modified 5 years, 2 months ago by Gareth Daine.
Viewing 9 replies - 1 through 9 (of 9 total)
  • This appears to be after a recent update (today) and is only affecting custom post types.

    This is happening across all sites we run/own and only on custom post types, as I say.

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I have been able to replicate this bug on your site and this has been submitted to our dev team for closer investigation. I have rolled back the plugin to the previous version and this is now working smoothly.

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Thanks, Michael. Great support. 🙂

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I see the issue on your site but I couldn’t reproduce it on my setup. I tried to import all the CPT UI Settings, Rank Math Settings, Custom post type posts still I don’t get any error. Can you please share temporary FTP access so that we can check and fix the issue on your site?

    Looking forward to helping you. Thank you.

    E-Impact Marketing
    Rank Math business
    Content AI Starter

    I’m getting the exact same error, but for me it shows up when trying to edit Woocommerce orders.

    Hey,

    The problem is, this isn’t just happening on this one site.

    It’s occurring across all of our internal and client sites.

    So, it’s not an isolated incident.

    Cheers

    E-Impact Marketing
    Rank Math business
    Content AI Starter

    I quickly fixed this by commenting out the following in class-variable.php:

     			// if ( ! isset( $args[ $key ] ) ) {
    			// 	/* translators: variable name */
    			// 	throw new \InvalidArgumentException( sprintf( __( 'The $%1$s is required for variable %2$s.', 'rank-math' ), $key, $id ) );
    			// }
    E-Impact Marketing
    Rank Math business
    Content AI Starter

    BTW, if you haven’t noticed yet, these threads all seem to be reporting the exact same issue:

    https://support.rankmath.com/ticket/rankmath-causing-fatal-error/
    https://support.rankmath.com/ticket/fatal-error-after-upgrading-to-1-0-34/

    Time to get this fixed?

    Hello,

    Thank you for contacting Rank Math today.

    Good news! We have fixed this in v1.0.34.1, please update and let us know if the problem has been resolved.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘PHP Error When Viewing Custom Post Type’ is closed to new replies.