• Resolved emendo_seb

    (@seb-emendo)


    Hi,

    When connect to the admin we got this error :

    Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /www/<private>/html/wp-content/plugins/seo-by-rank-math/includes/modules/content-ai/class-event-scheduler.php:96

    This error seems to be cause by CloudFlare. This request in the class-event-scheduler.php :

    $data        = wp_remote_get( 'https://rankmath.com/wp-json/contentai/v1/defaultPrompts' );

    Return this :

    Error 1015
    Ray ID: 802da03bfda692bd ? 2023-09-07 08:36:46 UTC
    You are being rate limited
    What happened?
    The owner of this website (rankmath.com) has banned you temporarily from accessing this website.
    
    Was this page helpful? Yes No
    Thank you for your feedback!
    Cloudflare Ray ID: 802da03bfda692bd ? Your IP: Click to reveal 139.X.X.X ? Performance & security by Cloudflare

    And at line 96 you try to merge json_decode($data). But json_decode($data) is not an array.

    update_option( 'rank_math_content_ai_prompts', array_merge( json_decode( $data, true ), $custom_prompts ) );


    After disable Content AI Module problem disapear.
    You should maybe decode then test if result is a array before merge.

    A temporary solution is to :

    1. In file /www/<private>/html/wp-content/plugins/seo-by-rank-math/includes/modules/content-ai/class-event-scheduler.php:96 comment the line :
      update_option( ‘rank_math_content_ai_prompts’, array_merge( json_decode( $data, true ), $custom_prompts ) );
    2. Disable Content AI Module
    3. Uncomment the line
    4. Then wait the plugin update ??

    Bests,
    Sébastien.

    • This topic was modified 1 year, 6 months ago by Yui.
    • This topic was modified 1 year, 6 months ago by emendo_seb.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi Sébastien,

    I can confirm that it happened on sites where we have no cloudflare too.

    Best,

    Matt

    Thread Starter emendo_seb

    (@seb-emendo)

    It’s CloudFlare that protect Rankmath website that cause the trouble.
    We have not cloudFlare too.
    Bests.

    Same issue here. Thanks for the heads up!

    How to Disable Content AI Module and Uncomment the line? I trun ( $data, true ) to ( $data, false ), my website still crash. Hope you can help me! Thank you!

    Thread Starter emendo_seb

    (@seb-emendo)

    open the file : <private>/wp-content/plugins/seo-by-rank-math/includes/modules/content-ai/class-event-scheduler.php

    Comment the line at 96 :

    update_option( ‘rank_math_content_ai_prompts’, array_merge(json_decode( $data, true ), $custom_prompts ) );

    Become :

    // update_option( ‘rank_math_content_ai_prompts’, array_merge(json_decode( $data, true ), $custom_prompts ) );

    Got to the menu : RankMath SEO -> Dashboard
    Uncheck the Content AI Module.

    Then uncomment the line.

    Bests.

    • This reply was modified 1 year, 6 months ago by emendo_seb.

    Ok, thank you very much.

    Thanks @seb-emendo, that worked! I also had to increase my PHP memory limit to 512 from 256.

    RankMath SEO, when you resolve this bug?

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @seb-emendo, @updigitalstudio, @newhist, @gauravtiwari, @mexl ,

    Thank you for your patience, sorry for any inconvenience that might have been caused due to that.

    Please update Rank Math & all other plugins, themes and WordPress to the latest version.

    The issue should be fixed.

    If not, please feel free to open a support topic or reply to this message and we will be more than happy to assist.

    Thread Starter emendo_seb

    (@seb-emendo)

    Hi @rankmathteam ,

    I confirm, it’s solved. Thanks !

    Regards,
    Sebastien.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘array_merge(): Argument #1 must be of type’ is closed to new replies.