plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.

MIT License

Downloads
895.6K
Stars
2.2K
Committers
39

Bot releases are hidden (Show)

plugin-update-checker - 5.4 Latest Release

Published by YahnisElsts 8 months ago

  • Added automatic update checks before certain WP-CLI commands that read plugin/theme update status, such as wp plugin status, wp theme update, and so on. This just triggers the existing scheduling logic, so if you run multiple commands in very quick succession, PUC won't check for updates every time. See #558.
  • Fixed an autoloading failure where the Ui class (YahnisElsts\PluginUpdateChecker\v5p3\Plugin\Ui) sometimes did not load correctly if multiple active plugins/themes were using different versions of PUC.
  • Fixed a conflict with "WP Last Modified Info" 1.8.8 that could cause a fatal error when updating a plugin. This should also improve compatibility with any other plugins that try to access update-related data inside an upgrader_process_complete callback.
  • Removed dev files like phpcs.xml from exported archives. Props to @szepeviktor.
plugin-update-checker - 5.3

Published by YahnisElsts 12 months ago

  • Fixed a fatal error that could happen in the unusual situation where the Debug_Bar class exists but Debug_Bar_Panel does not. See #543.
  • Fixed PUC intermittently detecting an invalid "update" when using a GitHub branch and hitting the GitHub API rate limit. See #526.
plugin-update-checker - 5.2

Published by YahnisElsts about 1 year ago

  • Fixed a few PHP 8.2 deprecation notices like Creation of dynamic property YahnisElsts\PluginUpdateChecker\vXpY\Plugin\PluginInfo::$example is deprecated.
plugin-update-checker - 5.1

Published by YahnisElsts over 1 year ago

  • Added a way to filter GitHub and GitLab releases.
    • Example of filtering releases by the version number:
      //Allow only beta versions (e.g. for testing).
      $updateChecker->getVcsApi()->setReleaseVersionFilter(
          '/beta/i', //Regex for the version number.
          Api::RELEASE_FILTER_ALL, //Disables the default filter(s).
          30 //Max number of recent releases to scan for matches.
      );
      
    • Alternatively, you can use a callback to implement custom filtering rules.
      //Set an arbitrary custom filter.
      $updateChecker->getVcsApi()->setReleaseFilter(
          function($versionNumber, $releaseObject) {
              /* 
              Put your custom logic here. The $releaseObject variable contains
              the release data returned by the GitHub/GitLab API. The format
              will vary depending on which service you're using.
              */
              return true;
          },
          Api::RELEASE_FILTER_ALL
      );
      
    • Aside from Api::RELEASE_FILTER_ALL, you can also use Api::RELEASE_FILTER_SKIP_PRERELEASE to filter out pre-releases.
    • Setting a new filter will override any previous filters, so you can't add a regex-based version filter and a custom callback at the same time.
  • Fixed a release asset filtering bug where an asset that matches the filter could be ignored if it was not the first in the list. Props to @liedekef.
  • Changed the readme parser to use wp_strip_all_tags() instead of strip_tags() when available. Supposedly, it's better at stripping the contents of <script> and <style> tags.
  • The main branch is now treated as a default branch (in addition to master).
plugin-update-checker - 5.0

Published by YahnisElsts almost 2 years ago

Breaking Changes

  • Minimum required PHP version increased from 5.2 to 5.6.20.
  • All classes have been moved into namespaces. Code written for older versions will need to be updated to work with this version. In most cases, you will only need import the factory class and change the factory class name. Example:
    use YahnisElsts\PluginUpdateChecker\v5\PucFactory;
    $myUpdateChecker = PucFactory::buildUpdateChecker(
    	'https://example.com/info.json',
    	__FILE__,
    	'my-slug'
    );
    
    If you want to use version 5.0 specifically instead of "latest loaded 5.x version", replace v5 in the namespace with v5p0.

Other Changes

  • Added a way to filter VCS update detection strategies. For example, you could use it to stop PUC from looking for GitHub releases if you don't use those, or you could prevent it from loading the readme.txt from a remote BitBucket remote repository to see if it has a Stable tag header that points to a valid tag. This makes it possible to avoid some unnecessary HTTP requests and may improve performance for your users. Example:
    use YahnisElsts\PluginUpdateChecker\v5p0\Vcs\BitBucketApi;
    $bitbucketPluginChecker->addFilter('vcs_update_detection_strategies', function($strategies) {
     	//Don't look for a "Stable tag" header in readme.txt.
     	unset($strategies[BitBucketApi::STRATEGY_STABLE_TAG]);
     	return $strategies;
    });
    
    Different APIs support different strategies. Currently implemented strategies include:
    • STRATEGY_LATEST_RELEASE
    • STRATEGY_LATEST_TAG
    • STRATEGY_STABLE_TAG
    • STRATEGY_BRANCH
  • Fixed a PHP deprecation notice: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated. It could be triggered if the update metadata URL did not include a path.
  • Fixed many (but not all) warnings that were reported when running PHP_CodeSniffer with the basic WordPress Coding Standards (WPCS) ruleset and the WordPress-VIP ruleset. This does not affect PUC directly, but it might save you some time if you need your plugin or theme that uses PUC to meet those standards.
