StatCounter – Free Real Time Visitor Stats - Version 2.0

Version Description

StatCounter Tags supported.

Download this release

Release Info

Developer StatCounter
Plugin Icon StatCounter – Free Real Time Visitor Stats
Version 2.0
Comparing to
See all releases

Code changes from version 1.7.1 to 2.0

Files changed (2) hide show
  1. StatCounter-Wordpress-Plugin.php +16 -1
  2. readme.txt +5 -1
StatCounter-Wordpress-Plugin.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  * Plugin Name: Official StatCounter Plugin
4
- * Version: 1.7.1
5
  * Plugin URI: http://statcounter.com/
6
  * Description: Adds the StatCounter tracking code to your blog. <br>To get setup: 1) Activate this plugin 2) Enter your StatCounter Project ID and Security Code in the <a href="options-general.php?page=StatCounter-Wordpress-Plugin.php"><strong>options page</strong></a>.
7
  * Author: Aodhan Cullen
@@ -26,6 +26,7 @@ add_option("sc_invisible", "0");
26
  // Create a option page for settings
27
  add_action('admin_menu' , 'add_sc_option_page' );
28
  add_action( 'admin_menu', 'statcounter_admin_menu' );
 
29
 
30
  function statcounter_admin_menu() {
31
  $hook = add_submenu_page('index.php', __('StatCounter Stats'), __('StatCounter Stats'), 'publish_posts', 'statcounter', 'statcounter_reports_page');
@@ -240,4 +241,18 @@ document.write("<sc"+"ript src='" +scJsHost +"statcounter.com/counter/counter.js
240
  }
241
  }
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  ?>
1
  <?php
2
  /*
3
  * Plugin Name: Official StatCounter Plugin
4
+ * Version: 2.0
5
  * Plugin URI: http://statcounter.com/
6
  * Description: Adds the StatCounter tracking code to your blog. <br>To get setup: 1) Activate this plugin 2) Enter your StatCounter Project ID and Security Code in the <a href="options-general.php?page=StatCounter-Wordpress-Plugin.php"><strong>options page</strong></a>.
7
  * Author: Aodhan Cullen
26
  // Create a option page for settings
27
  add_action('admin_menu' , 'add_sc_option_page' );
28
  add_action( 'admin_menu', 'statcounter_admin_menu' );
29
+ add_action('wp_head', 'addToTags');
30
 
31
  function statcounter_admin_menu() {
32
  $hook = add_submenu_page('index.php', __('StatCounter Stats'), __('StatCounter Stats'), 'publish_posts', 'statcounter', 'statcounter_reports_page');
241
  }
242
  }
243
 
244
+ function addToTags($pid){
245
+ if (is_single()) {
246
+ global $post;
247
+ $queried_post = get_post($pid);
248
+ $authorId = $queried_post->post_author;
249
+ ?>
250
+ <script type="text/javascript">
251
+ var _statcounter = _statcounter || [];
252
+ _statcounter.push({"tags": {"author": "<?php the_author_meta( 'nickname', $authorId); ?>"}});
253
+ </script>
254
+ <?php
255
+ }
256
+ }
257
+
258
  ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://statcounter.com/
4
  Tags: web, statistics, stats, hit, counter, visitor, ip, tracker, analytics
5
  Requires at least: 2.0.2
6
  Tested up to: 4.3
7
- Stable tag: 1.7.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -70,6 +70,9 @@ To activate the StatCounter service for your WordPress site:
70
 
71
  == Changelog ==
72
 
 
 
 
73
  = 1.7.1 =
74
  Removed unnecessary type attribute from script element
75
 
@@ -148,3 +151,4 @@ Bug fix to prevent user entry of whitespace characters for Project ID and Securi
148
  = 1.6.2 =
149
  Upgrade to allow for fully functioning PayPal upgrade options.
150
 
 
4
  Tags: web, statistics, stats, hit, counter, visitor, ip, tracker, analytics
5
  Requires at least: 2.0.2
6
  Tested up to: 4.3
7
+ Stable tag: 2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
70
 
71
  == Changelog ==
72
 
73
+ = 2.0 =
74
+ StatCounter Tags supported.
75
+
76
  = 1.7.1 =
77
  Removed unnecessary type attribute from script element
78
 
151
  = 1.6.2 =
152
  Upgrade to allow for fully functioning PayPal upgrade options.
153
 
154
+