YahnisElsts / 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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update plugin based on the tag instead of the version in the plugin file

calebsmithdev opened this issue · comments

I've got the plugin setup and working great, as long as the version # in the php file is correct. For reference, here is our use case in Github:

  • Build pipeline that automatically creates and increments a version number
  • Version is updated in the PHP file then uploaded as an asset for the release
  • Version in the main branch always shows Version: @dev.

Ideally, this makes it so we can release changes from our main branch on demand without needing to push up additional code through the pipeline. It looks like the code here is pulling in the latest tag and I can step through the code to see that, but the version is getting overwritten based on what it sees in the metadata for the PHP file.

Is there a way that I can ignore the branch altogether? I just want it to check for the latest releases.

Found it! This code snippet was overriding the version based on what it found from the branch, so I'll just go ahead and remove it for now and continue on:

$remotePlugin = $api->getRemoteFile($mainPluginFile, $ref);