Opened 4 years ago
Closed 18 months ago
#5570 closed defect (bug) (fixed)
Plugins API - inconsistent results for short_description if being trimmed.
Reported by: | polevaultweb | Owned by: | dd32 |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Plugin Directory | Keywords: | |
Cc: |
Description
My plugin has a short description longer than 150 characters in the readme.txt (due to the ampersand being turned into it's HTML entity taking it over the limit).
However, the API request for 'plugin_information' returns different results for the short_description at different times of the day.
curl --location -g --request GET 'https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slug]=wp-user-manager&request[fields]=short_description'
It can return:
The most customizable profiles & community builder WordPress plugin with front-end login, registration, profile customization and content restrict …
Which is 150 chars if you don't count ' …'
But then a later call to the API returns:
The most customizable profiles & community builder WordPress plugin with front-end login, registration, profile customization…
It feels like some double trimming is happening somewhere along the line.
Change History (6)
#1
@
4 years ago
- Component changed from API to Plugin Directory
- Owner set to dd32
- Status changed from new to accepted
#3
@
4 years ago
I'm unable to find any double trimming, as the trimming only happens at plugin import stage, not during the API requests.. I'm going to leave this ticket open though and keep running some API requests to see if it can be caught.
If you see it happen again, checking what this other API returns might be useful:
curl --silent 'https://wordpress.org/plugins/wp-json/plugins/v1/plugin/wp-user-manager' | jq .short_description
In [10565] above I did alter the import process to account for encoded HTML entities in the determination of whether it needs to trim or not, it's still counted during the actual trimming, just not during the determination of whether to do so.
$ curl --silent --location -g --request GET 'https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slug]=wp-user-manager&request[fields]=short_description' | jq .short_description "The most customizable profiles & community builder WordPress plugin with front-end login, registration, profile customization and content restriction."
I had considered that maybe the scenario here was a bad translation, but it doesn't look like this plugin has any translated descriptions, and looking at other translated plugins, the short_description translations aren't trimmed to 150char, eg, Hello Dolly spanish at 157char:
$ curl --silent --location -g --request GET 'https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slug]=hello-dolly&request[fields]=short_description&request[locale]=es_ES' | jq .short_description "Esto no es solo un plugin, simboliza la esperanza y entusiasmo de toda una generación resumidos en las dos palabras más famosas cantadas por Louis Armstrong."
#4
@
4 years ago
@dd32 thanks for looking into this.
Running my CURL command today gets the shorter incorrect result
http://g.recordit.co/uUBcRRVjMM.gif
Running your command with the different API returns the full data
❯ curl --silent 'https://wordpress.org/plugins/wp-json/plugins/v1/plugin/wp-user-manager' | jq .short_description
"The most customizable profiles & community builder WordPress plugin with front-end login, registration, profile customization and content restriction."
In 10565: