Version Description
- Removed the 'Logging Enabled/Disabled' option (you can deactivate the plugin instead). Updated installation instructions.
Download this release
Release Info
Developer | StatCounter |
Plugin | StatCounter – Free Real Time Visitor Stats |
Version | 1.6 |
Comparing to | |
See all releases |
Code changes from version 1.5 to 1.6
- StatCounter-Wordpress-Plugin.php +21 -79
- readme.txt +39 -44
- screenshot-1.gif +0 -0
- screenshot-1.png +0 -0
- screenshot-2.jpg +0 -0
- screenshot-2.png +0 -0
StatCounter-Wordpress-Plugin.php
CHANGED
@@ -1,20 +1,15 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Official StatCounter Plugin
|
4 |
-
* Version: 1.
|
5 |
-
* Plugin URI: http://
|
6 |
-
* Description: Adds the StatCounter tracking code to your blog.
|
7 |
* Author: Aodhan Cullen
|
8 |
-
* Author URI: http://
|
9 |
*/
|
10 |
|
11 |
-
// Constants for enabled/disabled state
|
12 |
-
define("sc_enabled" , "enabled", true);
|
13 |
-
define("sc_disabled" , "disabled", true);
|
14 |
-
|
15 |
// Defaults, etc.
|
16 |
define("key_sc_project", "sc_project", true);
|
17 |
-
define("key_sc_status", "sc_status", true);
|
18 |
define("key_sc_position", "sc_position", true);
|
19 |
// legacy problem with sc_security naming
|
20 |
define("key_sc_security", "key_sc_security", true);
|
@@ -23,12 +18,9 @@ define("key_sc_security", "key_sc_security", true);
|
|
23 |
|
24 |
define("sc_project_default", "0" , true);
|
25 |
define("sc_security_default", "" , true);
|
26 |
-
define("sc_status_default", sc_disabled , true);
|
27 |
define("sc_position_default", "footer", true);
|
28 |
-
define("sc_admin_default", sc_enabled , true);
|
29 |
|
30 |
// Create the default key and status
|
31 |
-
add_option(key_sc_status, sc_status_default, 'If StatCounter logging in turned on or off.');
|
32 |
add_option(key_sc_project, sc_project_default, 'Your StatCounter Project ID.');
|
33 |
add_option(key_sc_security, sc_security_default, 'Your StatCounter Security String.');
|
34 |
add_option("sc_invisible", "0", 'Force invisibility.');
|
@@ -78,12 +70,6 @@ function sc_options_page() {
|
|
78 |
if ( isset( $_POST['info_update'] ) ) {
|
79 |
check_admin_referer();
|
80 |
|
81 |
-
// Update the status
|
82 |
-
$sc_status = $_POST[key_sc_status];
|
83 |
-
if (($sc_status != sc_enabled) && ($sc_status != sc_disabled))
|
84 |
-
$sc_status = sc_status_default;
|
85 |
-
update_option(key_sc_status, $sc_status);
|
86 |
-
|
87 |
// Update the Project ID
|
88 |
$sc_project = $_POST[key_sc_project];
|
89 |
if ($sc_project == '')
|
@@ -98,8 +84,9 @@ function sc_options_page() {
|
|
98 |
|
99 |
// Update the position
|
100 |
$sc_position = $_POST[key_sc_position];
|
101 |
-
if (($sc_position !=
|
102 |
-
$
|
|
|
103 |
update_option(key_sc_position, $sc_position);
|
104 |
|
105 |
// Force invisibility
|
@@ -119,62 +106,24 @@ function sc_options_page() {
|
|
119 |
|
120 |
<form method="post" action="options-general.php?page=StatCounter-Wordpress-Plugin.php">
|
121 |
<div class="wrap">
|
122 |
-
<?php if (
|
123 |
-
<div style="margin:10px auto; border:3px #f00 solid; background-color:#fdd; color:#000; padding:10px; text-align:center;">
|
124 |
-
StatCounter Wordpress Plugin is currently <strong>DISABLED</strong>.
|
125 |
-
</div>
|
126 |
-
<?php } ?>
|
127 |
-
<?php if ( ( get_option( key_sc_project ) == "0" ) && ( get_option( key_sc_status ) != sc_disabled ) ) { ?>
|
128 |
<div style="margin:10px auto; border:3px #f00 solid; background-color:#fdd; color:#000; padding:10px; text-align:center;">
|
129 |
-
StatCounter Plugin
|
130 |
-
echo ( get_option( key_sc_project ) == "0" ? "<li>No <strong>Project ID</strong> has been provided</li>" : "" );
|
131 |
-
?></ul><strong>Tracking will not occur</strong>.
|
132 |
</div>
|
133 |
<?php } ?>
|
134 |
<h2>Using StatCounter</h2>
|
135 |
-
<blockquote><a href="http://
|
136 |
-
<p>To activate the StatCounter service for your WordPress site:<
|
137 |
-
<li
|
138 |
-
<li>
|
139 |
-
|
140 |
-
<li>Click the "<strong>Configure & Install Code</strong>" button</li>
|
141 |
-
<li>Select and configure the type of counter your would like</li>
|
142 |
-
<li>Select "<strong>Wordpress.org (I pay for the hosting)</strong>" from the drop down list, then click "Next"</li>
|
143 |
-
<li>From the generated StatCounter Code, copy the bolded sections:<br />
|
144 |
-
<em>var sc_project=</em><strong>1234567</strong> - Your Project ID<br />
|
145 |
-
<em>var sc_security="</em><strong>a1b2c3d4</strong><em>"</em> - Your Security Code (Don't grab the inverted commas)</li>
|
146 |
-
<li>Enter those details into the relevant fields below</li>
|
147 |
-
<li>Click "Update Options"</li>
|
148 |
-
</ol></blockquote>
|
149 |
<h2>StatCounter Options</h2>
|
150 |
<blockquote>
|
151 |
<fieldset class='options'>
|
152 |
<table class="editform" cellspacing="2" cellpadding="5">
|
153 |
<tr>
|
154 |
<td>
|
155 |
-
|
156 |
-
</td>
|
157 |
-
<td>
|
158 |
-
<?php
|
159 |
-
echo "<select name='".key_sc_status."' id='".key_sc_status."'>\n";
|
160 |
-
|
161 |
-
echo "<option value='".sc_enabled."'";
|
162 |
-
if(get_option(key_sc_status) == sc_enabled)
|
163 |
-
echo " selected='selected'";
|
164 |
-
echo ">Enabled</option>\n";
|
165 |
-
|
166 |
-
echo "<option value='".sc_disabled."'";
|
167 |
-
if(get_option(key_sc_status) == sc_disabled)
|
168 |
-
echo" selected='selected'";
|
169 |
-
echo ">Disabled</option>\n";
|
170 |
-
|
171 |
-
echo "</select>\n";
|
172 |
-
?>
|
173 |
-
</td>
|
174 |
-
</tr>
|
175 |
-
<tr>
|
176 |
-
<td>
|
177 |
-
Project ID:
|
178 |
</td>
|
179 |
<td>
|
180 |
<?php
|
@@ -187,7 +136,7 @@ function sc_options_page() {
|
|
187 |
</tr>
|
188 |
<tr>
|
189 |
<td>
|
190 |
-
|
191 |
</td>
|
192 |
<td>
|
193 |
<?php
|
@@ -200,7 +149,7 @@ function sc_options_page() {
|
|
200 |
</tr>
|
201 |
<tr>
|
202 |
<td>
|
203 |
-
|
204 |
</td>
|
205 |
<td>
|
206 |
<?php
|
@@ -222,7 +171,7 @@ function sc_options_page() {
|
|
222 |
</tr>
|
223 |
<tr>
|
224 |
<td>
|
225 |
-
|
226 |
</td>
|
227 |
<td>
|
228 |
<?php
|
@@ -230,7 +179,6 @@ function sc_options_page() {
|
|
230 |
if(get_option('sc_invisible')==1) {
|
231 |
$checked = "checked";
|
232 |
}
|
233 |
-
|
234 |
echo "<input type='checkbox' name='sc_invisible' id='sc_invisible' value='1' ".$checked.">\n";
|
235 |
?>
|
236 |
</td>
|
@@ -246,12 +194,8 @@ function sc_options_page() {
|
|
246 |
|
247 |
<?php
|
248 |
}
|
249 |
-
|
250 |
-
//print_r($_POST);
|
251 |
-
//die();
|
252 |
-
//echo $sc_position;
|
253 |
$sc_position = get_option(key_sc_position);
|
254 |
-
//die($sc_position);
|
255 |
if ($sc_position=="header") {
|
256 |
add_action('wp_head', 'add_statcounter');
|
257 |
} else {
|
@@ -260,8 +204,6 @@ if ($sc_position=="header") {
|
|
260 |
|
261 |
|
262 |
|
263 |
-
|
264 |
-
|
265 |
// The guts of the StatCounter script
|
266 |
function add_statcounter() {
|
267 |
global $user_level;
|
@@ -270,7 +212,7 @@ function add_statcounter() {
|
|
270 |
$sc_invisible = 0;
|
271 |
$sc_invisible = get_option('sc_invisible');
|
272 |
if (
|
273 |
-
(
|
274 |
) {
|
275 |
?>
|
276 |
<!-- Start of StatCounter Code -->
|
@@ -285,7 +227,7 @@ if($sc_invisible==1) {
|
|
285 |
//-->
|
286 |
</script>
|
287 |
<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
|
288 |
-
<noscript><div class="statcounter"><a title="web analytics" href="http://
|
289 |
<!-- End of StatCounter Code -->
|
290 |
<?php
|
291 |
}
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Official StatCounter Plugin
|
4 |
+
* Version: 1.6
|
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
|
8 |
+
* Author URI: http://statcounter.com/
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
|
|
11 |
// Defaults, etc.
|
12 |
define("key_sc_project", "sc_project", true);
|
|
|
13 |
define("key_sc_position", "sc_position", true);
|
14 |
// legacy problem with sc_security naming
|
15 |
define("key_sc_security", "key_sc_security", true);
|
18 |
|
19 |
define("sc_project_default", "0" , true);
|
20 |
define("sc_security_default", "" , true);
|
|
|
21 |
define("sc_position_default", "footer", true);
|
|
|
22 |
|
23 |
// Create the default key and status
|
|
|
24 |
add_option(key_sc_project, sc_project_default, 'Your StatCounter Project ID.');
|
25 |
add_option(key_sc_security, sc_security_default, 'Your StatCounter Security String.');
|
26 |
add_option("sc_invisible", "0", 'Force invisibility.');
|
70 |
if ( isset( $_POST['info_update'] ) ) {
|
71 |
check_admin_referer();
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
// Update the Project ID
|
74 |
$sc_project = $_POST[key_sc_project];
|
75 |
if ($sc_project == '')
|
84 |
|
85 |
// Update the position
|
86 |
$sc_position = $_POST[key_sc_position];
|
87 |
+
if (($sc_position != 'header') && ($sc_position != 'footer'))
|
88 |
+
$sc_position = sc_position_default;
|
89 |
+
|
90 |
update_option(key_sc_position, $sc_position);
|
91 |
|
92 |
// Force invisibility
|
106 |
|
107 |
<form method="post" action="options-general.php?page=StatCounter-Wordpress-Plugin.php">
|
108 |
<div class="wrap">
|
109 |
+
<?php if (get_option( key_sc_project ) == "0") { ?>
|
|
|
|
|
|
|
|
|
|
|
110 |
<div style="margin:10px auto; border:3px #f00 solid; background-color:#fdd; color:#000; padding:10px; text-align:center;">
|
111 |
+
StatCounter Plugin has been activated, but will not be enabled until you enter your <strong>Project ID</strong> and <strong>Security Code</strong>.
|
|
|
|
|
112 |
</div>
|
113 |
<?php } ?>
|
114 |
<h2>Using StatCounter</h2>
|
115 |
+
<blockquote><a href="http://statcounter.com" style="font-weight:bold;">StatCounter</a> is a free web traffic analysis service, which provides summary stats on all your traffic and a detailed analysis of your last 500 page views. This limit can be increased by upgrading to a paid service.</p>
|
116 |
+
<p>To activate the StatCounter service for your WordPress site:<ul>
|
117 |
+
<li><a href="http://statcounter.com/sign-up/" style="font-weight:bold;">Sign Up</a> with StatCounter or <a href="http://statcounter.com/add-project/" style="font-weight:bold;">add a new project</a> to your existing account</li>
|
118 |
+
<li>The installation process will detect your WordPress installation and provide you with your <strong>Project ID</strong> and <strong>Security Code</strong></li>
|
119 |
+
</ul></blockquote>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
<h2>StatCounter Options</h2>
|
121 |
<blockquote>
|
122 |
<fieldset class='options'>
|
123 |
<table class="editform" cellspacing="2" cellpadding="5">
|
124 |
<tr>
|
125 |
<td>
|
126 |
+
<label for="<?php echo key_sc_project; ?>">Project ID:</label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
</td>
|
128 |
<td>
|
129 |
<?php
|
136 |
</tr>
|
137 |
<tr>
|
138 |
<td>
|
139 |
+
<label for="<?php echo key_sc_security; ?>">Security Code:</label>
|
140 |
</td>
|
141 |
<td>
|
142 |
<?php
|
149 |
</tr>
|
150 |
<tr>
|
151 |
<td>
|
152 |
+
<label for="<?php echo key_sc_position; ?>">Counter Position:</label>
|
153 |
</td>
|
154 |
<td>
|
155 |
<?php
|
171 |
</tr>
|
172 |
<tr>
|
173 |
<td>
|
174 |
+
<label for="sc_invisible">Force invisibilty:</label>
|
175 |
</td>
|
176 |
<td>
|
177 |
<?php
|
179 |
if(get_option('sc_invisible')==1) {
|
180 |
$checked = "checked";
|
181 |
}
|
|
|
182 |
echo "<input type='checkbox' name='sc_invisible' id='sc_invisible' value='1' ".$checked.">\n";
|
183 |
?>
|
184 |
</td>
|
194 |
|
195 |
<?php
|
196 |
}
|
197 |
+
|
|
|
|
|
|
|
198 |
$sc_position = get_option(key_sc_position);
|
|
|
199 |
if ($sc_position=="header") {
|
200 |
add_action('wp_head', 'add_statcounter');
|
201 |
} else {
|
204 |
|
205 |
|
206 |
|
|
|
|
|
207 |
// The guts of the StatCounter script
|
208 |
function add_statcounter() {
|
209 |
global $user_level;
|
212 |
$sc_invisible = 0;
|
213 |
$sc_invisible = get_option('sc_invisible');
|
214 |
if (
|
215 |
+
( $sc_project > 0 )
|
216 |
) {
|
217 |
?>
|
218 |
<!-- Start of StatCounter Code -->
|
227 |
//-->
|
228 |
</script>
|
229 |
<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
|
230 |
+
<noscript><div class="statcounter"><a title="web analytics" href="http://statcounter.com/"><img class="statcounter" src="http://c.statcounter.com/<?php echo $sc_project; ?>/0/<?php echo $sc_security; ?>/<?php echo $sc_invisible; ?>/" alt="web analytics" /></a></div></noscript>
|
231 |
<!-- End of StatCounter Code -->
|
232 |
<?php
|
233 |
}
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== StatCounter - Free Real Time Visitor Stats ===
|
2 |
Contributors: Aodhan Cullen
|
3 |
-
Donate link: http://
|
4 |
Tags: web, statistics, stats, hit, counter, visitor, ip, tracker, analytics
|
5 |
Requires at least: 2.0.2
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
StatCounter.com powered real-time detailed stats about the visitors to your blog.
|
10 |
|
@@ -14,35 +14,35 @@ The Official StatCounter Wordpress Plugin brings you all the powerful StatCounte
|
|
14 |
|
15 |
Including but not limited to the following:
|
16 |
|
17 |
-
* [Invisible Counter Option](http://
|
18 |
-
* [Configurable Counter](http://
|
19 |
-
* [Configurable Summary Stats](http://
|
20 |
-
* [Magnify User](http://
|
21 |
-
* [Drill Down](http://
|
22 |
-
* [Popular Pages](http://
|
23 |
-
* [Entry Pages](http://
|
24 |
-
* [Exit Pages](http://
|
25 |
-
* [Came From](http://
|
26 |
-
* [Keyword Analysis](http://
|
27 |
-
* [Recent Keyword Activity](http://
|
28 |
-
* [Search Engine Wars](http://
|
29 |
-
* [Visitor Paths](http://
|
30 |
-
* [Visit Length](http://
|
31 |
-
* [Returning Visits](http://
|
32 |
-
* [Recent Pageload Activity](http://
|
33 |
-
* [Recent Visitor Activity](http://
|
34 |
-
* [Country/State/City Stats](http://
|
35 |
-
* [Recent Visitor Google Map](http://
|
36 |
-
* [ISP Stats](http://
|
37 |
-
* [Browser Stats](http://
|
38 |
-
* [O.S. Stats](http://
|
39 |
-
* [Resolution Stats](http://
|
40 |
-
* [JavaScript Stats](http://
|
41 |
-
* [Email Reports](http://
|
42 |
-
* [Multiple Site Management](http://
|
43 |
-
* [User Access Management](http://
|
44 |
-
* [Public Stats](http://
|
45 |
-
* [Blocking Cookie](http://
|
46 |
|
47 |
== Installation ==
|
48 |
|
@@ -50,24 +50,16 @@ StatCounter is a free web traffic analysis service, which provides summary stats
|
|
50 |
|
51 |
To activate the StatCounter service for your WordPress site:
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
1. Click the "Configure & Install Code" button
|
57 |
-
1. Select and configure the type of counter your would like
|
58 |
-
1. Select "Wordpress.org (I pay for the hosting)" from the drop down list, then click "Next"
|
59 |
-
1. From the generated StatCounter Code, copy the bolded sections:
|
60 |
-
var sc_project=1234567 - Your Project ID
|
61 |
-
var sc_security="a1b2c3d4" - Your Security String (Don't grab the inverted commas)
|
62 |
-
1. Enter those details into the relevant fields below
|
63 |
-
1. Click "Update Options"
|
64 |
|
65 |
|
66 |
== Frequently Asked Questions ==
|
67 |
|
68 |
= Do you have any questions? =
|
69 |
|
70 |
-
[Please contact us here with your query.](http://
|
71 |
|
72 |
== Screenshots ==
|
73 |
|
@@ -76,6 +68,9 @@ To activate the StatCounter service for your WordPress site:
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
|
|
|
|
|
|
79 |
= 1.5 =
|
80 |
* Removed option to set partition - no longer required.
|
81 |
|
1 |
=== StatCounter - Free Real Time Visitor Stats ===
|
2 |
Contributors: Aodhan Cullen
|
3 |
+
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: 3.1
|
7 |
+
Stable tag: 1.6
|
8 |
|
9 |
StatCounter.com powered real-time detailed stats about the visitors to your blog.
|
10 |
|
14 |
|
15 |
Including but not limited to the following:
|
16 |
|
17 |
+
* [Invisible Counter Option](http://statcounter.com/features/#invisible-counter)
|
18 |
+
* [Configurable Counter](http://statcounter.com/features/#configurable-counter)
|
19 |
+
* [Configurable Summary Stats](http://statcounter.com/features/#configurable-summary-stats)
|
20 |
+
* [Magnify User](http://statcounter.com/features/#magnify-user)
|
21 |
+
* [Drill Down](http://statcounter.com/features/#drill-down)
|
22 |
+
* [Popular Pages](http://statcounter.com/features/#popular-pages)
|
23 |
+
* [Entry Pages](http://statcounter.com/features/#entry-pages)
|
24 |
+
* [Exit Pages](http://statcounter.com/features/#exit-pages)
|
25 |
+
* [Came From](http://statcounter.com/features/#came-from)
|
26 |
+
* [Keyword Analysis](http://statcounter.com/features/#keyword-analysis)
|
27 |
+
* [Recent Keyword Activity](http://statcounter.com/features/#recent-keyword-activity)
|
28 |
+
* [Search Engine Wars](http://statcounter.com/features/#search-engine-wars)
|
29 |
+
* [Visitor Paths](http://statcounter.com/features/#visitor-paths)
|
30 |
+
* [Visit Length](http://statcounter.com/features/#visit-length)
|
31 |
+
* [Returning Visits](http://statcounter.com/features/#returning-visits)
|
32 |
+
* [Recent Pageload Activity](http://statcounter.com/features/#recent-pageload-activity)
|
33 |
+
* [Recent Visitor Activity](http://statcounter.com/features/#recent-visitor-activity)
|
34 |
+
* [Country/State/City Stats](http://statcounter.com/features/#country-state-city-stats)
|
35 |
+
* [Recent Visitor Google Map](http://statcounter.com/features/#visitor-map)
|
36 |
+
* [ISP Stats](http://statcounter.com/features/#isp-stats)
|
37 |
+
* [Browser Stats](http://statcounter.com/features/#browser-stats)
|
38 |
+
* [O.S. Stats](http://statcounter.com/features/#os-stats)
|
39 |
+
* [Resolution Stats](http://statcounter.com/features/#resolution-stats)
|
40 |
+
* [JavaScript Stats](http://statcounter.com/features/#javascript-stats)
|
41 |
+
* [Email Reports](http://statcounter.com/features/#email-reports)
|
42 |
+
* [Multiple Site Management](http://statcounter.com/features/#multiple-site-management)
|
43 |
+
* [User Access Management](http://statcounter.com/features/#user-access-management)
|
44 |
+
* [Public Stats](http://statcounter.com/features/#public-stats)
|
45 |
+
* [Blocking Cookie](http://statcounter.com/features/#blocking-cookie)
|
46 |
|
47 |
== Installation ==
|
48 |
|
50 |
|
51 |
To activate the StatCounter service for your WordPress site:
|
52 |
|
53 |
+
* [Sign Up](http://statcounter.com/sign-up/) with StatCounter or [add a new project](http://statcounter.com/add-project/) to your existing account
|
54 |
+
* The installation process will detect your WordPress installation and provide you with your Project ID and Security Code
|
55 |
+
* The installation instructions are also available at [http://statcounter.com/wordpress.org/](http://statcounter.com/wordpress.org/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
|
58 |
== Frequently Asked Questions ==
|
59 |
|
60 |
= Do you have any questions? =
|
61 |
|
62 |
+
[Please contact us here with your query.](http://statcounter.com/about/contact/)
|
63 |
|
64 |
== Screenshots ==
|
65 |
|
68 |
|
69 |
== Changelog ==
|
70 |
|
71 |
+
= 1.6 =
|
72 |
+
* Removed the 'Logging Enabled/Disabled' option (you can deactivate the plugin instead). Updated installation instructions.
|
73 |
+
|
74 |
= 1.5 =
|
75 |
* Removed option to set partition - no longer required.
|
76 |
|
screenshot-1.gif
DELETED
Binary file
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.jpg
DELETED
Binary file
|
screenshot-2.png
ADDED
Binary file
|