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 early from ::installed_or_updated() when no plugin in list #95

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

BrianHenryIE
Copy link
Contributor

Proposed changes

When JavaScript is disabled, the plugin updater can be run with no plugins selected.

This results in an event which causes an error in Hiive

Type of Change

Don't fire the event if there is no plugin. Return early after the WordPress action is called:

if ( ... || ( ! empty( $options['plugins'] ) && empty( $options['plugins'][0] ) ) ) { return; }

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Video

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

This is also handled in Hiive and I intend to address it in WP Core too.

@circlecube circlecube merged commit f98dfab into main Aug 30, 2024
8 checks passed
@circlecube circlecube deleted the fix/null-plugin-object-PRESS1-427 branch August 30, 2024 19:52
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

Successfully merging this pull request may close these issues.

2 participants