Wordpress Page Views Counter


Inspired to Author Page Views, this WordPress plugin keeps track of every single view of every single post of the blog. The home page and the single pages will be ignored.

Created for WordPress v 3.8.1

On every post are incremented the user views count for that post and stored the user IP address with a custom expiration datetime (default: 1 day).
On the Dashboard there is a new option that allows the admin to view a complete report per page (Post ID, Post Title, Views), filter per date range and export as a .CSV file.

Is also available an internal function (added as WordPress function) to get the most popular (the most viewed) posts.
The number of popular posts is customizable and you are free to format the returned array as you prefer in your template.

The function is the following


where number_of_posts is 3 by default. It returns an associative array with the following structure

$popular_posts[post_id]['image'] // post thumbnail image 
$popular_posts[post_id]['title'] // post title 
$popular_posts[post_id]['link'] // post link 
$popular_posts[post_id]['count'] // views count 


PHP.net random functions

This Chrome extension opens, in the current tab, a function from PHP.net.

This first release will draw one of the currently 991 functions available (PHP v5.5.5).
The functions list is taken from onlinephpfunctions.com.
I’ve created it on Chrome version 33.0.1750.117.

Sure, this is a specific extension totally based on my needs but It might be useful to publish to others to prepare the PHP certification or just to discover “new” PHP functions not so common but, often, really useful to know.

I’ve made a virtue of necessity..