rankmath / seo-by-rank-math

Rank Math is a revolutionary WordPress SEO Plugin that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible :bulb: :chart_with_upwards_trend: →
https://rankmath.com
107 stars 52 forks source link

Undefined array key when viewing RankMath Sitemap files and using Jetpack Search #144

Closed Sageth closed 1 year ago

Sageth commented 1 year ago

Describe the bug If you enable the free version (or paid) version of Jetpack Search and go to your xml sitemaps, you will receive an error similar to: PHP message: PHP Warning: Undefined array key "jetpack-search-filters-1" in /wp-includes/widgets.php on line 918 PHP message: PHP Warning: Trying to access array offset on value of type null in /wp-includes/widgets.php on line 918" while reading response header from upstream, ..., request: "GET /attachment-sitemap4.xml HTTP/2.0", ..., referrer: "/sitemap_index.xml"

To Reproduce Steps to reproduce the behavior:

  1. Enable Jetpack Search on your site
  2. View any XML Sitemap generated by RankMath
  3. See warning in logs.

Expected behavior Array key defined and is not null when viewing sitemap files. This seems to work as expected in other cases and files, including other files which are not part of wordpress.

Sageth commented 1 year ago

This looks to be a minor issue in widgets.php of Wordpress core. I am working through a PR to address.