Open bobbingwide opened 7 years ago
Follow on problem.
Having changed the code to remove the .info
from the URL the result is once again being returned as serialized data. But I'm getting Notices about the short_description
property not being defined.
It turns out that short_description isn't a default field so it needs to be requested using ?fields[short_description]=true.
This didn't work without the .php
suffix
http://api.wordpress.org/plugins/info/1.0/jetpack?fields[short_description]=true
But does work as
http://api.wordpress.org/plugins/info/1.0/jetpack.php?fields[short_description]=true
It seems that test_bw_plug_banner_image_url()
was not changed but should have been.
There is now another problem with this test when run in the local environments qw/wordpress or qw/oikcom.
... the short_description for oik is not that from wordpress.org.
It is correct when run from qw/src. Workaround: deactivate oik-plugins
bw_get_plugin_info2() is now receiving a different result from its request being performed by the following code
Expected output
For some plugins hosted on WordPress the [bw_plug] shortcode would display the latest available information for the plugin.
Actual output
No info available
For some plugins the results appear to be unchanged. I'll need to confirm this! I don't think it's the local caching of the results in transients.
Explanation
In a brief discussion on WordPress Slack Meta channel I was advised that I was using an endpoint that's not officially supported. https://wordpress.slack.com/archives/C02QB8GMM/p1495034365502545
Subsequent messages indicated that there are a variety of acceptable formats giving slightly different results.
It turns out that in order to continue to receive the response as serialized data I should either remove the
.info
or change it to.php
For JSON format data I could use the .json suffix.It's odd that the code had worked fine since April 2015 but is playing up now. I suspect it's something to do with the new plugin directory.
Not sure if I've found the right source files... https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/standalone/class-plugins-info-api.php