stellarwp / uplink

Client library for interacting with the StellarWP PUE licensing system
GNU General Public License v3.0
1 stars 1 forks source link

Fatal error when updating with invalid license #21

Open jamesckemp opened 1 year ago

jamesckemp commented 1 year ago

Steps to reproduce:

  1. Install 2 or more uplink-based plugins. (Flux and Account Pages on feature/uplink are a good option).
  2. Set the version lower to those on PUE.
  3. Enter an invalid license key for the plugin you want to update.
  4. Try to update via update-core.php admin page.

Issue:

Fatal Error:

[03-Aug-2023 15:43:30 UTC] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Iconic_WAP_NS\StellarWP\Uplink\Admin\Package_Handler::filter_upgrader_pre_download() must be of the type bool, object given, called in /app/wp-content/plugins/iconic-woo-account-pages/vendor-prefixed/stellarwp/uplink/src/Uplink/Admin/Provider.php on line 179 and defined in /app/wp-content/plugins/iconic-woo-account-pages/vendor-prefixed/stellarwp/uplink/src/Uplink/Admin/Package_Handler.php:34
Stack trace:
#0 /app/wp-content/plugins/iconic-woo-account-pages/vendor-prefixed/stellarwp/uplink/src/Uplink/Admin/Provider.php(179): Iconic_WAP_NS\StellarWP\Uplink\Admin\Package_Handler->filter_upgrader_pre_download(Object(WP_Error), 'invalid_license', Object(Plugin_Upgrader), Array)
#1 /app/wp-includes/class-wp-hook.php(308): Iconic_WAP_NS\StellarWP\Uplink\Admin\Provider->filter_upgrader_pre_download(Object(WP_Error), 'invalid_license', Object(Plugin_Upgrader), Array)
#2 /app/wp-includes/plugin.php(205): WP_Hook->apply_filters(Object(WP_Error), Array)
#3 /app/wp-admin/includes/c in /app/wp-content/plugins/iconic-woo-account-pages/vendor-prefixed/stellarwp/uplink/src/Uplink/Admin/Package_Handler.php on line 34

Notes:

This issue only seems to occur when 2 uplink-based plugins are running. When there's only one, it displays a notice instead of a fatal error.

CleanShot 2023-08-03 at 16 48 14@2x
davegreenwp commented 7 months ago

@defunctl seeing a couple more reports of this error in the wild via the helpdesk, although I don't have information yet around whether the invalid licensing portion of James's original report can be replicated here.

Do you have any capacity to take a look?

defunctl commented 7 months ago

@davegreenwp I believe this PR that Ben opened is the fix, are you able to give it a try?

However, the PR is going to another branch so you may need to cherry pick it.

https://github.com/stellarwp/uplink/pull/65

defunctl commented 7 months ago

Got a PR open to main now: https://github.com/stellarwp/uplink/pull/66

defunctl commented 7 months ago

@davegreenwp that's released here https://github.com/stellarwp/uplink/releases/tag/v1.4.2

Give it a try, however note that customers experiencing this issue would need to manually update their plugins.

davegreenwp commented 7 months ago

thanks @defunctl I'll carve out some time tomorrow to pull these changes into the two plugins in question and get some pre-release copies to the customers who reported. I know at least one has a staging environment.