=== WordPress Stats View Counter === Contributors: AdamCapriola Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHHK2RKRY4JFA Tags: views, counter, stats Requires at least: 3.0 Tested up to: 3.5 Stable tag: 1.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Saves view counts from WordPress.com Stats Jetpack module as post meta data. == Description == Saves view counts from WordPress.com Stats [Jetpack](http://wordpress.org/extend/plugins/jetpack/) module (or WordPress.com Stats [plugin](http://wordpress.org/extend/plugins/stats/)) as post meta data. This can be useful for displaying view counts in your theme and building [custom queries](http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters). What makes this a better solution over other plugins that track views is that it simply pulls the data from WordPress.com Stats which is fairly accurate and already used on many sites, so this has very little overhead. It's a streamlined plugin that piggybacks off another which you might already be using. Comes with a shortcode to display views and filter to change the post meta key where views are saved. == Installation == 1. Upload `wordpress-stats-view-counter` to the `/wp-content/plugins/` directory. 1. Activate the plugin through the *Plugins* menu in WordPress. 1. Go to Settings > View Counter to select post types to track. 1. Use shortcode `[view-count]` or `get_post_meta( $post->ID, 'views', true );` to display views. == Frequently Asked Questions == = What post meta key is used? = By default `views` is the key where the view counts are saved, but you can filter this with the filter `view_counter_meta_key`. So for example, if you wanted to change the meta key from `views` to `my-key`, you would use this in your function.php file: `add_filter( 'view_counter_meta_key', 'my_view_counter_meta_key', 10, 1 ); function my_view_counter_meta_key( $key ) { return 'my-key'; }` The plugin will check to make sure the new view count is greater than the old one before replacing, so there is some fallback to prevent it from overwriting previously saved views from other plugins also using the `views` post meta key. = How do I display the views? = Either using `get_post_meta( $post->ID, 'views', true );` or the shortcode `[view-count]`. `[view-count]` can accept before and after parameters, like so: `[view-count before="Views: "]` or `[view-count after=" views"]` = How often does it update the views? = Every 3 hours an entry is accessed, the plugin will check the WordPress.com Stats view count and update locally. The delay is to ensure we don't overload the WordPress.com Stats API. This will be unnoticeable to the average visitor because it's unlikely they are sitting on your site waiting for the views to update, like you might be. Unless you have an extremely active site, there isn't really much reason for the check to be more frequent. == Screenshots == 1. Settings == Changelog == = Version 1.0 = * This is version 1.0. Everything's new! == Upgrade Notice == = Version 1.0 = * This is version 1.0. Everything's new!