PHP Warning on 1.0.242
-
Hello there,
Since the update to 1.0.242, I get tons of:
PHP Warning: Undefined array key "versions" in /wp-content/plugins/seo-by-rank-math/includes/modules/version-control/class-beta-optin.php on line 106WordPress version is 6.7.2, theme is custom, PHP is 8.2
I downgraded to 1.0.241 and the issue got resolved
-
Hello @userb52,
Thank you for getting in touch and we are sorry to hear about the issue you are facing.
We tested this from our end and we can’t seem to reproduce this error even with the beta option on in the Version Control of our plugin.
Please head over to your WordPress Dashboard > Rank Math > Status & Tools > Database Tools > and click on the button “Remove Transients”. See the screenshot below for your reference: https://i.rankmath.com/i/Db2jvp+
If that doesn’t help, you may try disabling the option “Beta Opt-in” in Rank Math → Status & Tools → Version Control since we currently don’t have an active beta.
Don’t hesitate to get in touch with us if you have any other questions.Thanks for the response
However, “Beta Opt-in” is NOT active on my end. Perhaps that’s the issue?
We don’t have the option to roll back to ver. 1.0.241 on a majority of our sites, especially those on WP Engine.
It will be nice when Rank Math gets their plugin to work on NGINX servers since that’s what most pros work off of.
Hopefully they get some good developers or get bought out by a progressive company, otherwise this will become an SEO plugin mainly for the BlueHost and GoDaddy mom & pop joints.We are experiencing this on our website as well. Hosted on WP Engine, Rank Math PRO installed, no beta mode.
exactly same here. Hosted on WP Engine, Rank Math PRO installed, no beta mode.
Rank Math team is aware of the issue and working on it.
Hello,
Our team has already identified the cause. A fix for this will be included in the next plugin update.
We would also like to share all the technical details of this issue and what exactly is failing.
Our entire team and the developers checked this in detail, and it looks like the issue is with the WordPress HTTP API on WPEngine, not the WP.org API endpoint.
The endpointhttps://api.ww.wp.xz.cn/plugins/info/1.0/seo-by-rank-math.jsondoes return the full data, including the versions field, but only when the request bypasses WordPress HTTP API.
That call is done on the fileseo-by-rank-math\includes\modules\version-control\class-version-control.phpon the functionget_plugin_info();
To confirm this, we tested the following different ways to call the API:
wp_remote_get(): No versions field (Currently used by our plugin)plugins_api(): No versions fieldfile_get_contents(): Full response including versions
So, it does seem like something in WPEngine’s environment (likely a proxy, firewall, or modified cURL config) is interfering with or truncating HTTP API responses.
What we noticed is that when we make that call from websites hosted on WP Engine, the last piece of the data from the response, which includes the versions of the plugin, is not available. That is only available when we use the functionfile_get_contents().
Usingfile_get_contents()works because it entirely avoids the WordPress HTTP wrapper.
To test this on the website, you can output the results of the following calls to the logs and see the difference:
$missing_versions_key = wp_remote_get('https://api.ww.wp.xz.cn/plugins/info/1.0/seo-by-rank-math.json'); $has_versions_key = file_get_contents('https://api.ww.wp.xz.cn/plugins/info/1.0/seo-by-rank-math.json');
This should be able to be confirmed by the WP Engine team if you pass this information along to them.
Rest assured that we are working on a permanent fix for this matter, but we thought it would be beneficial to also share the information with WP Engine since we only see this happening on servers hosted there at the moment.
Don’t hesitate to get in touch if you have any other questions.Hello all, I have opened a ticket with WP-Engine. I’ll update this post as soon as I hear anything
Hello @userb52,
Sure, do let us know how that goes. Thank you for your time.
Meanwhile, you may update to the lastest version of Rank Math as weh have a new update that will address this issue.
Looking forward to helping you.so, 6 months in, I finally got a ridiculous answer on this from WP-Engine:
"Don't use our repository, use the one of ww.wp.xz.cn and it will work"I believe you may close this ticket
Hello @userb52,
Thank you for sharing the reply from WP Engine with us. We have already fixed it in our plugin. You shouldn’t face the issue with the latest version.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.
The topic ‘PHP Warning on 1.0.242’ is closed to new replies.