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

Return $update = true for plugins with empty slugs #45

Open
ecairol opened this issue Sep 26, 2024 · 2 comments
Open

Return $update = true for plugins with empty slugs #45

ecairol opened this issue Sep 26, 2024 · 2 comments

Comments

@ecairol
Copy link
Contributor

ecairol commented Sep 26, 2024

If we have a plugin with an empty slug, should our autoupdate-filter return true for it, so it moves from the Disabled bucket to the Enabled one?

See for instance here, on Hey Shayla Dev (https://hey-shayla-launch-planning.mystagingwebsite.com/):

8 plugins mysteriously have updates disabled
Screenshot 2024-09-26 at 2 32 04 PM

Once you debug you realize that they are all empty slugs:
Screenshot 2024-09-26 at 2 32 57 PM

If returning true has other undesired consequences, perhaps adding a notice somewhere would be a nice UX/UI feature.

@NickGreen
Copy link
Contributor

Many thoughts here, none conclusive yet:

  • I didn't think that Plugin Autoupdate Filter affected which ones show up as individually having "Autoupdates Enabled".. would have to test that.
  • We should probably define slugs for our internal plugins, even though it's not technically required or enforced by WordPress.. would adding Text Domain: my-plugin to the plugin headers accomplish that?
  • It would be smart to not require slug in Plugin Autoupdate Filter if it's not required by WordPress. Maybe if no slug, we could find an alternate way to track the plugin.

@ecairol
Copy link
Contributor Author

ecairol commented Oct 2, 2024

Thanks @NickGreen, I'm pretty much aligned with your thoughts.

Maybe if no slug, we could find an alternate way to track the plugin.

If I remember correctly, the empty-slugs plugins are already gracefully handled using their file-name.php. However, as a user I would think they are not being updated because they are in the Disabled bucket (even though they are being kept up to date).

I'm 99% sure the above is true, but a little bit of testing wouldn't hurt. In fact our plugins Safety Net and Plugin Auto Update filter have empty slugs and yet they are always kept up to date.

So if they are being updated as expected, to avoid confusion, the filter should return true for these empty slugs. That way they aren't placed in the Disabled tab.

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

No branches or pull requests

2 participants