Introduction
Today, one of my clients messaged me:
“Hello Andrei! I just started a test OpenAI project on the site you have built last year for me, using the wordpress automatic plugin, and I can’t get rid of this error:
If this error persists, please visit the plugin settings page and enable the option named “Disable register_shutdown_function”. This could be a solution.
Can you help me?”
Martin
(And it was a nice 35” conversation after I replied him back). On short, I solved Martin’s site error, and in this post I will teach you how to solve it, too.
How to solve “Disable register_shutdown_function”?
There are many contributing factors for any WordPress error. In this case, the plugin Martin mentioned above, WordPress Automatic, was generated this type of error. Not the plugin itself (good plugin, by the way – of course, used in good faith), but the wrong settings configured by Martin. And because we are not looking for culprits, but for solutions, I found the way how to solve this issue. I will post it below. Before that, I will post some general fixes for this type of WordPress error, which may work.
Don’t forget: Before doing anything, backup your WordPress site! Ty
A short intro about the issue itself
“Disable register_shutdown_function” may indicate you have configured the PHP Execution Time with a low value number (30 is the default WordPress value for the PHP Exec time). In the case of complex plugins (like the one mentioned above), if the execution time expire before the action is completed, the action will not be registered into the database and it will generate this kind of error. That’s said, you have to increase the PHP Execution Time.
How to increase the PHP Execution Time?
There are a few ways to increase the PHP Execution Time. No one is safe for your site if you don’t have any WordPress experience. And even if you have, I strongly recommend you to backup your site.
To increase the PHP execution time in WordPress, you can follow these steps:
1. Edit the .htaccess
file located in the root directory of your WordPress installation. Add the following line of code to increase the execution time to 300 seconds:
php_value max_execution_time 300
2. Create a new PHP file called php.ini
and add the following line of code to increase the execution time to 300 seconds:
max_execution_time = 300
3. Add the following code to the wp-config.php
file located in the root directory of your WordPress installation:
set_time_limit(300);
4. My favourite old one: Go to cPanel > search for Select PHP version (or PHP selector) > search for the field “max_execution_time” and set the value to your standards ( let’s say 7000).
Solution for WordPress Automatic Plugin
Again, there may be a lot of misconfigurations by the user because, as we know, the devil is hides in the details.
With the last plugin updates, the developers brings 2 new features: OpenAI content creator and PixaBay fetcher, to auto-post related pictures for the new posts. Assuming the plugin worked before you tried to use the last 2 features, I will post the fixes only for the 2 new features:
#1. For OpenAI feature (that’s why Martin picked the plugin).
- Do you also have an OpenAI account? If not, go an create one. You may get $18 free credits, to spend them in the “playground”.
- If you already have an OpenAI, have you copied the API key, and inserted it in the right place, in the “Settings” section of WP Automatic? If not, you know what you have to do.
#2. For PixaBay feature
What I wrote above, in the OpenAI’s case +
- In the Image Options section > Set a featured image from PixaBay for a specific keyword, make sure you insert just 1 related keyword. For example, if you have a budgie pet shop, you have to insert only this word: “budgie”, and not “budgie, green budgie, happy budgie” and so on, because PixaBay will mess with the searches while trying to find images for each and every keyword from the list. So, yes: just 1 keyword.
- Uncheck the “Find the keywords from the post title and call PixaBay every time to get an image”, because of the same reason as the one above: **[Not recommended] This option may return irelevant images because PixaBay expects a single word so if your title contains “pick a car”, the plugin will search for “pick” which may return an image of flower picking
Lastly, the API may simply not working at the moment you get the error, so you may check it up later.
Conclusion
That’s said, once you configured your campaign, everything should working fine right now. I hope this How to get rid of “If this error persists, please visit the plugin settings page and enable the option named “Disable register_shutdown_function”.” was the solution for your issue.
Happy to help, as usual.