{"id":10165,"date":"2023-04-25T12:13:11","date_gmt":"2023-04-25T19:13:11","guid":{"rendered":"https:\/\/codedcommerce.com\/?post_type=product&#038;p=10165"},"modified":"2023-10-08T19:18:26","modified_gmt":"2023-10-09T02:18:26","slug":"debug-pending-software-updates","status":"publish","type":"woo-code","link":"https:\/\/codedcommerce.com\/woo\/debug-pending-software-updates\/","title":{"rendered":"Debug pending software updates"},"content":{"rendered":"\n<pre class=\"wp-block-code language-php\"><code>add_action( 'admin_notices', function() {\n\n\t\/\/ Check plugins\n\t$plugin_updates = get_site_transient( 'update_plugins' );\n\tif( $plugin_updates &amp;&amp; ! empty( $plugin_updates->response ) ) {\n\t\tforeach( $plugin_updates->response as $plugin => $details ) {\n\t\t\techo \"&lt;p>&lt;strong>Plugin&lt;\/strong> &lt;u>$plugin&lt;\/u> is reporting an available update.&lt;\/p>\";\n\t\t}\n\t}\n\n\t\/\/ Check themes\n\twp_update_themes();\n\t$theme_updates = get_site_transient( 'update_themes' );\n\tif( $theme_updates &amp;&amp; ! empty( $theme_updates->response ) ) {\n\t\tforeach( $theme_updates->response as $theme => $details ) {\n\t\t\techo \"&lt;p>&lt;strong>Theme&lt;\/strong> &lt;u>$theme&lt;\/u> is reporting an available update.&lt;\/p>\";\n\t\t}\n\t}\n\n} );<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-10165","woo-code","type-woo-code","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/codedcommerce.com\/wp-json\/wp\/v2\/woo-code\/10165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codedcommerce.com\/wp-json\/wp\/v2\/woo-code"}],"about":[{"href":"https:\/\/codedcommerce.com\/wp-json\/wp\/v2\/types\/woo-code"}],"wp:attachment":[{"href":"https:\/\/codedcommerce.com\/wp-json\/wp\/v2\/media?parent=10165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}