Fatal Error & Warning on Rank Math while viewing sitemap

#201503
  • Resolved Saumya Majumder
    Rank Math free

    Hi,
    While checking the sitemap of one of my client clients I saw that inside the sitemap index one of the sitemap was not working and throwing critical error. So, I enabled WP_Debug and saw that Rankmath was throwing a few warnings and then one Fatal error which basically crashed the page.

    I’ve attaching the logs here so that you guys can easily see and fix the problems:

    Warning: Trying to access array offset on value of type int in /example.com/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/acf/class-acf.php on line 106

    Warning: Trying to access array offset on value of type int in /example.com/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/acf/class-acf.php on line 107

    Warning: Trying to access array offset on value of type int in /example.com/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/acf/class-acf.php on line 108

    Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /example.com/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/acf/class-acf.php:99 Stack trace: #0 /example.com/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/acf/class-acf.php(78): RankMathProACFACF->add_images_to_sitemap() #1 /example.com/public/wp-includes/class-wp-hook.php(292): RankMathProACFACF->add_acf_images() #2 /example.com/public/wp-includes/plugin.php(255): WP_Hook->apply_filters() #3 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(102): apply_filters_ref_array() #4 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-image-parser.php(130): RankMathSitemapImage_Parser->do_filter() #5 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/providers/class-post-type.php(447): RankMathSitemapImage_Parser->get_images() #6 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/providers/class-post-type.php(197): RankMathSitemapProvidersPost_Type->get_url() #7 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-generator.php(169): RankMathSitemapProvidersPost_Type->get_sitemap_links() #8 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-generator.php(135): RankMathSitemapGenerator->build_sitemap() #9 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-sitemap-xml.php(153): RankMathSitemapGenerator->get_output() #10 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-sitemap-xml.php(144): RankMathSitemapSitemap_XML->build_sitemap() #11 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-sitemap-xml.php(84): RankMathSitemapSitemap_XML->has_sitemap_in_cache() #12 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-sitemap-xml.php(74): RankMathSitemapSitemap_XML->output() #13 /example.com/public/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-router.php(78): RankMathSitemapSitemap_XML->__construct() #14 /example.com/public/wp-includes/class-wp-hook.php(292): RankMathSitemapRouter->request_sitemap() #15 /example.com/public/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #16 /example.com/public/wp-includes/plugin.php(551): WP_Hook->do_action() #17 /example.com/public/wp-includes/class-wp-query.php(1083): do_action_ref_array() #18 /example.com/public/wp-includes/class-wp-query.php(1771): WP_Query->parse_query() #19 /example.com/public/wp-includes/class-wp-query.php(3465): WP_Query->get_posts() #20 /example.com/public/wp-includes/class-wp.php(629): WP_Query->query() #21 /example.com/public/wp-includes/class-wp.php(752): WP->query_posts() #22 /example.com/public/wp-includes/functions.php(1291): WP->main() #23 /example.com/public/wp-blog-header.php(16): wp() #24 /example.com/public/index.php(17): require('...') #25 {main} thrown in /example.com/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/acf/class-acf.php on line 99

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    Thank you for providing the staging site for us.

    I tried disabling the option “Include Images from the ACF Fields.” under Rank Math > Sitemap Settings > General and the error goes away. Enabling it again the error shows but when I deactivate and re-activate the ACF plugin, the error doesn’t shows up even the “Include Images from the ACF Fields.” option is enabled.

    It looks like Rank Math can’t pick up the image from the ACF content so well. Allow me to further inspect the issue with our dev team.

    Looking forward to helping you.

    Hi Jeremy,
    I can confirm that turning off Include Images from the ACF Fields option works and the errors goes away. But as soon as that option is turned back on, the errors are back. It doesn’t matter if I disable/re-enable ACF. As long as that option is turned on, errors are coming.

    Thanks for finding this out, I’ll turn off that option for now in the live site until the dev team figures out exactly whats’s causing it and a fix for it.

    Can you let me know when an update gets pushed with this fix so that I can turn the option back on in the live site?

    Hello.

    Apologies for the delay.

    Yes, we will update you here once our development team conducted further investigation into this issue and let you know the root cause.

    Meanwhile, please don’t hesitate to contact us anytime to assist you further with anything else.

    We would really appreciate your kind patience regarding this matter.

    Looking forward to helping you.

    Thank you.

    Did the dev team get a chance to look at it yet?

    Hello,

    We were able to reproduce the error and have logged it. Please allow us some time to test and release a fix. It should be added to the plugin in the upcoming update.

    For now, to fix the issue on your site, I made some changes in the includes/modules/acf/class-acf.php file. This is the new file which I replaced it with: https://i.rankmath.com/tZfX3r

    The Sitemap is now working on your site properly.

    I hope that helps. If you need any other assistance, please feel free to let us know. We are here to help.

    Thank you.

    Thanks, Pratik,
    I’ll update that file to the live site and wait for the next release of Rank Math. I hope it will be fixed in the upcoming release right?

    Hello,

    Yes, the fix would be released on the official update soon. You can also keep an eye on our changelog here:
    https://rankmath.com/changelog/

    Meanwhile, please don’t hesitate to contact us anytime to assist you further with anything else.

    Thank you.

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

You must be logged in to reply to this ticket.