Title: Recommended usage of the Updates API to support the auto-updates UI for Plugins and Themes in WordPress 5.5
Author: Paul Biron
Published: July 30, 2020
Last modified: August 5, 2020

---

 [  ](https://profiles.wordpress.org/pbiron/) [Paul Biron](https://profiles.wordpress.org/pbiron/)
11:11 pm _on_ July 30, 2020     
Tags: [5.5 ( 87 )](https://make.wordpress.org/core/tag/5-5/),
[auto-update ( 24 )](https://make.wordpress.org/core/tag/auto-update/), [auto-updates ( 13 )](https://make.wordpress.org/core/tag/auto-updates/),
[dev-notes ( 650 )](https://make.wordpress.org/core/tag/dev-notes/), [feature-autoupdates ( 26 )](https://make.wordpress.org/core/tag/feature-autoupdates/)

# Recommended usage of the Updates API to support the auto-updates UI for Plugins and Themes in WordPress 5.5

_This is an addendum to [Controlling Plugin and Theme auto-updates UI in WordPress 5.5](https://make.wordpress.org/core/2020/07/15/controlling-plugin-and-theme-auto-updates-ui-in-wordpress-5-5/)._

_Edit 8/05/2020: An error in the example of populating _`no_updates`_ for plugins
has been corrected: in _`site_transient_update_plugins`_ the value of _`response`_
and _`no_update`_ are arrays of objects; whereas in _site_transient_update_themes_,
they are arrays of arrays. props [@afragen](https://profiles.wordpress.org/afragen/).
[@pbiron](https://profiles.wordpress.org/pbiron/)_

By default, the enable and disable auto-updates action links for plugins (detailed
in the [previous developer note](https://make.wordpress.org/core/2020/07/15/controlling-plugin-and-theme-auto-updates-ui-in-wordpress-5-5/))
will only appear when the WordPress CoreCore Core is the set of software required
to run WordPress. The Core Development Team builds WordPress. Updates APIAPI An 
API or Application Programming Interface is a software intermediary that allows 
programs to interact with each other and share data in limited, clearly defined 
ways. (available since version 3.7.0) is supported.

**All plugins that are hosted in the [WordPress Plugin Directory](https://wordpress.org/plugins/)
and themes that are hosted in the [WordPress Theme Directory](https://wordpress.org/themes/)
already fully support the Updates API and require no changes.**

Plugins and themes that are hosted elsewhere (such as premium or “private” plugins)
can also support the Updates API with a little bit of code.

**Though there is currently no one “official” way for such plugins to support the
Updates API, this note offers recommendations for how developers can provide enough
support for the auto-updates UIUI User interface to work for their plugins.**

## Filtering the pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory 󠀁[https://wordpress.org/plugins/](https://wordpress.org/plugins/)󠁿 or can be cost-based plugin from a third-party. update transient

The responses received from querying the WordPress.orgWordPress.org The community
site where WordPress code is created and shared by the users. This is where you 
can download the source code for WordPress core, plugins and themes as well as the
central location for community conversations and organization. [https://wordpress.org/](https://wordpress.org/)
Updates API are stored in the `update_plugins` site transient. There are several
existing filters that developers can use to add information about the availability
or lack of available updates for a specific plugin that is not hosted in the WordPress
Plugin Directory to that transient. The most common are:

 * [pre_set_site_transient_update_plugins](https://developer.wordpress.org/reference/hooks/pre_set_site_transient_transient/)(
   filters the value of a specific site transient before it is set)
 * [site_transient_update_plugins](https://developer.wordpress.org/reference/hooks/site_transient_transient/)(
   filters the value of an existing site transient)

Using `pre_set_site_transient_update_plugins`, for example, developers can do:

    ```notranslate
    <?php
    function myplugin_pre_set_site_transient_update_plugins( $transient ) {
    	// Query premium/private repo for updates.
    	$update = myplugin_check_for_updates( 'my-plugin' );
    	if ( $update ) {
    		// Update is available.
    		// $update should be an array containing all of the fields in $item below.
    		$transient->response['my-plugin/my-plugin.php'] = $update;
    	} else {
    		// No update is available.
    		$item = (object) array(
    			'id'            => 'my-plugin/my-plugin.php',
    			'slug'          => 'my-plugin',
    			'plugin'        => 'my-plugin/my-plugin.php',
    			'new_version'   => $myplugin_current_version,
    			'url'           => '',
    			'package'       => '',
    			'icons'         => array(),
    			'banners'       => array(),
    			'banners_rtl'   => array(),
    			'tested'        => '',
    			'requires_php'  => '',
    			'compatibility' => new stdClass(),
    		);
    		// Adding the "mock" item to the `no_update` property is required
    		// for the enable/disable auto-updates links to correctly appear in UI.
    		$transient->no_update['my-plugin/my-plugin.php'] = $item;
    	}

    	return $transient;
    }

    add_filter( 'pre_set_site_transient_update_plugins', 'myplugin_pre_set_site_transient_update_plugins' );
    ```

Developers that have already been using the Updates API to offer updates for their
plugins that are not hosted in the WordPress Plugins Directory have already been
populating the `response` property for their plugin.

**The `no_update` property is a requirement for the auto-update UI to work correctly
for externally hosted plugins.**

Some are already populating the `no_update` for their plugin. Any that are not should
update their code accordingly for the best user experience.

## Filtering the theme update transient

For themes, the responses received from querying the WordPress.org Updates API are
stored in the `update_themes` site transient. The filters used to modify the values
of these transients are similar to the ones used for plugins but slightly different:

 * [pre_set_site_transient_update_themes](https://developer.wordpress.org/reference/hooks/pre_set_site_transient_transient/)(
   filters the value of a specific site transient before it is set)
 * [site_transient_update_themes](https://developer.wordpress.org/reference/hooks/site_transient_transient/)(
   filters the value of an existing site transient)

Using `pre_set_site_transient_update_themes`, for example, developers of a theme
hosted in a different location can do:

    ```notranslate
    <?php
    function mytheme_pre_set_site_transient_update_themes( $transient ) {
    	// Query premium/private repo for updates.
    	$update = mytheme_check_for_updates( 'my-theme' );
    	if ( $update ) {
    		// Update is available.
    		// $update should be an array containing all of the fields in $item below.
    		$transient->response['my-theme'] = $update;
    	} else {
    		// No update is available.
    		$item = array(
    			'theme'        => 'my-theme',
    			'new_version'  => $mytheme_current_version,
    			'url'          => '',
    			'package'      => '',
    			'requires'     => '',
    			'requires_php' => '',
    		);
    		// Adding the "mock" item to the `no_update` property is required
    		// for the enable/disable auto-updates links to correctly appear in UI.
    		$transient->no_update['my-theme'] = $item;
    	}

    	return $transient;
    }

    add_filter( 'pre_set_site_transient_update_themes', 'mytheme_pre_set_site_transient_update_themes' );
    ```

**The `no_update` property was only recently added to API responses for theme update
queries, and like plugins, the `no_update` property is a requirement for the auto-
update UI to work correctly for externally hosted themes.**

_Props [@desrosj](https://profiles.wordpress.org/desrosj/) and [@audrasjb](https://profiles.wordpress.org/audrasjb/)
for review prior to publishing._

[#5-5](https://make.wordpress.org/core/tag/5-5/), [#auto-update](https://make.wordpress.org/core/tag/auto-update/),
[#auto-updates](https://make.wordpress.org/core/tag/auto-updates/), [#dev-notes](https://make.wordpress.org/core/tag/dev-notes/),
[#feature-autoupdates](https://make.wordpress.org/core/tag/feature-autoupdates/)

### Share this:

 * [  Threads ](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/?share=threads)
 * [  Mastodon ](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/?share=mastodon)
 * [  Bluesky ](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/?share=bluesky)
 * [  X ](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/?share=x)
 * [  Facebook ](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/?share=facebook)
 * [  LinkedIn ](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/?share=linkedin)

 1.  ![](https://secure.gravatar.com/avatar/82779a185fccde41e1dd3b914bde84cd6be76c8dcb8f6b983f461c8f5687a87e?
     s=32&d=mm&r=g)
 2.   [Andy Fragen](https://profiles.wordpress.org/afragen/)  4:19 am _on_ July 31,
     2020
 3.  Excellent write up Paul.
 4.  A little more on these filterFilter Filters are one of the two types of Hooks 
     [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
     They provide a way for functions to modify data of other functions. They are the
     counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
     manner, and should never have side effects such as affecting global variables 
     and output. hooksHooks In WordPress theme and development, hooks are functions
     that can be applied to an action or a Filter in WordPress. Actions are functions
     performed when a certain event occurs in WordPress. Filters allow you to modify
     certain functions. Arguments used to hook both filters and actions look the same.
     for reference.
 5.  The `pre_set_site_transient_{$transient}` filter saves it’s returned data into
     the transient in the `set_site_transient()` function. The `site_transient_{$transient}`
     filter returns the data into the `get_site_transient()` function without saving
     it anywhere.
 6.  As I’ve shared with you, my preference is to use the `site_transient_{$transient}`
     filter hooks. The reason is that, as an updater developer, I prefer not to add
     extra code around the database that is more easily injected when it’s needed instead
     of having it saved in the transient. Simply my preference.
 7.  ![](https://secure.gravatar.com/avatar/af6cb02f92815fa3d3c86aa63a507360b5130a075f13666748575e63b34edfe1?
     s=32&d=mm&r=g)
 8.   [Marcus](https://profiles.wordpress.org/netweblogic/)  2:52 pm _on_ July 31, 
     2020
 9.  I’ve found in the past that
 10.     ```notranslate
         $transient->checked['plugin-slug']
         ```
     
 11. Also needs to be updated with the currently installed pluginPlugin A plugin is
     a piece of software containing a group of functions that can be added to a WordPress
     website. They can extend functionality or add new features to your WordPress websites.
     WordPress plugins are written in the PHP programming language and integrate seamlessly
     with WordPress. These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party. version, otherwise, plugins get
     repeatedly marked as requiring an update to itself (i.e. update to same version).
 12. That said, I haven’t been making use of no_upadate. Does that sort itself out 
     now if you add to either the response or no_update arrays?
 13. ![](https://secure.gravatar.com/avatar/18f4f7ebdcd48383951a52a88f401bd6460ae74b626016010b1f0604cac90826?
     s=32&d=mm&r=g)
 14.  [Jonathan Desrosiers](https://profiles.wordpress.org/desrosj/)  3:26 pm _on_ 
     July 31, 2020
 15. +make.wordpress.org/plugins/
 16. ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
     s=32&d=mm&r=g)
 17.  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  5:38 pm _on_ July 31,
     2020
 18. The `id` and `url` items for plugins are new?
      What is their purpose?
 19.  * ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
        s=32&d=mm&r=g)
      *  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  5:40 pm _on_ July
        31, 2020
      * Also, shouldn’t the `requires` item be included as well?
      * So WP knows if the pluginPlugin A plugin is a piece of software containing 
        a group of functions that can be added to a WordPress website. They can extend
        functionality or add new features to your WordPress websites. WordPress plugins
        are written in the PHP programming language and integrate seamlessly with WordPress.
        These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party. is compatible with WP itself…
        Would be something if the thing auto-updates to a version that requires a newer
        WP installed 🙄
         - ![](https://secure.gravatar.com/avatar/82779a185fccde41e1dd3b914bde84cd6be76c8dcb8f6b983f461c8f5687a87e?
           s=32&d=mm&r=g)
         -  [Andy Fragen](https://profiles.wordpress.org/afragen/)  6:51 pm _on_ July
           31, 2020
         - The code that tests for WP/PHPPHP The web scripting language in which WordPress
           is primarily architected. WordPress requires PHP 7.4 or higher compatibility
           is not reliant on the update package sent. It is reliant on the pluginPlugin
           A plugin is a piece of software containing a group of functions that can
           be added to a WordPress website. They can extend functionality or add new
           features to your WordPress websites. WordPress plugins are written in the
           PHP programming language and integrate seamlessly with WordPress. These 
           can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
           or can be cost-based plugin from a third-party. file headers and the readme.
           txt file.
            * ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
              s=32&d=mm&r=g)
            *  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  8:02 pm _on_
              July 31, 2020
            * Aha!
               That works, but doesn’t seem intuitive…
            * Anyway, what of the other 2 items, do you know anything about that?
               - ![](https://secure.gravatar.com/avatar/82779a185fccde41e1dd3b914bde84cd6be76c8dcb8f6b983f461c8f5687a87e?
                 s=32&d=mm&r=g)
               -  [Andy Fragen](https://profiles.wordpress.org/afragen/)  8:41 pm _on_
                 July 31, 2020
               - `id` only exists with plugins/themes on w.org
               - `url` is the URLURL A specific web address of a website or web page
                 on the Internet, such as a website’s URL www.wordpress.org to the 
                 pluginPlugin A plugin is a piece of software containing a group of
                 functions that can be added to a WordPress website. They can extend
                 functionality or add new features to your WordPress websites. WordPress
                 plugins are written in the PHP programming language and integrate 
                 seamlessly with WordPress. These can be free in the WordPress.org 
                 Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
                 or can be cost-based plugin from a third-party./theme.
                  * ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
                    s=32&d=mm&r=g)
                  *  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  8:49
                    pm _on_ July 31, 2020
                  * But `id` is identical to `slug`.
                     And `url` is `homepage`.
                  * So whats the point of those? Are slug and homepage being replaced?
                    Or why have double info?
                     As a 3rd party update hoster, are they
                    required?
 20. ![](https://secure.gravatar.com/avatar/82779a185fccde41e1dd3b914bde84cd6be76c8dcb8f6b983f461c8f5687a87e?
     s=32&d=mm&r=g)
 21.  [Andy Fragen](https://profiles.wordpress.org/afragen/)  9:06 pm _on_ July 31,
     2020
 22. Technically `id` is not identical to `slug` and yes to `url`.
 23. I write a 3rd party updater for GitHubGitHub GitHub is a website that offers online
     implementation of git repositories that can easily be shared, copied and modified
     by other developers. Public repositories are free to host, private repositories
     require a paid subscription. GitHub introduced the concept of the ‘pull request’
     where code changes done in branches by contributors can be reviewed and discussed
     before being merged by the repository owner. [https://github.com/](https://github.com/),
     etc. `id` is not necessary.
 24. I think there will be an update to this post listing the minimum needed array 
     elements.
 25.  * ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
        s=32&d=mm&r=g)
      *  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  9:13 pm _on_ July
        31, 2020
      * No, not slug… But `plugin`, my mistake.
         Slug is of-course only part of id/
        pluginPlugin A plugin is a piece of software containing a group of functions
        that can be added to a WordPress website. They can extend functionality or 
        add new features to your WordPress websites. WordPress plugins are written 
        in the PHP programming language and integrate seamlessly with WordPress. These
        can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party..
      * And yes, I hope someone finally releases better documentation for 3rd party
        updates… It’s a pain to work with these filters right now. Like you said, a
        minimum required fields overview would be nice.
      * ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
        s=32&d=mm&r=g)
      *  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  9:13 pm _on_ July
        31, 2020
      * And thanks for your input and clarifications 🥳
 26. ![](https://secure.gravatar.com/avatar/82779a185fccde41e1dd3b914bde84cd6be76c8dcb8f6b983f461c8f5687a87e?
     s=32&d=mm&r=g)
 27.  [Andy Fragen](https://profiles.wordpress.org/afragen/)  9:18 pm _on_ July 31,
     2020
 28.     ```notranslate
         plugin
         ```
     
 29.  is what is commonly referred to as the `$plugin_path`. It is the pluginPlugin
     A plugin is a piece of software containing a group of functions that can be added
     to a WordPress website. They can extend functionality or add new features to your
     WordPress websites. WordPress plugins are written in the PHP programming language
     and integrate seamlessly with WordPress. These can be free in the WordPress.org
     Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party. directory, which is normally the
     slug, and the main plugin file. Something like `my-plugin/my-plugin.php`.
 30. For themes, the `theme` is simply the `slug`
 31. ![](https://secure.gravatar.com/avatar/7a36060ae08c0b5588810cd5e6ea430fe9b10ce7ca8debbe928a1e254e78b4d4?
     s=32&d=mm&r=g)
 32.  [Paul Biron](https://profiles.wordpress.org/pbiron/)  12:06 am _on_ August 1,
     2020
 33. Hi everyone!
 34. I’ll try to answer several of the questions asked in this one comment, rather 
     than replying to specific comments…as I think that will be move “visible” to future
     readers.
 35. First, I want to reiterate that there is no “official” way for plugins/themes 
     not hosted in the .org repo to “support the Updates APIAPI An API or Application
     Programming Interface is a software intermediary that allows programs to interact
     with each other and share data in limited, clearly defined ways.” and this dev-
     note **should not** be taken as the final word on how to **fully** “support the
     Updates API” for externally hosted plugins/themes. Rather, as the title suggests,
     it provides **recommendations**…for providing _enough_ support that the new auto-
     updates UIUI User interface in 5.5 will work as users expect.
 36. Before turning to answering specific questions that have been asked so far, I 
     want to stress the **main takeaway** from this note:
 37.  For users to be notified that your externally hosted pluginPlugin A plugin is
     a piece of software containing a group of functions that can be added to a WordPress
     website. They can extend functionality or add new features to your WordPress websites.
     WordPress plugins are written in the PHP programming language and integrate seamlessly
     with WordPress. These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party./theme has an update available 
     and even to have auto-updates work properly, all that is necessary is for `response`
     to be populated. This is true pre-5.5 and will continue to be true in 5.5!
 38.  What is different in 5.5 is that if you do not populate `no_update` when no update
     is available then **users will only see the `Enable/Disable auto-updates` links
     when there is an update available**, which is not the best UXUX User experience
     for your users!
 39. Regarding the filters used to inject info into the transients, the two mentioned
     in the note are not the only ones that may be used and the fact that those two
     are mentioned should in **no way** be interpreted as that they are the _preferred_
     filters. Which filterFilter Filters are one of the two types of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
     They provide a way for functions to modify data of other functions. They are the
     counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
     manner, and should never have side effects such as affecting global variables 
     and output. is used will vary for a number of reasons, including but certainly
     not limited to, business rules and/or technical architures of the various vendors
     who use them. Also, the considerations around whether info is injected when the
     transients are _set_ or when they are _got_ is beyond the scope of this dev-note:
     the fact that a _set_ filter was used for both examples was little more than a“
     coin toss”.
 40. [@Marcus](https://profiles.wordpress.org/marcus/): populating `checked` is **not**
     necessary for the new auto-updates UI to function properly; but as you say, can
     be useful for other reasons…but again, whether that is populated is beyond the
     scope of this dev-note.
 41. [@Arnan](https://profiles.wordpress.org/arnan/) de Gans: some of the fields in
     the array used to populate `response` and `no_update` only have meaning for things
     hosted in the .org repo (such as `id`) and others are used elsewhere in coreCore
     Core is the set of software required to run WordPress. The Core Development Team
     builds WordPress. (e.g. `url` is used by the plugins list table to generate the“
     View details” link) and are not, strictly speaking, necessary for the new auto-
     updates UI to work properly. They are included in the examples because `response`
     is passed as a param to the `auto_update_plugin` filter, and many callbacks that
     are hooked to that check for those fields. Thus, setting them to some reasonable
     value will prevent your plugin from negatively impacting other plugins (and possibly
     causing PHPPHP The web scripting language in which WordPress is primarily architected.
     WordPress requires PHP 7.4 or higher errors).
 42. I hope this helps. If not, by all means, ask any other questions that anyone has!
 43.  * ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
        s=32&d=mm&r=g)
      *  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  12:11 am _on_ August
        2, 2020
      * [@pbiron](https://profiles.wordpress.org/pbiron/) But about `url`… We already
        have `homepage`, no? So why is there `url` now? Or what am I missing?
         You 
        say it’s for the ‘view details’ link, but afaik that link works and I don’t
        use `url` in my code 🤷‍♂️
      * Can you (or someone) provide a doc/post/guide with the required AND available
        items for update/pluginPlugin A plugin is a piece of software containing a 
        group of functions that can be added to a WordPress website. They can extend
        functionality or add new features to your WordPress websites. WordPress plugins
        are written in the PHP programming language and integrate seamlessly with WordPress.
        These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party. data going forward?
         Perhaps
        even split out whats required for the wp.org repo and which are optional for
        3rd party stuff. Would take away a ton of questions and uncertainty for sure.
      * Reverse engineering the code or based on what goes in the transient may work
        for many (kinda works for me) but questions remain. If you’re flexible about
        allowing (maybe even supporting) 3rd party update services, shouldn’t there
        be comprehensive documentation for it? If there are such pages already, your
        internal search and google don’t know about it…
         - ![](https://secure.gravatar.com/avatar/7a36060ae08c0b5588810cd5e6ea430fe9b10ce7ca8debbe928a1e254e78b4d4?
           s=32&d=mm&r=g)
         -  [Paul Biron](https://profiles.wordpress.org/pbiron/)  1:27 am _on_ August
           2, 2020
         - I really wish I could be more helpful about the meaning of some of those
           fields, but I just can’t. It’s not that I don’t want to be, it’s simply 
           that, again, there is **no “official” way for externally hosted plugins/
           themes to support the Updates APIAPI An API or Application Programming Interface
           is a software intermediary that allows programs to interact with each other
           and share data in limited, clearly defined ways.**, and for some of the 
           fields, they really only have meaning for plugins/themes hosted in the .
           org repos.
         - I can’t refer you to _comprehensive documentation_ because it simply doesn’t
           exist…and I don’t mean to be flippant, but that’s part of what “there is
           no official way…” means.
         - Externally hosted plugins and themes have been using the Updates API for
           quite some time, mostly by trial and error in reading through the coreCore
           Core is the set of software required to run WordPress. The Core Development
           Team builds WordPress. code. Some do it better than others.
         - Maybe an _unintended_, but **very welcome**
            consequence of [#50280](https://core.trac.wordpress.org/ticket/50280)
           is that the project will need to formalize **and document** exactly what
           it means to “support the Updates API”.
         - I did misspeak in my first comment, though: `url` is not used for the “View
           details” link.
         - For .org plugins/themes, its value is their page in the repo, e.g., for 
           Hello Dolly it is [https://wordpress.org/plugins/hello-dolly/](https://wordpress.org/plugins/hello-dolly/).
           So, if you have a website/page somewhere devoted to your externally hosted
           pluginPlugin A plugin is a piece of software containing a group of functions
           that can be added to a WordPress website. They can extend functionality 
           or add new features to your WordPress websites. WordPress plugins are written
           in the PHP programming language and integrate seamlessly with WordPress.
           These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
           or can be cost-based plugin from a third-party./theme, I’d suggest putting
           it’s URLURL A specific web address of a website or web page on the Internet,
           such as a website’s URL www.wordpress.org in there, if you don’t, just set
           it to the empty string.
         - Again, I wish I could give you a more concrete answer…but there just isn’t
           one to give.
         - Know that I plan to raise the issue of what it means to “support the Updates
           API” in future meetings of the [#core-auto-updates](https://wordpress.slack.com/archives/CULBN711P)
           team. We meet every Tues at 17:00 UTC. You are more than welcome to join
           those meetings, they are open to anyone.
            * ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
              s=32&d=mm&r=g)
            *  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  1:38 am _on_
              August 2, 2020
            * I get that, and thanks for your answers.
               However, since WP has these
              filters and people clearly use it enough for some to feel the need to
              post the article above it stands to reason that they be explained. Well,
              you know the issue and request/wish 🥳
            * I don’t think we need an actual APIAPI An API or Application Programming
              Interface is a software intermediary that allows programs to interact
              with each other and share data in limited, clearly defined ways. at this
              point, especially since us 3rd party nerds are very much a minority –
              But some claritification would go a long way. Most other filters are 
              explained… These 2 we can use don’t even get their own page saying the
              page doesn’t exist (last i saw anyway).
            * Based on your 2nd answer, I gather that `url`, like `id`, is a wp.org
              relevant item, and can be skipped for 3rd party offerings. Correct?
               
              If so, including it empty, or fill it with the product page from the 
              devs site would do just fine.
               - ![](https://secure.gravatar.com/avatar/7a36060ae08c0b5588810cd5e6ea430fe9b10ce7ca8debbe928a1e254e78b4d4?
                 s=32&d=mm&r=g)
               -  [Paul Biron](https://profiles.wordpress.org/pbiron/)  1:57 am _on_
                 August 2, 2020
               - Re: `url`:
               - >  So, if you have a website/page somewhere devoted to your externally
                 > hosted pluginPlugin A plugin is a piece of software containing a
                 > group of functions that can be added to a WordPress website. They
                 > can extend functionality or add new features to your WordPress websites.
                 > WordPress plugins are written in the PHP programming language and
                 > integrate seamlessly with WordPress. These can be free in the WordPress.
                 > org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
                 > or can be cost-based plugin from a third-party./theme, I’d suggest
                 > putting it’s URLURL A specific web address of a website or web page
                 > on the Internet, such as a website’s URL www.wordpress.org in there,
                 > if you don’t, just set it to the empty string.
                  * ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
                    s=32&d=mm&r=g)
                  *  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  2:02
                    am _on_ August 2, 2020
                  * Oh, right! #duh
 44. ![](https://secure.gravatar.com/avatar/0c9b5f521460d75e5ffa2e4409e56a18e44ff69220df1e3e079b95408b52b3f4?
     s=32&d=mm&r=g)
 45.  [Deni](https://profiles.wordpress.org/dennis_f/)  1:35 am _on_ August 3, 2020
 46. When using `pre_set_site_transient_update_plugins` do we have to check if `$transient-
     >no_update` is set before adding a new item to it? Is there any case in which 
     the `$transient->no_update` array will not be set in the transient?
 47.  * ![](https://secure.gravatar.com/avatar/7a36060ae08c0b5588810cd5e6ea430fe9b10ce7ca8debbe928a1e254e78b4d4?
        s=32&d=mm&r=g)
      *  [Paul Biron](https://profiles.wordpress.org/pbiron/)  3:38 am _on_ August 
        3, 2020
      * Great question [@dennis_f](https://profiles.wordpress.org/dennis_f/) !!
      * This is just off the top of my head, but I can only think of 2 reasons why `
        no_update` would not already be present: 1) there are no .org repo plugins/
        themes on the site; 2) your callback fires **after** that of some other pluginPlugin
        A plugin is a piece of software containing a group of functions that can be
        added to a WordPress website. They can extend functionality or add new features
        to your WordPress websites. WordPress plugins are written in the PHP programming
        language and integrate seamlessly with WordPress. These can be free in the 
        WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party. and that other plugin (more
        than likely) incorrectly did the equivalent of `unset( $transient->no_update)`.
      * That said, the answer is **No**, you do not need to create it if it doesn’t
        already exist. PHPPHP The web scripting language in which WordPress is primarily
        architected. WordPress requires PHP 7.4 or higher will do that for you.
         - ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
           s=32&d=mm&r=g)
         -  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  4:04 am _on_ 
           August 3, 2020
         - I just add it, if it’s already there its overwritten.
            Makes no difference
           and then it’s always uptodate.
         - ![](https://secure.gravatar.com/avatar/0c9b5f521460d75e5ffa2e4409e56a18e44ff69220df1e3e079b95408b52b3f4?
           s=32&d=mm&r=g)
         -  [Deni](https://profiles.wordpress.org/dennis_f/)  4:15 am _on_ August 3,
           2020
         - Thank you!
 48. ![](https://secure.gravatar.com/avatar/7a36060ae08c0b5588810cd5e6ea430fe9b10ce7ca8debbe928a1e254e78b4d4?
     s=32&d=mm&r=g)
 49.  [Paul Biron](https://profiles.wordpress.org/pbiron/)  1:38 am _on_ August 6, 
     2020
 50. HI all,
 51. I just released a pluginPlugin A plugin is a piece of software containing a group
     of functions that can be added to a WordPress website. They can extend functionality
     or add new features to your WordPress websites. WordPress plugins are written 
     in the PHP programming language and integrate seamlessly with WordPress. These
     can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party. called [Updates API Inspector](https://wordpress.org/plugins/updates-api-inspector/)
     that developers reading this post might find helpful.
 52. It’s mostly an **educational** tool to help developers become more familiar with
     the Updates APIAPI An API or Application Programming Interface is a software intermediary
     that allows programs to interact with each other and share data in limited, clearly
     defined ways. and the site transients that are populated, etc.
 53. It will **not** answer questions like “what should I put in `$transient->no_update['
     my-plugin/my-plugin.php']->url`?”. But it will allow you to see what other plugins
     are populating that with, as well as what other fields other plugins are populating.
 54. If you have questions about the plugin, please do **NOT** ask them in comments
     on this post! Ask then in the support forumSupport Forum WordPress Support Forums
     is a place to go for help and conversations around using WordPress. Also the place
     to go to report issues that are caused by errors with the WordPress code and implementations.(
     at the above URLURL A specific web address of a website or web page on the Internet,
     such as a website’s URL www.wordpress.org) or open an issue on the GitHubGitHub
     GitHub is a website that offers online implementation of git repositories that
     can easily be shared, copied and modified by other developers. Public repositories
     are free to host, private repositories require a paid subscription. GitHub introduced
     the concept of the ‘pull request’ where code changes done in branches by contributors
     can be reviewed and discussed before being merged by the repository owner. [https://github.com/](https://github.com/)
     repo (URL in the FAQ of the readme).
 55.  * ![](https://secure.gravatar.com/avatar/024316af8fa284f9ca54dbb695a52e27ebf9f848a5bbf8b590446c642641b258?
        s=32&d=mm&r=g)
      *  [Arnan de Gans](https://profiles.wordpress.org/adegans/)  2:58 am _on_ August
        6, 2020
      * Oooh interesting!
 56. ![](https://secure.gravatar.com/avatar/302e4aa5f4f537d66a3fae116fd93d32de1a1a4178680ee08ac021289127a3dd?
     s=32&d=mm&r=g)
 57.  [wpexplorer](https://profiles.wordpress.org/wpexplorer/)  12:14 am _on_ November
     6, 2020
 58. Wouldn’t it be a good idea in the “Filtering the theme update transient” example
     to ensure an update is actually needed. Example:
 59.     ```notranslate
         if ( $update && isset( $transient->checked['my-theme'] ) && version_compare( $transient->checked['my-theme'], $update->version, '<' ) {
         	// Update is available.
         }
         ```
     
 60.  * ![](https://secure.gravatar.com/avatar/7a36060ae08c0b5588810cd5e6ea430fe9b10ce7ca8debbe928a1e254e78b4d4?
        s=32&d=mm&r=g)
      *  [Paul Biron](https://profiles.wordpress.org/pbiron/)  12:29 am _on_ November
        6, 2020
      * As with most example code, a lot of the nitty-gritty details have been elided
        from the examples in this dev-note.
      * Essentially, the kind of extra checks you mention would be in the `mytheme_check_for_updates('
        my-theme' )` (and `myplugin_check_for_updates( 'my-plugin' )`) function calls.

Comments are closed.

# Post navigation

[← Themes field guide: WordPress 5.5](https://make.wordpress.org/core/2020/07/30/themes-field-guide-wordpress-5-5/)

[WordPress 5.5 Field Guide →](https://make.wordpress.org/core/2020/07/30/wordpress-5-5-field-guide/)