phpwordpress

Prevent WordPress.org from overriding Git Updater for new versions?


I am using Git Updater to manage the releases of my open source themes and plugins which are being hosted on GitHub.

Because of namespace conflicts, if a theme or plugin that I release on GitHub has the same directory (folder) name as another one from WordPress.org, Git Updater can't "see" new versions, because WordPress.org takes priority over GitHub.

I came across a way to disable WordPress.org update checks, but this also affects Git Updater negatively. How can I release themes or plugins using whatever directory name I want, without conflicting with WordPress.org?


Solution

  • After reviewing a few other previous issues that other developers had opened recently with similar conflicts, I discovered a snippet that you can add to your themes or plugins hosted on GitHub that will solve this issue:

    add_filter(
        'gu_override_dot_org',
        function ( $overrides ) {
            return array_merge(
                $overrides,
                array( 'plugin-folder/main-script.php' )
            );
        }
    );
    

    I revised snippet as per this GitHub issue.

    It doesn't show up well in search engines, but the related documentation is found here:

    https://git-updater.com/knowledge-base/wordpress-org-directory/

    Note: I also tried the new Update URI: false header as suggested, but it didn't work and I suspect it conflicts for the same reason as the link in my OP question above. To be honest, this new header seems rather pointless, since third-party updates aren't supported...