{"id":16582,"date":"2012-01-24T07:29:39","date_gmt":"2012-01-24T07:29:39","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-most-popular\/"},"modified":"2018-08-07T11:57:22","modified_gmt":"2018-08-07T11:57:22","slug":"wp-most-popular","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/wp-most-popular\/","author":214953,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.3.1","stable_tag":"0.3.1","tested":"4.9.29","requires":"3.0","requires_php":"5.2.4","requires_plugins":"","header_name":"WP Most Popular","header_author":"WP Geeks","header_description":"","assets_banners_color":"ebf3a7","last_updated":"2018-08-07 11:57:22","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wpgeeks.com\/product\/wp-most-popular\/","header_author_uri":"http:\/\/wpgeeks.com","rating":4.9,"author_block_rating":0,"active_installs":2000,"downloads":81018,"num_ratings":11,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":"1","5":"10"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1861383","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1861383","resolution":"256x256","location":"assets"},"icon.svg":{"filename":"icon.svg","revision":"1861383","resolution":"","location":"assets"}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"1920990","resolution":"1544x500","location":"assets"},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1920990","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1","0.2","0.3","0.3.1"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[15940,20340,4132,1086,15300],"plugin_category":[],"plugin_contributors":[79573,160216],"plugin_business_model":[],"class_list":["post-16582","plugin","type-plugin","status-publish","hentry","plugin_tags-most-viewed-posts","plugin_tags-most-viewed","plugin_tags-popular","plugin_tags-popular-posts","plugin_tags-popular-posts-widget","plugin_contributors-mattgeri","plugin_contributors-wearewpgeeks","plugin_committers-mattgeri"],"banners":{"banner":"https:\/\/ps.w.org\/wp-most-popular\/assets\/banner-772x250.png?rev=1920990","banner_2x":"https:\/\/ps.w.org\/wp-most-popular\/assets\/banner-1544x500.png?rev=1920990","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/wp-most-popular\/assets\/icon.svg?rev=1861383","icon":"https:\/\/ps.w.org\/wp-most-popular\/assets\/icon.svg?rev=1861383","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>WP Most Popular was born out of frustration in finding a decent plugin which performs one simple task and that is to rank your most popular blog posts.<\/p>\n\n<p>The plugin keeps a log of your most popular posts based on views and lets you display them in your blog theme with custom styling. You can display popular posts from the last day, 7 days, 30 days or all time.<\/p>\n\n<p>It also comes with a sidebar widget to let you display your popular posts on your blogs sidebar.<\/p>\n\n<p>If you are a developer and integrate the plugin in to a theme, you will get a lot more flexibility out of the plugin including the ability to show the most popular custom post types etc.<\/p>\n\n<p>This plugin was built and is maintained by <a href=\"https:\/\/wpgeeks.com\">WP Geeks<\/a>. For extra documentation, videos, snippets and support, visit the <a href=\"https:\/\/wpgeeks.com\/product\/wp-most-popular\/\">WP Most Popular<\/a> product page.<\/p>\n\n<h3>Usage<\/h3>\n\n<p>There are two ways in which you can use this plugin.<\/p>\n\n<ol>\n<li>As a sidebar widget<\/li>\n<li>Custom function in your theme files<\/li>\n<\/ol>\n\n<p>Using the widget is the easiest way and recommended for most users. If you are a developer and want to integrate the plugin in to your existing theme, then read the information below.<\/p>\n\n<p>Firstly, the main function which you will need to include in your theme to fetch the popular posts is called <code>wp_most_popular_get_popular()<\/code>.<\/p>\n\n<p>You can pass that function the following parameters in array form:<\/p>\n\n<ul>\n<li><strong>limit<\/strong> (integer)\n\n<ul>\n<li>The number of posts you would like to display i.e. 5<\/li>\n<li>Default: 5<\/li>\n<\/ul><\/li>\n<li><strong>post_type<\/strong> (string) \/ (array)\n\n<ul>\n<li>The post type you would like to display<\/li>\n<li>Example: post<\/li>\n<li>Default: All post types<\/li>\n<\/ul><\/li>\n<li><strong>range<\/strong> (string)\n\n<ul>\n<li>In what date range would you like to display popular posts in<\/li>\n<li>Accepted: all_time, monthly, weekly, daily<\/li>\n<li>Default: all_time<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<p>Those are the current parameters that the plugin supports. Let's look at an example of how to display the most recent popular posts in a unordered list.<\/p>\n\n<pre><code>&lt;?php\necho '&lt;ul&gt;';\n$posts = wp_most_popular_get_popular( array( 'limit' =&gt; 10, 'post_type' =&gt; 'post', 'range' =&gt; 'all_time' ) );\nglobal $post;\nif ( count( $posts ) &gt; 0 ): foreach ( $posts as $post ):\n    setup_postdata( $post );\n    ?&gt;\n    &lt;li&gt;&lt;a href=\"&lt;?php the_permalink() ?&gt;\" title=\"&lt;?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?&gt;\"&gt;&lt;?php if ( get_the_title() ) the_title(); else the_ID(); ?&gt;&lt;\/a&gt;&lt;\/li&gt;\n    &lt;?php\nendforeach; endif;\necho '&lt;\/ul&gt;';\n?&gt;\n<\/code><\/pre>\n\n<h4>Filters<\/h4>\n\n<p>The following filters are available to you:<\/p>\n\n<ul>\n<li><strong>wp_most_popular_list_before<\/strong> - used to filter the <\/li>\n<\/ul>\n\n<ul> element of the outputted widget list\n* **wp_most_popular_list_after** - used to filter the <\/ul>\n\n<p>element of the outputted widget list\n* <strong>wp_most_popular_list_item_single<\/strong> - filters for a the list item generated by the widget<\/p>\n\n<h4>Actions<\/h4>\n\n<ul>\n<li><strong>wp_most_popular_list_item<\/strong> - used for modifying the list output<\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>Setting up WP Most Popular is very simple. Follow these easy steps<\/p>\n\n<ol>\n<li>Upload the plugin to your <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin in your WordPress admin<\/li>\n<li>Add sidebar widget or integrate functions in to your theme<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><p>Setting up WP Most Popular is very simple. Follow these easy steps<\/p>\n\n<ol>\n<li>Upload the plugin to your <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin in your WordPress admin<\/li>\n<li>Add sidebar widget or integrate functions in to your theme<\/li>\n<\/ol><\/dd>\n<dt>Why are no posts displaying when I use the widget or call the function in my theme?<\/dt>\n<dd><p>99% of the time this is because no posts have been visited yet to receive a ranking. Simply click on a blog post to read it on your blog and it will receive a ranking and display in the list of most popular posts.<\/p><\/dd>\n<dt>What are the minimum requirements for the plugin?<\/dt>\n<dd><p>You will need a web server or shared host that supports PHP version 5 or newer. Javascript is also required to log post views.<\/p><\/dd>\n<dt>Why does the plugin use Javascript to track the post views?<\/dt>\n<dd><p>The original version of the plugin that I wrote used PHP to track the post views and the reason why I switched to Javascript was because if a caching plugin is enabled on your blog, the page will be loaded statically to your visitor and the PHP code to log a view on a post will not be run.<\/p><\/dd>\n<dt>Can I request a feature?<\/dt>\n<dd><p>Yes, please do so on the WordPress support forum for the plugin. I will consider it and if I feel it is worth adding, I will schedule it for a future release.<\/p><\/dd>\n<dt>Can I contribute code to the plugin?<\/dt>\n<dd><p>Yes! The plugin is open source and I host it on <a href=\"https:\/\/github.com\/wpgeeks\/WP-Most-Popular\">Github<\/a>. Feel free to send me pull requests.<\/p><\/dd>\n<dt>Where can I get support for the plugin?<\/dt>\n<dd><p>This plugin is managed by WP Geeks and you can contact our support team on our <a href=\"https:\/\/wpgeeks.com\">website<\/a>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.3.1<\/h4>\n\n<ul>\n<li>Fixed a bug where the old function <code>wmp_get_popular<\/code> was no longer working as it should for backwards compatibility<\/li>\n<\/ul>\n\n<h4>0.3<\/h4>\n\n<ul>\n<li>New helper function name for getting the most popular posts <code>wp_most_popular_get_popular<\/code>. Please note that the old function name is still supported <code>wmp_get_popular<\/code><\/li>\n<li>New filters and action introduced for use on widget (wp_most_popular_list_before, wp_most_popular_list_after, wp_most_popular_list_item, wp_most_popular_list_item_single) (thanks to <a href=\"https:\/\/github.com\/sanchothefat\">sanchothefat<\/a> and <a href=\"https:\/\/github.com\/callerc1\">callerc1<\/a>)<\/li>\n<li>Widget now supports thumbnails (thanks to <a href=\"https:\/\/github.com\/eduardo-marcolino\">eduardo-marcolino<\/a>)<\/li>\n<li>Added a CSS class name to the widget list (thanks to <a href=\"https:\/\/github.com\/sinisterstuf\">sinisterstuf<\/a>)<\/li>\n<li>Fixed a bug where the plugin was using a deprecated function (since version 4.3) to setup the widget<\/li>\n<\/ul>\n\n<h4>0.2<\/h4>\n\n<ul>\n<li>Added the ability to query multiple different post types (thanks <a href=\"https:\/\/github.com\/inc2734\">inc2734<\/a>)<\/li>\n<li>You can now also choose a specific post type from the widget<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>First version of the plugin released<\/li>\n<\/ul>","raw_excerpt":"WP Most Popular is a simple plugin which tracks your most popular blog posts based on views and lets you display them in your theme or blog sidebar.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/16582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=16582"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mattgeri"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=16582"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=16582"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=16582"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=16582"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=16582"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=16582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}