Skip to content

Handle case where paid plugin update is put into no_update array #451

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

Merged
merged 1 commit into from
May 7, 2025

Conversation

mrsdizzie
Copy link
Member

@mrsdizzie mrsdizzie commented May 7, 2025

To avoid warning in some cases:

PHP Notice:  Undefined property: stdClass::$requires in /usr/local/etc/wp-cli/packages/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 875

Previously it was assumed the only way an update can be placed into no_update at the server level was if wp.org detected an incompatible WordPress version. Now that it has been released, I've seen that paid plugins which have an updated version the user isn't entitled to can also cause newer versions to end up in the no_update section as well.

Of course it doesn't actually provide a reason anywhere. An example I saw of a paid plugin update that is held back:

object(stdClass)#3821 (6) {
  ["plugin"]=>
  string(29) "gravityformspaypal/paypal.php"
  ["url"]=>
  string(27) "http://www.gravityforms.com"
  ["slug"]=>
  string(18) "gravityformspaypal"
  ["package"]=>
  string(0) ""
  ["new_version"]=>
  string(3) "3.5"
  ["id"]=>
  string(1) "0"
}

And FWIW here is what the above looked like in the WordPress dashboard:
Screenshot 2025-05-07 at 11 38 33

To avoid warning:

PHP Notice:  Undefined property: stdClass::$requires in
/usr/local/etc/wp-cli/packages/vendor/wp-cli/extension-command/src/Plugin_Command.php
on line 875
@mrsdizzie mrsdizzie added the bug label May 7, 2025
@mrsdizzie mrsdizzie requested a review from a team as a code owner May 7, 2025 15:28
@mrsdizzie mrsdizzie added this to the 2.1.25 milestone May 7, 2025
Copy link

codecov bot commented May 7, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Plugin_Command.php 80.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@mrsdizzie mrsdizzie merged commit c82082b into main May 7, 2025
42 of 43 checks passed
@mrsdizzie mrsdizzie deleted the fix-undefined branch May 7, 2025 16:11
@swissspidy swissspidy mentioned this pull request May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants