[wp-meta] [Making WordPress.org] #6032: plugins_api() 'downloadlink', 'reviews', and 'versions' query args do nothing.
Making WordPress.org
noreply at wordpress.org
Fri Jan 21 16:54:03 UTC 2022
#6032: plugins_api() 'downloadlink', 'reviews', and 'versions' query args do
nothing.
----------------------+--------------------
Reporter: jsmoriss | Owner: (none)
Type: defect | Status: new
Priority: normal | Milestone:
Component: API | Keywords:
----------------------+--------------------
The following query should return the plugin reviews, and not a download
link or the versions array, but these three query arguments do not work.
Example test script:
{{{
#!/usr/bin/php
<?php
define( 'BASE_PATH', '/.../wordpress/' );
require( BASE_PATH . 'wp-load.php' );
require( BASE_PATH . 'wp-admin/includes/plugin-install.php' );
$plugin_api_data = plugins_api( 'plugin_information', array(
'slug' => 'wordpress-seo',
'fields' => array(
'active_installs' => false,
'added' => false,
'banners' => false,
'compatibility' => false,
'description' => false,
'donate_link' => false,
'downloaded' => false,
'downloadlink' => false, // Does not work.
'contributors' => false,
'group' => false,
'homepage' => false,
'icons' => false,
'last_updated' => false,
'rating' => true,
'ratings' => true,
'reviews' => true, // Does not work.
'requires' => false,
'requires_php' => false,
'sections' => false,
'short_description' => false,
'tags' => false,
'tested' => false,
'versions' => false, // Does not work.
),
) );
print_r( $plugin_api_data );
}}}
Outputs (I've trimmed the screenshots and versions arrays for brevity):
{{{
stdClass Object
(
[name] => Yoast SEO
[slug] => wordpress-seo
[version] => 17.9
[author] => <a href="https://yoa.st/1uk">Team Yoast</a>
[author_profile] => https://profiles.wordpress.org/joostdevalk/
[rating] => 96
[ratings] => Array
(
[5] => 25772
[4] => 619
[3] => 178
[2] => 125
[1] => 731
)
[num_ratings] => 27425
[support_threads] => 460
[support_threads_resolved] => 372
[download_link] => https://downloads.wordpress.org/plugin/wordpress-
seo.17.9.zip
[screenshots] => Array
(
[1] => Array
(
[src] => https://ps.w.org/wordpress-
seo/assets/screenshot-1.png?rev=2643727
[caption] => The Yoast SEO plugin general meta box.
You'll see this on edit post pages, for posts, pages and custom post
types.
)
)
[versions] => Array
(
[17.9] => https://downloads.wordpress.org/plugin/wordpress-
seo.17.9.zip
[trunk] => https://downloads.wordpress.org/plugin/wordpress-
seo.zip
)
)
}}}
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/6032>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list