Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicting Update available from WordPress Plugin Directory #581

Closed
dylanjameswagner opened this issue Aug 3, 2017 · 18 comments
Closed
Labels

Comments

@dylanjameswagner
Copy link

I receive a plugin 'new versions available' from the WordPress Updates screen for a similarly named plugin from the public WordPress Plugin Directory after all qualified GitHub updates have been applied. Even with the define( 'GITHUB_UPDATER_EXTENDED_NAMING', true ); set in . my wp-config.php.

Example:

I installed a test plugin named 'wordpress-plugin' via the GitHub Updater interface from a private repo. Installed it has the directory naming of <git>-<owner>-<repo>. The plugin has the 'GitHub Plugin URI' as required and it detects version increments as expected but apparently, there is a plugin on the Plugin Directory that matches the name 'wordpress-plugin' with a version number greater than my test plugin version and after applying any GitHub Updater updates I receive notice of pending updates from the Plugin Directory version.

I thought the extended naming was supposed to help avoid this naming collision. Or is there something I am missing?

@afragen
Copy link
Owner

afragen commented Aug 3, 2017

You will need to use the branch switcher to reinstall the branch after setting extended naming. The renaming only occurs on updates, installs, and branch switching.

@afragen
Copy link
Owner

afragen commented Aug 3, 2017

Can you give me read access or a token to access your plugin so I can test?

If not I'll see what I can do on my own.

@afragen
Copy link
Owner

afragen commented Aug 3, 2017

@dylanjameswagner It's been a while since I've tested this and I've found several issues. I'm working on a fix. It will be in the develop branch soon. I hope you'll be able to help test.

@afragen
Copy link
Owner

afragen commented Aug 4, 2017

I think I've managed to fix the extended naming updating. Can you switch to the develop branch and test for me?

You might have to both refresh cache and select 'Check Again' from the update-core.php page.

@afragen
Copy link
Owner

afragen commented Aug 5, 2017

@dylanjameswagner I have a question. While fixing this I realize I don't really have to rename the slug.

Do you think it would be better to simply have a constant that allows for overriding dot org? Functionally it would be the same. I'm thinking yes, as the developer named their repo intentionally.

@afragen afragen added the testing label Aug 5, 2017
@afragen
Copy link
Owner

afragen commented Aug 6, 2017

ab7c4b1 should fix this issue.

Be aware that extended naming no longer happens but overriding dot org updates does.

There is a new constant GITHUB_UPDATER_OVERRIDE_DOT_ORG instead of the old constant, but the old constant still works for now.

Let me know how this works for you.

@afragen afragen added the fixed label Aug 6, 2017
@dylanjameswagner
Copy link
Author

dylanjameswagner commented Aug 7, 2017

Hello, thanks for the quick response. I have just taken a look at the latest update and it seems to solve the issue and no longer prompts me to update from the wordpress.org even if I remove the GITHUB_UPDATER_OVERRIDE_DOT_ORG constant. Idk if that is what is intended. (I think maybe the conflicting plugin wordpress-plugin was removed, I can no longer find it.

On another note, when installing a different plugin with a conflicting name without the GITHUB_UPDATER_OVERRIDE_DOT_ORG constant set to true the Updater compares the plugin to the Plugin Directory until the constant is added, at which point it compares it to GitHub. So that seems to jive with my understanding of the intended behavior.

@afragen
Copy link
Owner

afragen commented Aug 7, 2017

I have just taken a look at the latest update and it seems to solve the issue and no longer prompts me to update from the wordpress.org even if I remove the GITHUB_UPDATER_OVERRIDE_DOT_ORG constant. Idk if that is what is intended. (I think maybe the conflicting plugin wordpress-plugin was removed, I can no longer find it.

That's not the intended behavior. It may be that the conflicting plugin has been removed permanently or temporarily.

On another note, when installing a different plugin with a conflicting name without the GITHUB_UPDATER_OVERRIDE_DOT_ORG constant set to true the Updater compares the plugin to the Plugin Directory until the constant is added, at which point it compares it to GitHub. So that seems to jive with my understanding of the intended behavior.

What happens is GHU compares all GHU compatible plugins against the update transient. If the update transient is coming from dot org then that value is unset if the constant is true.

@dylanjameswagner
Copy link
Author

Thank you for the prompt fix.

@afragen
Copy link
Owner

afragen commented Aug 7, 2017

I think I fixed for theme collisions too. 🤓

@afragen afragen closed this as completed Aug 7, 2017
@Pokerkoffer
Copy link

Bug: This Plugin is updated by Github Updater, although it still exists on the official Wordpress Plugin Repo. GITHUB_UPDATER_OVERRIDE_DOT_ORG ist set to true.

https://de.wordpress.org/plugins/html-editor-syntax-highlighter/

@afragen
Copy link
Owner

afragen commented Sep 4, 2017

@Pokerkoffer if I understand correctly this is the expected behavior. If GITHUB _UPDATER_OVERRIDE_DOT_ORG is true, then updates will only come from GitHub Updater. If you set it to false or remove it, whichever plugin has the highest version number will show an update.

Can you provide the URL for the repo that you want the updates to come from?

@Pokerkoffer
Copy link

Oh yeah, im sorry i misread that. I added the switch because it kept updating from github.
The Repo URL: https://github.com/mukhortov/HESH-WordPress-Plugin

@afragen
Copy link
Owner

afragen commented Sep 4, 2017

So here’s the issue. The ‘slug’ that both dot org and GHU use must be the same for this to function. The GitHub repo slug is HESH-WordPress-Plugin and the dot org slug is html-editor-syntax-highlighter.

Given the above, if you installed the plugin from dot org it will be stored in a wp-content/plugins/html-editor-syntax-highlighter once GHU updates it it will now be stored in wp-content/plugins/HESH-WordPress-Plugin. I will also likely be deactivated and never update from dot org again.

The only solution is to change the repository name on GitHub to html-editor-syntax-highlighter.

@Pokerkoffer
Copy link

I am unable to change the repo name because i am not the author or owner. Can you maybe add an option to exclude specific Plugins from updating through github updater? That would be awesome. Thanks

@afragen
Copy link
Owner

afragen commented Sep 4, 2017

It's really much simpler to contact the owner and let them know of the issue. Have them contact me and reference this issue.

If you never update using GitHub Updater it will always update correctly from dot org. Essentially what has happened is that you have 2 distinct plugins, one looking to dot org to correctly update and both looking to GitHub. If you want to use a branch other than master then obviously use GHU to update.

I’m happy to work with the developer to solve this, but the solution is to change the repository name not add a new feature.

@jessuppi
Copy link

For other Googlers,

@afragen is it accurate that GITHUB_UPDATER_OVERRIDE_DOT_ORG and GITHUB_UPDATER_EXTENDED_NAMING constants are no longer supported, and the per-theme or per-plugin filter for disabling WordPress.org update checks is the current recommendation now?

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

@afragen
Copy link
Owner

afragen commented Dec 16, 2022

Correct. All constants for settings have been removed. BTW they have been removed for quite a while now.

The above referenced KB page has the best information. If there's something unclear please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants