Skip to content

Commit

Permalink
Add an optional "active_installs" field. This should be an positive i…
Browse files Browse the repository at this point in the history
…nteger that indicates how many sites use your plugin. WordPress will show it in the "view version 1.2.3 details" pop-up. For example, if you set it to 10000, users will see "Active Installs: 10,000+".

  
 Note that wordpress.org itself reports approximate install stats - e.g. 10000 instead of 11450. It's up to you whether you want to do the same, show the exact number of installs, or omit this field entirely.
  • Loading branch information
YahnisElsts committed Jun 26, 2015
1 parent 317a45d commit f4b013c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin-update-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ class PluginInfo_2_0 {
public $rating;
public $num_ratings;
public $downloaded;
public $active_installs;
public $last_updated;

public $id = 0; //The native WP.org API returns numeric plugin IDs, but they're not used for anything.
Expand Down Expand Up @@ -944,7 +945,7 @@ public function toWpFormat(){
//as those returned by the native WordPress.org API. These can be assigned directly.
$sameFormat = array(
'name', 'slug', 'version', 'requires', 'tested', 'rating', 'upgrade_notice',
'num_ratings', 'downloaded', 'homepage', 'last_updated',
'num_ratings', 'downloaded', 'active_installs', 'homepage', 'last_updated',
);
foreach($sameFormat as $field){
if ( isset($this->$field) ) {
Expand Down

0 comments on commit f4b013c

Please sign in to comment.