WordPress.org

Ready to get started?Download WordPress

Plugin Directory

WP Plugin Repo Stats

Plugin developers can list their plugins and download counts from wordpress.org.

What are the plugin defaults?

The plugin arguments and default values may change over time. To get the latest list of arguments and defaults, look at the settings page after installing the plugin.

How do I use the plugin?

Use a shortcode to call the plugin from any page or post like this:

[plugin-repo-stats]

This will:

  • fetch the download counts for a given wordpress.org profile ID (which you put in the plugin's Settings page, right?)
  • add rel="nofollow" to each link
  • use rounded corner CSS
  • cache the plugin output for one hour (3600 seconds = 60 seconds * 60 minutes * 1 hour)
  • include plugin star rating images
  • links open in same window

Your wordpress.org profile ID is your login on wordpress.org. You must include this or the plugin will do nothing.

You can also call the plugin in your functions.php, ex:

if (function_exists('wpprs')) {
  wpprs(array('uid' => 'your userid', 'show' => true));
}

Always wrap plugin function calls with a function_exists check so that your site doesn't go down if the plugin isn't active.

How can I style the output?

The output contains extensive CSS classes you can target in your style.css. You can style alternating rows and style each table column separately. View the output source to see the table CSS structure, or browse the plugin's 'css' folder. The CSS to duplicate the screenshot is included in the plugin. You will need to override this if you want to see something different.

I inserted the shortcode but don't see anything on the page.

Clear your browser cache and also clear your cache plugin (if any). If you still don't see anything, check your webpage source for the following:

<!-- WP Plugin Repo Stats: plugin is disabled. Check Settings page. -->

This means you didn't pass a necessary setting to the plugin, so it disabled itself. You need to pass at least the wordpress.org userid, either by entering it on the settings page or passing it to the plugin in the shortcode or PHP function. You should also check that the "enabled" checkbox on the plugin settings page is checked. If this box is unchecked, the plugin will do nothing even if you pass your userid.

I changed a setting on the plugin's settings page but the table still reflects my old settings.

The plugin output is cached (using WP 3.5+ transients) to avoid overtaxing the wordpress.org website with excessive scraping requests. Excessive scraping may result in an IP ban, which would cause denial of service. Wait until the cache expires, then reload the page to view your settings changes.

Even if you specify a very low cache time (ex: 60 seconds), the plugin will only re-fetch content every 5 minutes. Please do not edit the plugin to change this. Unless the download count is very low, it is highly unlikely that any given plugin is downloaded so often that someone visiting a page after five minutes would actually notice how many more downloads it has.

You might also consider clearing your browser cache and your caching plugin.

I cleared my browser cache and my caching plugin but the output is still old.

Are you using a plugin that minifies CSS? If so, try excluding the plugin CSS file from minification.

I cleared my cache and still don't see what I want.

The CSS files include a ?ver query parameter. This parameter is incremented with every upgrade in order to bust caches. Make sure none of your plugins or functions are stripping this query parameter. Also, if you are using a CDN, flush it or send an invalidation request for the plugin CSS files so that the edge servers request a new copy of it.

I called the plugin on two different pages with two different cache times, but the cache doesn't refresh as expected.

The cache is userid-dependent and site-wide. You cannot specify different cache times for the same userid concurrently -- the first shortcode or function call that is made on an empty cache will set the cache time. Ideally you are only displaying the output of this plugin once on your site.

The plugin feels slow.

WP Plugin Repo Stats has to visit a given user's wordpress.org profile page, then (if requested) visit each plugin's page and parse it for the plugin's rating. This is time consuming and totally dependent on wordpress.org's network availability. If a given user has a large amount of plugins in the repo, it could take a relatively significant amount of time to fetch each page. To optimize the plugin's operation, the star rating is left blank if there is a page error on wordpress.org (no stars).

To speed up the plugin operation, increase the cache time and (if possible) do not request plugin star ratings (uncheck 'Show plugin ratings?' on the plugin settings page). The default cache time is 12 hours and I recommend you leave it that way to avoid burdening wordpress.org.

I want to remove the post editor toolbar button.

Add this to your functions.php:

remove_action('admin_print_footer_scripts', 'add_wpprs_quicktag');

I want to remove the admin CSS.

Add this to your functions.php:

remove_action('admin_head', 'insert_wpprs_admin_css');

I don't want to use the plugin CSS.

Add this to your functions.php:

add_action('wp_enqueue_scripts', 'remove_wpprs_style');
function remove_wpprs_style() {
  wp_deregister_style('wpprs_style');
}

I don't see the plugin toolbar button(s).

This plugin adds one or more toolbar buttons to the HTML editor. You will not see them on the Visual editor.

The label on the toolbar button is "Plugin Repo Stats".

How do I show download and rating for only one plugin?

Use the "pluginname" parameter like this:

[plugin-repo-stats pluginname="Name of your plugin"]

This will output a small box with a link to the plugin page on wordpress.org, the date, the download count and the plugin rating (if checked on the plugin settings page).

I am using the shortcode but the parameters aren't working.

On the plugin settings page, go to the "Parameters" tab. There is a list of possible parameters there along with the default values. Make sure you are spelling the parameters correctly.

The Parameters tab also contains sample shortcode and PHP code.

Requires: 3.5 or higher
Compatible up to: 3.9.1
Last Updated: 2014-6-25
Downloads: 4,010

Ratings

4 stars
4.8 out of 5 stars

Support

1 of 1 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,1,1
0,1,0 100,1,1