{"id":126346,"date":"2020-08-06T00:56:30","date_gmt":"2020-08-06T00:56:30","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/updates-api-inspector\/"},"modified":"2020-08-06T01:02:34","modified_gmt":"2020-08-06T01:02:34","slug":"updates-api-inspector","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/updates-api-inspector\/","author":8976791,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.1.1","stable_tag":"0.1.1","tested":"5.5.0","requires":"4.6","requires_php":"","requires_plugins":"","header_name":"Updates API Inspector","header_author":"Paul V. Biron\/Sparrow Hawk Computing","header_description":"Inspect various aspects of the Updates API.","assets_banners_color":"","last_updated":"2020-08-06 01:02:34","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_s-xclick&hosted_button_id=Z6D97FA595WSU","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/updates-api-inspector\/","header_author_uri":"https:\/\/sparrowhawkcomputing.com\/","rating":5,"author_block_rating":0,"active_installs":10,"downloads":1965,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":1},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"2353489","resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"2353489","resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"2353489","resolution":"3","location":"assets","locale":""},"screenshot-4.png":{"filename":"screenshot-4.png","revision":"2353489","resolution":"4","location":"assets","locale":""},"screenshot-5.png":{"filename":"screenshot-5.png","revision":"2353489","resolution":"5","location":"assets","locale":""}},"screenshots":{"1":"The <code>Request<\/code> for plugin updates","2":"The <code>API Response<\/code> for plugin updates","3":"The <code>Transient Value as Set<\/code> for plugin updates","4":"The <code>Transient Value as Read<\/code> for plugin updates","5":"Multisite"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[189222],"plugin_category":[],"plugin_contributors":[78960,144821],"plugin_business_model":[],"class_list":["post-126346","plugin","type-plugin","status-publish","hentry","plugin_tags-updates-api","plugin_contributors-afragen","plugin_contributors-pbiron","plugin_committers-pbiron"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/updates-api-inspector.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/updates-api-inspector\/assets\/screenshot-1.png?rev=2353489","caption":"The <code>Request<\/code> for plugin updates"},{"src":"https:\/\/ps.w.org\/updates-api-inspector\/assets\/screenshot-2.png?rev=2353489","caption":"The <code>API Response<\/code> for plugin updates"},{"src":"https:\/\/ps.w.org\/updates-api-inspector\/assets\/screenshot-3.png?rev=2353489","caption":"The <code>Transient Value as Set<\/code> for plugin updates"},{"src":"https:\/\/ps.w.org\/updates-api-inspector\/assets\/screenshot-4.png?rev=2353489","caption":"The <code>Transient Value as Read<\/code> for plugin updates"},{"src":"https:\/\/ps.w.org\/updates-api-inspector\/assets\/screenshot-5.png?rev=2353489","caption":"Multisite"}],"raw_content":"<!--section=description-->\n<p>The WordPress Updates API is pretty much a mystery to many developers for many reasons, not least of which is the fact that there is <em>no documentation<\/em> for it.<\/p>\n\n<p>For plugins hosted in the <a href=\"https:\/\/wordpress.org\/plugins\/\">WordPress Plugin Directory<\/a> and themes hosted in the <a href=\"https:\/\/wordpress.org\/themes\/\">WordPress Theme Directory<\/a> (and core itself), the API \"just works\".<\/p>\n\n<p>Plugins and themes hosted externally (such as premium plugins\/themes) need to hook into the API and ensure the proper information is populated in the proper site transients so that core can offer updates for those externally hosted plugins\/themes.  What site transients are those:<\/p>\n\n<ul>\n<li><code>update_plugins<\/code><\/li>\n<li><code>update_themes<\/code><\/li>\n<\/ul>\n\n<p>(and of course, <code>update_core<\/code> for core updates).<\/p>\n\n<p>This plugin attempts to demystify the Updates API by allowing you to inspect:<\/p>\n\n<ul>\n<li>how the API is queried by core<\/li>\n<li>what the API returns in respose to a query<\/li>\n<li>what's in the site transients core uses when offering updates to admin users (whether manual or auto-updates)<\/li>\n<\/ul>\n\n<p>At this point, this plugin is <em>very preliminary<\/em> (it is version 0.1.1 after all), but I'm releasing it in it's current state because of the new <a href=\"https:\/\/make.wordpress.org\/core\/2020\/07\/15\/controlling-plugin-and-theme-auto-updates-ui-in-wordpress-5-5\/\">Auto-updates UI in WordPress 5.5.0<\/a>.  While many externally hosted plugins\/themes have been hooking into API for years, the new auto-updates UI has certain requirements for how the site transients are populated and not all externally hosted plugins\/themes have populated them such that the new UI will work properly (see <a href=\"https:\/\/make.wordpress.org\/core\/2020\/07\/30\/recommended-usage-of-the-updates-api-to-support-the-auto-updates-ui-for-plugins-and-themes-in-wordpress-5-5\/\">Recommended usage of the Updates API to support the auto-updates UI for Plugins and Themes in WordPress 5.5<\/a>).<\/p>\n\n<p>My hope is that by providing an easy way for developers to inspect the API queries\/responses and the site transients core populates from them, they will more easily be able to update their code so that the new UI works properly for them.<\/p>\n\n<p>In future versions, I plan to add many other features, as well as more extensive on-screen help of an \"educational\" nature.<\/p>\n\n<!--section=installation-->\n<p>From your WordPress dashboard<\/p>\n\n<ol>\n<li>Go to <em>Plugins &gt; Add New<\/em> and click on <em>Upload Plugin<\/em><\/li>\n<li>Upload the zip file<\/li>\n<li>Activate the plugin<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt><h3>Why isn't the Updates API documented?<\/h3><\/dt>\n<dd><p>That's a good question, and I honestly don't know the answer.<\/p><\/dd>\n<dt><h3>What's the best hook to use for injecting information about by externally hosted plugin or theme into the site transients?<\/h3><\/dt>\n<dd><p>There is no <em>best hook<\/em>!<\/p>\n\n<p>The most common hooks used are probably:<\/p>\n\n<ul>\n<li>For plugins:\n\n<ul>\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/pre_set_site_transient_transient\/\">pre_set_site_transient_update_plugins<\/a> (fires when the transient is set)<\/li>\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/site_transient_transient\/\">site_transient_update_plugins<\/a> (fires when the transient is \"got\")<\/li>\n<\/ul><\/li>\n<li>For themes:\n\n<ul>\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/pre_set_site_transient_transient\/\">pre_set_site_transient_update_themes<\/a> (fires when the transient is set)<\/li>\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/site_transient_transient\/\">site_transient_update_themes<\/a> (fires when the transient is \"got\")<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<p>A number of other hooks can be used, but except in *very special** cases I wouldn't recommend them...so I'm not even going to list what they are :-)<\/p>\n\n<p>Many considerations go into deciding which hook to use and I couldn't possibly give those considerations their due here...so I won't even try.<\/p><\/dd>\n<dt><h3>Will this plugin work in versions of WordPress prior to 5.5.0?<\/h3><\/dt>\n<dd><p>It should!  My main motivation for releasing it <em>now<\/em> is to help developers of externally hosted plugins\/themes prepare for the release of 5.5.0, this plugin should work just fine with previous versions (although I have only tested it with 5.5.0).<\/p><\/dd>\n<dt><h3>Does this plugin work in multisite?<\/h3><\/dt>\n<dd><p>Yes it does!<\/p>\n\n<p>In non-multisite, the Updates API Inspector menu item appers in <code>Tools<\/code>.<\/p>\n\n<p>In multisite, this plugin can only be network activated (since that's where updates happen) and the menu item appears at the top-level of <code>Network Admin<\/code>.<\/p><\/dd>\n<dt><h3>Can I contribute to this plugin?<\/h3><\/dt>\n<dd><p>Yes you can!  Development happens on <a href=\"https:\/\/github.com\/pbiron\/updates-api-inspector\">GitHub<\/a>.  If you find a bug or have other suggestions, please open an issue there.  Pull requests accepted.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.1.1<\/h4>\n\n<ul>\n<li>Scrap the use of AJAX: run the update check before the tool page is rendered and output just what we need to.<\/li>\n<li>Also adds a minimal help screen and other various code\/string cleanup.<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>init commit.<\/li>\n<\/ul>","raw_excerpt":"Inspect various aspects of the WordPress Updates API","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/126346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=126346"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/pbiron"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=126346"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=126346"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=126346"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=126346"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=126346"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=126346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}