hurraki_tooltip_checkDate__ produces errors in production
-
It seems you call
hurraki_tooltip_checkDate__
in thewp_footer
hook which is not a good idea in general.That means that every normal website visitor will trigger this (on every page visit). Same in the backend.
The whole logic to fetch and update the words should be implemented with wp-cron.php in mind and transients.
A user reported a problem where the website takes forever to load and after 127 seconds your code outputs a curl error (with a copy-pasted typo):
error occured during curl exec. Additioanl info ... 'total_time' => 127.2588339999999931251295492984354496002197265625
It would be better to offload this to the REST API of WordPress + only run it for cronjobs.
Also doing a
die('error occured during curl exec. Additioanl info: ' . var_export($info));
is not a good idea because it will stop the execution right there, will output the whole stuff to the frontend and will not log anything.See:
wp_remote_get
: https://developer.www.ads-software.com/reference/functions/wp_remote_get/
wp_doing_cron
: https://developer.www.ads-software.com/reference/functions/wp_doing_cron/
WP_Error
: https://developer.www.ads-software.com/reference/classes/wp_error/__construct/ and https://developer.www.ads-software.com/reference/classes/wp_error/#comment-1973
set_transient
: https://developer.www.ads-software.com/reference/functions/set_transient/And you might want to check if your server blocks / throttles some other servers. The affected user uses Strato.
- This topic was modified 3 years, 4 months ago by .
- The topic ‘hurraki_tooltip_checkDate__ produces errors in production’ is closed to new replies.