Skip to content
Article

How to count your WordPress Plugins

As you may have noticed, we’ve been working on sharing some WordPress plugins with the community.  I like to check our profile page occasionally to see how our plugins are doing – download stats, forum posts, that sort of thing.

Like any other programmer, I also want to be able to say “Look!  All (y)our plugin are belong to us and have been downloaded X number of times!”  But the more plugins we write, the harder it is to figure out the total downloads, since they’re listed individually.

Enter javascript console:

[javascript]
(function($){
var sum = 0;
$(‘p.downloads’).each(function(i,o){
var $o = $(o)
, text = $o.text()
, count = parseInt( text.replace(‘ downloads’, ”).replace(‘,’, ”) )
;
sum += count;
});
var msg = ‘Total Downloads for User: ‘ + sum;
console.log(msg);
alert( msg );
})(jQuery);
[/javascript]

Voila! Bragging rights made easy!

The Atlantic BT Manifesto

The Ultimate Guide To Planning A Complex Web Project

Insights

Atlantic BT's Insights

We’re sharing the latest concepts in tech, design, and software development. Learn more about our findings.

Questions & Answers

What is the best web development framework?
Many people commonly ask “what is a framework in web development?” Web development frameworks can easily be confused with web development tools, languages, or parts of the web development stack (like .NET, PHP, JavaScript, or Ruby).
Learn More about What is the best web development framework?
What is the best programming language for web development?
If there was one “best” programming language, then everything else would be obsolete. The reality is that there are so many different programming languages because there is no “best” language for any situation.
Learn More about What is the best programming language for web development?
How much does web development cost?
Web development can vary from a few hundred to millions of dollars depending on what is needed. You may simply need some changes to something that already exists, or you'd like to build a large or complex application.
Learn More about How much does web development cost?
What is web design and development?
People often lump web design and development together, so what's the difference? As the Internet has evolved, the skills required to produce a high quality website or web application have changed.
Learn More about What is web design and development?
What is React web development?
React is a popular JavaScript library. It is primarily used for building interactive user interfaces (UI).
Learn More about What is React web development?
What is PHP web development?
PHP is a back end language primarily used for custom applications, content management systems (such as Wordpress), eCommerce engines (such as Magento), or even massive sites like Facebook.
Learn More about What is PHP web development?
What is bootstrap in web development?
Bootstrap is a framework used in front-end development to save time, specifically for mobile-first development. It combines CSS and JavaScript templates and libraries to speed up the development process.
Learn More about What is bootstrap in web development?