Could we help you? Please click the banners. We are young and desperately need the money
While I was working on internal WP plugin, I had to find a way to automatically check and update that plugin. Therefore, I have created a PHP class PluginUpdater which would make it easy for the whole team to implement on multiple plugins. PluginUpdater has GPL-2.0 licence and it's free to use.
It's available on GitHub, from where it can be downloaded and included manually. However, the recommended way is to use Composer, because it's also available on Packagist. In that case it can be easy included using:
composer require lexo/plugin-updater
Keep in mind that PluginUpdater requires PHP >=7.4.1 and it's tested up to PHP 8.1.9
Release tags are created with Semantic versioning in mind. Commit messages were following convention of Conventional Commits.
(new PluginUpdater())
->setBasename(BASENAME)
->setSlug(PLUGIN_SLUG)
->setVersion(VERSION)
->setRemotePath('https://website.tld/path/info.json')
->setCacheKey(CACHE_KEY)
->setCacheExpiration(12 * HOUR_IN_SECONDS)
->setCache(true)
->run();
For more details you can check out GitHub or Packagist pages.