rhubarbgroup / redis-cache

A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.
https://wordpress.org/plugins/redis-cache/
GNU General Public License v3.0
427 stars 149 forks source link

needs Primary Branch header to avoid errors with Git Updater #449

Closed basscl closed 1 year ago

basscl commented 1 year ago

redis-cache.php has the following header, presumably so that the plugin can be managed via the Git Updater plugin GitHub Plugin URI: https://github.com/rhubarbgroup/redis-cache Git Updater by default requests 'master; branch, but since redis-cache uses 'main', not 'master', when Git Updater requests 'master' branch it returns an error, and displays an error message in the WP dashboard. This error can be avoided simply by adding Primary Branch: main to redis-cache.php

tillkruss commented 1 year ago

Can you open an issue with Git Updater and link it here, because the new GitHub format is main and not master.

tillkruss commented 1 year ago

Here is your answer: https://git-updater.com/knowledge-base/branch-switching/

basscl commented 1 year ago

I understand that Git Updater expecting master as default branch name goes against the new Github default, and I will open an issue over there.

However, the GitHub Plugin URI: header is optional for WP and is afaik only used by Git Updater, so the only reason to include it is if you want to make your plugin work ok with Git Updater. Otherwise it would be best to just remove the GitHub Plugin URI: header.

Re branch switching - this is only possible if Git Updater has correctly connected with the plugin, and if a plugin has default branch other than Master, this can only happen if the plugin has the Primary Branch: header as mentioned in the kb article you linked to. In this case the plugin was installed via the standard WP plugin gui, so Git Updater branch switching is not possible.

Until either Git Updater fixes this or your plugin headers are updated, anyone using both plugins will see a constant error in their dash. We are using the following lines to avoid this on client sites:

if ( class_exists( 'Fragen\Git_Updater\Ignore' ) ) :
    new Fragen\Git_Updater\Ignore( 'redis-cache', 'redis-cache/redis-cache.php' );
endif;
tillkruss commented 1 year ago

I'm glad you found a solution.

It's been 3 years since the GitHub change and it's that plugin's core competency, I'd expect them to fix it.

https://www.zdnet.com/article/github-to-replace-master-with-alternative-term-to-avoid-slavery-references/