Opened 7 weeks ago
Last modified 6 weeks ago
#7732 new defect (bug)
Recommended `query_plugins` request fails with many installed plugins
Reported by: | desrosj | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | API | Keywords: | |
Cc: |
Description
Today I encountered a 414 Request-URI Too Long
error on the recommended plugins page on a site with many installed plugins.
https://api.wordpress.org/plugins/info/1.2/ ?action=query_plugins &request%5Bpage%5D=1 &request%5Bper_page%5D=36 &request%5Blocale%5D=en_US &request%5Bbrowse%5D=recommended &request%5Binstalled_plugins%5D%5B1%5D=add-from-server &request%5Binstalled_plugins%5D%5B2%5D=admin-color-schemes &request%5Binstalled_plugins%5D%5B3%5D=advanced-custom-fields &request%5Binstalled_plugins%5D%5B4%5D=tinymce-advanced ... &request%5Binstalled_plugins%5D%5B334%5D=wp-smushit &request%5Binstalled_plugins%5D%5B335%5D=woocommerce-payments &request%5Binstalled_plugins%5D%5B336%5D=yoast-seo-wordpress-premium &request%5Bwp_version%5D=6.7
This is a test site that I use for testing certain things (like auto-updates with many installed) and I recognize this is a large number of plugins. But it's not clear what the actual character limit is on the request.
If the limit is already at a reasonable level, perhaps the API could be updated to also accept a comma separated list of plugin names instead of an array to avoid having to repeat the entire request[installed_plugins][##]=
string?
Change History (3)
#2
@
6 weeks ago
Also, are you building this string, or is WordPress doing it through the plugin_api() function?
It's definitely WordPress building that.
This is probably something that should be handled on the API side, but will need a systems request to process.
#3
@
6 weeks ago
How many plugins are you talking here, exactly?
I have 340 plugins installed. Confirmed that it's plugin_api()
in WordPress building the query.
I checked the full query, it's over 19k characters because of the repeated &request[installed_plugins][##]
. After converting the format to &installed_plugins=akismet,wordpress-seo,jetpack,etc...
the full request was only 6,331
characters.
How many plugins are you talking here, exactly?
Also, are you building this string, or is WordPress doing it through the plugin_api() function?
If it is a WordPress thing, then most likely this should be in core.trac.