{"id":52637,"date":"2016-12-11T12:35:48","date_gmt":"2016-12-11T12:35:48","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/dexs-counter\/"},"modified":"2016-12-15T01:36:01","modified_gmt":"2016-12-15T01:36:01","slug":"dexs-counter","status":"publish","type":"plugin","link":"https:\/\/szl.wordpress.org\/plugins\/dexs-counter\/","author":11169157,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.1.3","stable_tag":"0.1.3","tested":"4.7.33","requires":"4.0","requires_php":"","requires_plugins":"","header_name":"Dexs.Counter","header_author":"SamBrishes@pytesNET","header_description":"","assets_banners_color":"e14d43","last_updated":"2016-12-15 01:36:01","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/www.wordpress.org\/plugins\/dexs-counter","header_author_uri":"http:\/\/www.pytes.net","rating":0,"author_block_rating":0,"active_installs":10,"downloads":1567,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"":"<p>None<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1555071","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1555071","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"1555071","resolution":"1544x500","location":"assets"},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1555071","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.0","0.1.1","0.1.2","0.1.3"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1555071","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1555071","resolution":"2","location":"assets"}},"screenshots":{"1":"The settings page.","2":"The dashboard widget."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[442,869,2295,1937,872],"plugin_category":[36,53],"plugin_contributors":[91724],"plugin_business_model":[],"class_list":["post-52637","plugin","type-plugin","status-publish","hentry","plugin_tags-count","plugin_tags-counter","plugin_tags-rating","plugin_tags-view","plugin_tags-views","plugin_category-analytics","plugin_category-ratings-and-reviews","plugin_contributors-sambrishes"],"banners":{"banner":"https:\/\/ps.w.org\/dexs-counter\/assets\/banner-772x250.png?rev=1555071","banner_2x":"https:\/\/ps.w.org\/dexs-counter\/assets\/banner-1544x500.png?rev=1555071","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/dexs-counter\/assets\/icon-128x128.png?rev=1555071","icon_2x":"https:\/\/ps.w.org\/dexs-counter\/assets\/icon-256x256.png?rev=1555071","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/dexs-counter\/assets\/screenshot-1.png?rev=1555071","caption":"The settings page."},{"src":"https:\/\/ps.w.org\/dexs-counter\/assets\/screenshot-2.png?rev=1555071","caption":"The dashboard widget."}],"raw_content":"<!--section=description-->\n<p>The Dexs.Counter plugin detects each (unique) view and stores the collected data into the own \ndatabase table as well as own post_meta, which can be used to configure WP_Query loops depending on \nthe counter. This informations are already used in the 2 frontend and in the small dashboard widget. \nThe plugin contains also an extended statistic, which shows the daily views (of all posts) as \ndiagram within the dashboard widget. Last but not Least: The plugin offers also a small rating system.<\/p>\n\n<h4>Alpha<\/h4>\n\n<p>This plugin is still Alpha and will be expanded in the future. However, it should not contain \ncritical bugs, but if you found one or if you even have general suggestions for improvement then \nwrite us on our <a href=\"http:\/\/wordpress.org\/support\/plugin\/dexs-counter\">WordPress Plugin Support Page<\/a>.<\/p>\n\n<p>Thank You!<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>Post Types: En\/Disable the view and rating counter on each single (costum) post type.<\/li>\n<li>Exclude Roles: In\/Exclude user roles from the view- and rating system.<\/li>\n<li>Rating Layout: Choose between a single (Like), double (Like, Dislike), 3-level and 5-level rating layout.<\/li>\n<li>Frontend Widgets: 2 Frontend widgets which allows you to display post lists depending on the view and rate counter.<\/li>\n<li>Extended Statistics: Logs each day-counter and displays this informations within the dashboard widget.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>dexs-counter<\/code> folder to your <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Configure the plugin through the own 'Dexs Counter' Admin Page.<\/li>\n<li>Use It and rate our plugin on the official <a href=\"http:\/\/plugins.wordpress.org\/dexs-counter\">WordPress Plugin Directory<\/a> ;3!<\/li>\n<\/ol>\n\n<!--section=faq-->\n<p>You can use the dexs counter environment easily within your own WordPress theme. This is useful, if \nyou want to adapt the dexs counter design seamless to your theme. Please Note: You should always \ncheck, if the respective function exists with the php <code>function_exists(function_name)<\/code> method!<\/p>\n<dl>\n<dt>dexs_cr_get_views ($post_id, $type)<\/dt>\n<dd><p>Get one of the four view counter numbers for the respective post.<\/p>\n\n<p><strong>Parameters<\/strong><\/p>\n\n<ul>\n<li><strong>$post_id<\/strong> <em>(Required)<\/em><br \/>\nThe respective post id. Use the <code>get_the_ID()<\/code> WordPress function within a loop. <\/li>\n<li><strong>$type<\/strong> <em>(Optional)<\/em><br \/>\nSet the view counter type by using one of the following strings<\/li>\n<li>\n<ul>\n<li><code>\"total\"<\/code> returns all registered clicks. (Default)<\/li>\n<\/ul><\/li>\n<li>\n<ul>\n<li><code>\"daily\"<\/code> returns all registered clicks for the current day.<\/li>\n<\/ul><\/li>\n<li>\n<ul>\n<li><code>\"unique\"<\/code> returns all unique clicks (one click \/ user).<\/li>\n<\/ul><\/li>\n<li>\n<ul>\n<li><code>\"daily_unique\"<\/code> returns all unique clicks (one click \/ user) for the current day. <\/li>\n<\/ul><\/li>\n<\/ul>\n\n<p><strong>Return Values<\/strong><\/p>\n\n<p>Returns the view counter number as <strong>integer<\/strong> or <strong>false<\/strong> if the $post_id parameter in invalid.<\/p><\/dd>\n<dt>dexs_cr_has_viewed ($post_id)<\/dt>\n<dd><p>Checks if the current user has already clicked on the respective post.<\/p>\n\n<p><strong>Parameters<\/strong><\/p>\n\n<ul>\n<li><strong>$post_id<\/strong> <em>(Required)<\/em><br \/>\nThe respective post id. Use the <code>get_the_ID()<\/code> WordPress function within a loop. <\/li>\n<\/ul>\n\n<p><strong>Return Values<\/strong><\/p>\n\n<p>Returns <strong>true<\/strong> if the user has already clicked on the post, and <strong>false<\/strong> if not or if the \n$post_id parameter is invalid!<\/p><\/dd>\n<dt>dexs_cr_get_rating ($post_id)<\/dt>\n<dd><p>Get the rating data for the respective post.<\/p>\n\n<p><strong>Parameters<\/strong><\/p>\n\n<ul>\n<li><strong>$post_id<\/strong> <em>(Required)<\/em><br \/>\nThe respective post id. Use the <code>get_the_ID()<\/code> WordPress function within a loop. <\/li>\n<\/ul>\n\n<p><strong>Return Values<\/strong><\/p>\n\n<p>Returns an <strong>array<\/strong> with the rating data or <strong>false<\/strong> on failure. Note: The rating data (or rather \nthe array keys) depends on your rating layout setting (see below), but the values are always \n<strong>integers<\/strong> an represents the number of ratings \/ clicks on the respective rating value.<\/p>\n\n<ul>\n<li>On <strong>\"Single\"<\/strong>: <code>array(\"like\" =&gt; [int])<\/code><\/li>\n<li>On <strong>\"Double\"<\/strong>: <code>array(\"like\" =&gt; [int], \"dislike\" =&gt; [int])<\/code><\/li>\n<li>On <strong>\"3-Level\"<\/strong>: <code>array(\"1\" =&gt; [int], \"2\" =&gt; [int], \"3\" =&gt; [int])<\/code><\/li>\n<li>On <strong>\"5-Level\"<\/strong>: <code>array(\"1\" =&gt; [int], \"2\" =&gt; [int], \"3\" =&gt; [int], \"4\" =&gt; [int], \"5\" =&gt; [int])<\/code><\/li>\n<\/ul><\/dd>\n<dt>dexs_cr_has_rated ($post_id, $value)<\/dt>\n<dd><p>Checks if the current user has already rated yet and returns perhaps his rating value.<\/p>\n\n<p><strong>Parameters<\/strong><\/p>\n\n<ul>\n<li><strong>$post_id<\/strong> <em>(Required)<\/em><br \/>\nThe respective post id. Use the <code>get_the_ID()<\/code> WordPress function within a loop. <\/li>\n<li><strong>$value<\/strong> <em>(Optional)<\/em><br \/>\nChange the returning value:<\/li>\n<li>\n<ul>\n<li><code>false<\/code> checks only if the user has already rated. (Default)<\/li>\n<\/ul><\/li>\n<li>\n<ul>\n<li><code>true<\/code> checks if the user has already rated and returns the rate value. <\/li>\n<\/ul><\/li>\n<\/ul>\n\n<p><strong>Return Values<\/strong><\/p>\n\n<pre><code>($value == false):&lt;br \/&gt;\n<\/code><\/pre>\n\n<p>Returns <strong>true<\/strong> if the user has already rated yet or <strong>false<\/strong> if not or if the $post_id is invalid. \nNote: Returns <strong>NULL<\/strong> if the current user is within an excluded role!<\/p>\n\n<pre><code>($value == true):&lt;br \/&gt;\n<\/code><\/pre>\n\n<p>Returns the respective rating value as <strong>string<\/strong> or an empty <strong>string<\/strong> if the current user hasn't \nrated yet. Note: Returns <strong>false<\/strong> if the $post_id is invalid and <strong>NULL<\/strong> if the current user is \nwithin an excluded role<\/p><\/dd>\n<dt>dexs_cr_rating_link ($post_id, $value)<\/dt>\n<dd><p><strong>Parameters<\/strong>\nCreates one or more rating links with an WordPress nonce. Example: \nhttp:\/\/www.example.com\/post_permalink\/?dexs-nonce=<em>nonce<\/em>&amp;dexs=rating_value<\/p>\n\n<ul>\n<li><strong>$post_id<\/strong> <em>(Required)<\/em><br \/>\nThe respective post id. Use the <code>get_the_ID()<\/code> WordPress function within a loop. <\/li>\n<li><strong>$value<\/strong> <em>(Optional)<\/em><br \/>\nConfigure the returning value:<\/li>\n<li>\n<ul>\n<li><code>NULL<\/code> all rating values, depending on the rating layout. (Default)<\/li>\n<\/ul><\/li>\n<li>\n<ul>\n<li><code>*value*<\/code> checks if the user has already rated and returns the rate value. <\/li>\n<\/ul><\/li>\n<\/ul>\n\n<p><strong>Return Values<\/strong><\/p>\n\n<pre><code>($value == NULL):&lt;br \/&gt;\n<\/code><\/pre>\n\n<p>Returns all rating links as <strong>array<\/strong> or **false* on failure. Note: The array keys are the \nrespective rating values, depending on the rating layout setting!<\/p>\n\n<pre><code>($value == value):&lt;br \/&gt;\n<\/code><\/pre>\n\n<p>Returns the respective rating link as <strong>string<\/strong> or <strong>false<\/strong> on failure. Note: Returns also false \nif the given value doesn't match to the rating layout setting!<\/p><\/dd>\n<dt>WP_Query<\/dt>\n<dd><p>You can use the following settings to change the post order, of your costum WP_Query requests, \ndepending to view counter OR rating counter. Note: You may return an empty post list, if you use the \ndaily or daily_unique counter and if nobody has viewed a single post item on the day yet. Note also: \nThe Dexs.Counter plugin doesn't automatically add the counter meta data to all of your posts. So \neach post that havn't been clicked \/ rated yet are therefore not considered!<\/p>\n\n<pre><code>&amp;lt;?php\n    \/\/ The Most-Viewed Posts (Total)\n    $query = array(\n        \"order\"     =&gt; \"DESC\",\n        \"orderby\"   =&gt; \"meta_value_num\",\n        \"meta_key\"  =&gt; \"dexs_views_total\"\n    );\n    $posts = new WP_Query($query);\n\n    \/\/ The Most-Viewed Posts (Unique)\n    $query = array(\n        \"order\"     =&gt; \"DESC\",\n        \"orderby\"   =&gt; \"meta_value_num\",\n        \"meta_key\"  =&gt; \"dexs_views_unique\"\n    );\n    $posts = new WP_Query($query);\n\n    \/\/ The Most-Viewed Posts (Total \/ Today)\n    $query = array(\n        \"order\"     =&gt; \"DESC\",\n        \"orderby\"   =&gt; \"meta_value_num\",\n        \"meta_key\"  =&gt; \"dexs_views_today\"\n    );\n    $posts = new WP_Query($query);\n\n    \/\/ The Most-Viewed Posts (Unique \/ Today)\n    $query = array(\n        \"order\"     =&gt; \"DESC\",\n        \"orderby\"   =&gt; \"meta_value_num\",\n        \"meta_key\"  =&gt; \"dexs_views_today_unique\"\n    );\n    $posts = new WP_Query($query);\n\n    \/\/ The Best-Rated Posts\n    $query = array(\n        \"order\"     =&gt; \"DESC\",\n        \"orderby\"   =&gt; \"meta_value_num\",\n        \"meta_key\"  =&gt; \"dexs_ratings\"\n    );\n    $posts = new WP_Query($query);\n\n    \/\/ The Worst-Rated Posts\n    $query = array(\n        \"order\"     =&gt; \"ASC\",\n        \"orderby\"   =&gt; \"meta_value_num\",\n        \"meta_key\"  =&gt; \"dexs_ratings\"\n    );\n    $posts = new WP_Query($query);\n\n    \/\/ The Most-Rated Posts\n    $query = array(\n        \"order\"     =&gt; \"DESC\",\n        \"orderby\"   =&gt; \"meta_value_num\",\n        \"meta_key\"  =&gt; \"dexs_ratings_num\"\n    );\n    $posts = new WP_Query($query);\n\n    \/\/ The Fewest-Rated Posts\n    $query = array(\n        \"order\"     =&gt; \"ASC\",\n        \"orderby\"   =&gt; \"meta_value_num\",\n        \"meta_key\"  =&gt; \"dexs_ratings_num\"\n    );\n    $posts = new WP_Query($query);\n?&amp;gt;\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>Version 0.1.3 (Alpha)<\/h4>\n\n<ul>\n<li>[FIX] Error on an empty counter diagram within the dashboard widget.<\/li>\n<\/ul>\n\n<h4>Version 0.1.2 (Alpha)<\/h4>\n\n<ul>\n<li>[UPD] The design and data within the counter diagram.<\/li>\n<li>[FIX] The counter diagram datasets had the wrong direction.<\/li>\n<\/ul>\n\n<h4>Version 0.1.1 (Alpha)<\/h4>\n\n<ul>\n<li>[ADD] Trivial \"Humanity Test\" for the view counter.<\/li>\n<li>[ADD] The <code>dexs-counter-verify<\/code> option as part of the new \"Humanity Test\".<\/li>\n<li>[FIX] The <code>_ip()<\/code> function has hashed the wrong value.<\/li>\n<\/ul>\n\n<h4>Version 0.1.0 (Alpha)<\/h4>\n\n<ul>\n<li>First Release<\/li>\n<\/ul>","raw_excerpt":"A simple but powerful view counter and rating system, with own (dashboard) widgets, for your awesome WordPress website.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/52637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=52637"}],"author":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/sambrishes"}],"wp:attachment":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=52637"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=52637"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=52637"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=52637"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=52637"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=52637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}