issue/fix: adrotate_get_update_information()
-
Feel free to fix this in the next update
I patched it by adding && is_array($response) to line 97 in /plugins/adrotate-pro/library/update-api.php
from
if($response) {
to
if($response && is_array($response)) {
(This happened while saving a product. It only happened once, and I could not reproduce it. Also it’s clear in the error trace that the call originated from the wpmudev-updates plugin, however it still calls your plugin via the site transient hook. I’m not sure how a WP_Error object got returned from adrotate_update_check(), you may be able to figure that out if necessary, but since you were expecting an array, I just added the if is_array function to fix the issue on my site. Of course, it may be better to figure out why adrotate_update_check() returns a WP_Error in some cases, and fix that.)
Here is the error log below,
Thanks.
=================================================================PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /www/wp-content/plugins/adrotate-pro/library/update-api.php:98
Stack trace:
#0 /www/wp-includes/class-wp-hook.php(289): adrotate_get_update_information(Object(stdClass))
#1 /www/wp-includes/plugin.php(206): WP_Hook->apply_filters(Object(stdClass), Array)
#2 /www/wp-includes/option.php(1801): apply_filters(‘site_transient_…’, Object(stdClass), ‘update_plugins’)
#3 /www/wp-content/plugins/wpmudev-updates/includes/class-wpmudev-dashboard-api.php(828): get_site_transient(‘update_plugins’)
#4 /www/wp-content/plugins/wpmudev-updates/includes/class-wpmudev-dashboard-api.php(1087): WPMUDEV_Dashboard_Api->get_repo_updates_infos()
#5 /www/wp-content/plugins/wpmudev-updates/includes/class-wpmudev-dashboard-api.php(1154): WPMUDEV_Dashboard_Api->build” while reading upstream, client: 12.345.67.89, server: example.com, request: “GET /wp-admin/post.php?post=173021&action=edit HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php7.4-fpm.sock:”, host: “example.com”, referrer: “/shop/product-173021”=================================================================
The topic ‘issue/fix: adrotate_get_update_information()’ is closed to new replies.