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

Check if api.w.org is available #5

Open
ocean90 opened this issue Aug 20, 2017 · 3 comments
Open

Check if api.w.org is available #5

ocean90 opened this issue Aug 20, 2017 · 3 comments
Milestone

Comments

@ocean90
Copy link
Member

ocean90 commented Aug 20, 2017

Currently when you run composer update and api.w.org isn't available you get two misleading warnings. Example:

> Required\ComposerScripts\PluginAvailability::checkAvailability
The plugin wpackagist-plugin/facebook-conversion-pixel does not seem to be available in the WordPress Plugin Directory anymore
> Required\ComposerScripts\PluginAvailability::checkMaintenanceStatus
The plugin wpackagist-plugin/facebook-conversion-pixel has not been updated in over two years. Please double-check before using it.
  - Updating wpackagist-plugin/facebook-conversion-pixel (2.0.1 => 2.1.0): Downloading (100%)

I suggest to check the HTTP response and provide some more information in this case. Or skip any checks.

@ocean90 ocean90 added this to the 1.0.0 milestone Oct 23, 2017
@ocean90
Copy link
Member Author

ocean90 commented Oct 23, 2017

isPluginAvailable() and isPluginActivelyMaintained() are already trying to catch an ErrorException exception. So if loadPluginData() would return an exception in case of an unavailable API we could instead return true in both methods and print a debug message (once?) that the API couldn't be reached.

@swissspidy
Copy link
Contributor

We could probably add a private property to the class and set that flag once the API is not available. At the end, add an info/warning if the flag is set.

What if the API is only unavailable for some requests?

Also, it's probably easier to add a custom Exception class for this.

@swissspidy
Copy link
Contributor

@swissspidy swissspidy self-assigned this Feb 6, 2018
@swissspidy swissspidy removed their assignment Feb 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants