array_merge(): Argument #1 must be of type

[ad_1]

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 3 hours, 52 minutes ago by Yui.
  • This topic was modified 3 hours, 44 minutes ago by emendo_seb.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer