{"id":101784,"date":"2019-04-18T03:38:36","date_gmt":"2019-04-18T03:38:36","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/piggly-views\/"},"modified":"2019-05-15T06:51:43","modified_gmt":"2019-05-15T06:51:43","slug":"piggly-views","status":"closed","type":"plugin","link":"https:\/\/de.wordpress.org\/plugins\/piggly-views\/","author":17054815,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.1.1","stable_tag":"1.1.1","tested":"4.9.29","requires":"4.1","requires_php":"5.2.4","requires_plugins":"","header_name":"Piggly Views","header_author":"Piggly DEV","header_description":"An easy way to track post views and get most reads posts by a range of date.","assets_banners_color":"ffffff","last_updated":"2019-05-15 06:51:43","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/dev.piggly.com.br\/","header_plugin_uri":"https:\/\/dev.piggly.com.br\/opensource\/piggly-views","header_author_uri":"https:\/\/dev.piggly.com.br\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":684,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":[],"assets_icons":{"icon.svg":{"filename":"icon.svg","revision":"2070368","resolution":"","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"2070368","resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"2070368","resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1","1.1.0","1.1.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"2070874","resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"2070368","resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"2070368","resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"Piggly View settings.","2":"Piggly View in Post Table Column.","3":"Piggly View setting in Post Page."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[170361,550,872],"plugin_category":[36],"plugin_contributors":[170362],"plugin_business_model":[],"class_list":["post-101784","plugin","type-plugin","status-closed","hentry","plugin_tags-piggly","plugin_tags-tracking","plugin_tags-views","plugin_category-analytics","plugin_contributors-pigglydev","plugin_committers-pigglydev"],"banners":[],"icons":{"svg":"https:\/\/ps.w.org\/piggly-views\/assets\/icon.svg?rev=2070368","icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/piggly-views_ffffff.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/piggly-views\/assets\/screenshot-1.png?rev=2070874","caption":"Piggly View settings."},{"src":"https:\/\/ps.w.org\/piggly-views\/assets\/screenshot-2.png?rev=2070368","caption":"Piggly View in Post Table Column."},{"src":"https:\/\/ps.w.org\/piggly-views\/assets\/screenshot-3.png?rev=2070368","caption":"Piggly View setting in Post Page."}],"raw_content":"<!--section=description-->\n<p>The plugin is quite simple to use. See below.<\/p>\n\n<ol>\n<li>It will store all views for a Single Post. You can configure it to ignore views to logged users and disable for some posts.<\/li>\n<li>In the Posts View Table you will see the View column. You can remove it in configurations.<\/li>\n<li>All views will be cached for 24 hours. You can disabled it or change the flush cache hour.<\/li>\n<\/ol>\n\n<p>For now, Piggly Views is available in:<\/p>\n\n<ul>\n<li>English,<\/li>\n<li>Portuguese Brazilian.<\/li>\n<\/ul>\n\n<h3>Some additional resources<\/h3>\n\n<ul>\n<li>You can use the shortcode <code>[piggly_views]<\/code> to get views to the current post OR use <code>[piggly_views id=\"post_id\"]<\/code> to a specific post. It will return the number of views following the format set in the settings.<\/li>\n<li>You can get a collection of most viewed posts by using the method <code>piggly_view_collection($limit,$days)<\/code>. Where <code>$days<\/code> is the range between NOW and X(<code>$days<\/code>) days, <code>$limit<\/code> is the number of posts  and <code>$types<\/code> is one or more post types slug into an array, such as: <code>post<\/code>, <code>page<\/code> or <code>attachment<\/code>.<\/li>\n<li>You can use the shortcode <code>[piggly_views_collection limit=\"X\" days=\"X\" types=\"post, page, attachment\"]<\/code> to get a collection of most viewed posts returning the default template.<\/li>\n<\/ul>\n\n<h3>Getting the most viewed posts<\/h3>\n\n<p>An easy way to get the most viewed posts is using the global function <code>piggly_view_collection()<\/code>. The default <code>$days<\/code> values is 30, default <code>$limit<\/code> value is 5 and default <code>$types<\/code> array is post.<\/p>\n\n<blockquote>\n  <p>\/\/ 10 most viewed posts in the last 180 days.\n  $most_viewed = piggly_view_collection( 10, 180 );<\/p>\n  \n  <p>if ( !empty( $most_viewed ) ) :\n      foreach ( $most_viewed as $post ) :\n          $postID = $post-&gt;post_id;\n     endforeach;\n  endif;<\/p>\n<\/blockquote>\n\n<p>In the other side, you can use the shortcode <code>[piggly_views_collection limit=\"10\" days=\"180\" types=\"post\"]<\/code> to return the default template.<\/p>\n\n<p>When you use <code>[piggly_views_collection]<\/code> shortcode, it will return the following template for each post. Customize CSS as your needs by using <code>.pgl-views-post<\/code> as parent.<\/p>\n\n<blockquote>\n  <p><a href=\"{{link}}\" title=\"{{title}}\" rel=\"bookmark\"><\/a><\/p>\n<\/blockquote>\n\n\n&gt;       \n&gt;   \n\n<blockquote>\n  <p><\/p>\n<\/blockquote>\n\n\n&gt;       <h3>{{title}}<\/h3>\n&gt;       \n&gt;           {{category}}\n&gt;           {{author}}\n&gt;           {{date}}\n&gt;       \n&gt;   \n\n<blockquote>\n  <p><\/p>\n<\/blockquote>\n\n<h3>How to Use<\/h3>\n\n<p>From your WordPress administration panel go to <code>Plugins &gt; Installed Plugins<\/code> and scroll down until you find <code>Piggly Views<\/code>. You will need to activate it first, then click on <code>Settings<\/code> to configure it.<\/p>\n\n<h4>Configuration<\/h4>\n\n<ul>\n<li>Display or not View Column in Post Table.<\/li>\n<li>Disable tracking for Logged Users.<\/li>\n<li>Convert Views from 1000 to 1K format.<\/li>\n<li>Cache Views Data.<\/li>\n<li><p>Flush cache after X hours.<\/p><\/li>\n<li><p>Keep options and\/or table when uninstall the plugin.<\/p><\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>This section describes how to install the plugin and get it working.<\/p>\n\n<p>e.g.<\/p>\n\n<ol>\n<li>You can either install this plugin from the WordPress Plugin Directory, or manually  <a href=\"https:\/\/github.com\/piggly-dev\/piggly-views-wordpress\/releases\">download the plugin<\/a> and upload it through the 'Plugins &gt; Add New' menu in WordPress<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>How much does this cost?<\/dt>\n<dd><p>Nothing. This plugin is completely free.\nFurthermore, this plugin are open source (free as in \"freedom\").<\/p><\/dd>\n<dt>What is Piggly Views?<\/dt>\n<dd><p>It's a easy way to tracking views for a post. It is useful to have another more tracking method and to get the most viewed posts.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.1.1<\/h4>\n\n<p>Removed the jQuery dependence for the JS code loaded when WP_CACHE is active.\nAnd added wp_register_script to make things better.<\/p>\n\n<h4>1.1.0<\/h4>\n\n<p>Added the shortcode <code>[piggly_views_collection]<\/code> to return a collection based in a default template.<\/p>\n\n<h4>1.0.1<\/h4>\n\n<p>Now you can select one or more post type when getting a collection with <code>piggly_views_colletion<\/code>.<\/p>\n\n<h4>1.0.0<\/h4>\n\n<p>Initial release.<\/p>","raw_excerpt":"The Piggly Views WordPress Plugin allows you to track views for each post. Once you install, Wordpress will be able to store views in database table.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/101784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=101784"}],"author":[{"embeddable":true,"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/pigglydev"}],"wp:attachment":[{"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=101784"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=101784"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=101784"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=101784"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=101784"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/de.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=101784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}