plugin-update-checker - 4.13

Published by YahnisElsts about 2 years ago

  • Fixed a PHP warning when trying to load update details that were saved by a different version of PUC that had a custom namespace. This was a pre-existing PHP Scoper compatibility issue that was exposed by the recent 4.12 release.
plugin-update-checker - 4.12

Published by YahnisElsts about 2 years ago

  • Added the ability to automatically load plugin banners from a local assets subdirectory. Props to @timwiel for the initial implementation.
  • Fixed a PHP Scoper compatibility issue where autoloading didn't work if the custom namespace contained underscores (_).
  • BitBucket: Fixed a bug where branch names that contain slashes would not work.
  • BitBucket: The main branch will now be treated as a default branch (in addition to master).
  • GitLab: Added support for GitLab releases. Props to @timwiel.
  • Added and updated translations:
    • Turkish (Igor Funa)
    • Russian and Ukrainian (@wpdew)
    • Simplified Chinese (@seatonjiang)
    • Italian (@d79)
plugin-update-checker - 4.11

Published by YahnisElsts over 3 years ago

  • Fixed a call to a non-existent lastRequestApiErrors property that could prevent certain update errors from being reported.
  • Fixed a few warnings about deprecated jQuery features.
  • Improved compatibility with PHP Scoper and other tools that add custom namespaces to third-party libraries.
plugin-update-checker - 4.10

Published by YahnisElsts about 4 years ago

  • Added support for the new auto-update feature introduced in WordPress 5.5.
  • Added support for the "Requires PHP" header field.
  • Added a new factory method buildFromHeader($filePath, $args) that lets you specify the repository URL in the plugin header and set other update checker arguments using an associative array. Example:
    /*
    Plugin Name: Example Plugin
    Description: Lorem ipsum 
    Version: 1.0
    GitHub URI: https://github.com/foo/bar/
    */
    //...
    $updateChecker = Puc_v4p10_Factory::buildFromHeader(
    	__FILE__,
    	array(
    		'slug'         => 'plugin-slug-here',
    		'checkPeriod'  => 12,
    		'optionName'   => 'abc-custom-option',
    	)
    );
    
  • Fixed several fatal errors that could happen when the update checker itself was upgraded to a different version during a plugin or theme update. These errors only showed up when installing an update and typically didn't prevent the update from being installed.
  • Fixed a bug where the hostname used in the metadata URL sometimes wasn't correctly whitelisted if there were at least two active plugins using the same version of PUC.
  • Improved the way the update checker determines the patch number to add to the "Tested up to" value. Now it's even more likely to find the real patch version number for the specified WordPress version and less likely to fall back to using .999.
  • Added Simplified Chinese translation. Props to @seatonjiang.
  • Updated Spanish translations. Props to @YordanSoares.
plugin-update-checker - 4.9

Published by YahnisElsts over 4 years ago

  • Switched from a deprecated GitHub API authentication mechanism that used the access_token query parameter to using the Authorization HTTP header. This should stop GitHub sending you email notices about authentication via URL query parameters. Props to @jccit for the initial implementation.
  • Fixed a fatal error "Call to a member function isMuPlugin() on null" that could affect some Multisite installations.
  • Added a random offset to the update check schedule to help prevent daily traffic spikes. This doesn't change how often PUC checks for updates, but it spreads the checks more evenly throughout the day. Props to @DavidAnderson684 for the initial suggestion and feedback.
  • Added a new filter: first_check_time (full name: puc_first_check_time-$slug). It's passed one argument that is the calculated Unix timestamp of the first update check. Return a new timestamp to make the first check happen at a different time.
    //Usage example:
    $updateChecker->addFilter('first_check_time', function($unusedTimestamp) {
        //Always check for updates 1 hour after the first activation.
        return time() + 3600;
    });
    
plugin-update-checker - 4.8.1

Published by YahnisElsts about 5 years ago

Fixed a fatal error that could happen when loading the Puc_v4_Factory class with the Composer-generated autoloader.

plugin-update-checker - 4.8

