Trying to access array offset on value

#1010247
  • Resolved wellexpert Cleaning
    Rank Math free

    Warning: Trying to access array offset on value of type bool in /home/wellexpert/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/version-control/class-beta-optin.php on line 106

    Warning: Trying to access array offset on value of type bool in /home/wellexpert/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/version-control/class-beta-optin.php on line 145

    I have facing this error i check my website troubleshooting health all is ok, no other plugin is conflict please solve this issue as soon as possible

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

    We apologize for the issue you are facing with the warnings related to accessing array offsets in the Rank Math plugin. This type of warning typically indicates that the code is trying to access an array element, but the variable being accessed is a boolean value instead.

    Here are a few steps you can take to troubleshoot and potentially resolve this issue:

    1. Update Rank Math: Ensure that you are using the latest version of the Rank Math plugin. Sometimes, these issues are resolved in newer updates.

    2. Check for Theme Conflicts: Even if you have checked for plugin conflicts, it’s also worth checking if your theme might be causing the issue. You can temporarily switch to a default WordPress theme (like Twenty Twenty-One) to see if the warnings persist.

    3. Debugging: If you are comfortable with PHP, you can add some debugging code around the lines mentioned in the warning to check what values are being returned and why they might be boolean instead of an array.

    4. Reinstall Rank Math: If the problem persists, consider reinstalling the Rank Math plugin. Make sure to back up your settings before doing this.

    If none of these steps resolve the issue, please reply to this ticket with your site URL so that a human agent from our support team can assist you further. Thank you for your patience!

    Sources:
    Fatal Error Happening on Some Installations After 1.0.49 Update » Rank Math

    Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    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 endpoint https://api.wordpress.org/plugins/info/1.0/seo-by-rank-math.json does return the full data, including the versions field, but only when the request bypasses WordPress HTTP API.

    That call is done on the file seo-by-rank-math\includes\modules\version-control\class-version-control.php on the function get_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 field
    file_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 function file_get_contents().

    Using file_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.wordpress.org/plugins/info/1.0/seo-by-rank-math.json');
    $has_versions_key = file_get_contents('https://api.wordpress.org/plugins/info/1.0/seo-by-rank-math.json');
    

    This should be able to be confirmed by the WP Engine teamif 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,

    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 3 replies - 1 through 3 (of 3 total)

The ticket ‘Trying to access array offset on value’ is closed to new replies.