Published by YahnisElsts about 5 years ago

  • Fixed a fatal error that could happen when activating two plugins or themes that use Composer autoloaders and include different versions of this library. Projects that don't use a Composer-generated autoloader were not affected.
  • Fixed a compatibility warning being shown in the "View details" pop-up when the "tested up to" version was specified as major.minor (e.g. 5.2) and the site was running version major.minor.patch (e.g. 5.2.1). This complements an earlier patch where a similar warning was show on the "Updates" page.
  • Fixed a potential bug where downloading a release asset from GitHub could fail if multiple plugins enabled release asset support at the same time.
  • Added support for GitLab subgroups in self-hosted repositories. Props to @etlam.
  • Added Catalan and Spanish translations. Props to @jorditarrida.
  • Updated Japanese translation. Props to @GoodMorningCall.
plugin-update-checker - 4.7.1-beta2

Published by YahnisElsts about 5 years ago

Another test release.

plugin-update-checker - 4.7.1-beta

Published by YahnisElsts about 5 years ago

Testing a different Composer autoloading mechanism.

plugin-update-checker - 4.7

Published by YahnisElsts over 5 years ago

  • Finished upgrading to BitBucket API 2.0. This should fix the "this API is no longer supported" errors experienced by some users.
  • Added Solvenian translation. Props to Igor Funa.
  • Minor code style changes.
plugin-update-checker - 4.6

Published by YahnisElsts over 5 years ago

  • Added a puc_get_vcs_service filter that lets users add their self-hosted GitLab or BitBucket instance as a recognised service. Props to @Tofandel.
  • Fixed a potentially inefficient behaviour where the update checker would check for updates every time any plugin or theme update was installed. Now it will only do that when the update is for the plugin or theme associated with that PUC instance. Props to @DavidAnderson684.
  • GitLab support fix: When dealing with a self-hosted GitLab repository, the update checker will now use the protocol specified in the repository URL instead of always defaulting to HTTPS.
  • Fixed a bug where, if an older version of PUC 4.x was loaded first, the more recent version's factory (Puc_v4pX_Factory) wouldn't be able to instantiate any classes.
plugin-update-checker - 4.5.1

Published by YahnisElsts over 5 years ago

Fixed a PHP notice that was triggered in PHP 7.3 when the path to the mu-plugins directory could not be resolved for some reason: "Deprecated: strpos(): Non-string needles will be interpreted as strings in the future".

plugin-update-checker - 4.5

Published by YahnisElsts almost 6 years ago

  • Added support for GitLab subgroups.
  • Custom GitLab repository URLs can now include a port number. Props to @Spidlace.
  • Added a Canadian French translation. Props to @eric-gagnon.
  • Added Dutch translations. Props to @futtta.
  • Fixed GitLab download URLs. Due to recent changes to the GitLab API, the old way of downloading updates no longer works. Props to @froger-me for the fix and to everyone who provided feedback/test cases in #240.
  • Fixed WordPress incorrectly reporting unknown compatibility of a plugin/theme update in some cases. Props to @dangoodman.
  • Fixed two PHP notices in readme-parser.php. Props to @Tofandel for one of the fixes.
  • Fixed the readme parser ignoring the last readme.txt section when it's empty.
  • Fixed slug conflict detection.
  • Switched to generating OAuth nonces in a cryptographically secure way.
plugin-update-checker - 4.4

Published by YahnisElsts almost 7 years ago

  • Added a way to show a plugin icon on the "Dashboard -> Updates" page.
    Usage: Add the following entry to your JSON file:
    "icons" : {
    	"1x" : "http://example.com/assets/icon-128x128.png",
    	"2x" : "http://example.com/assets/icon-256x256.png",
    	"svg": "http://example.com/assets/icon.svg"
    } 
    
    See supported icon sizes and image formats.
  • Added support for GitHub release assets.
    Usage: Set up the update checker instance as usual, then call the new enableReleaseAssets() method of the GitHub API class.
    $gitHubUpdateChecker->getVcsApi()->enableReleaseAssets();
    
    You can make PUC look for a specific asset by passing a regular expression to enableReleaseAssets(). For example, $api->enableReleaseAssets('/custom-asset/') will make PUC use the first asset where the file name contains the string "custom-asset".
  • Improved error reporting when using the "check for updates" link. Previously, the check could fail with a generic message like "no updates available". Now the update checker will display the underlying API error (if available).
plugin-update-checker - 4.3.1

Published by YahnisElsts almost 7 years ago

This is a hotfix to remove some debug logging code that was accidentally left in the 4.3 release.

Package Rankings
Top 0.55% on Packagist.org
Related Projects