Clicky by Yoast - Version 1.3

Version Description

  • Added support for the new outbound link pattern matching.
Download this release

Release Info

Developer joostdevalk
Plugin Icon 128x128 Clicky by Yoast
Version 1.3
Comparing to
See all releases

Code changes from version 1.2.3 to 1.3

Files changed (3) hide show
  1. clicky.php +38 -14
  2. lang/clicky.pot +0 -11
  3. readme.txt +6 -2
clicky.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Clicky for WordPress
4
- Version: 1.2.3
5
  Plugin URI: http://getclicky.com/goodies/#wordpress
6
  Description: Integrates Clicky on your blog!
7
  Author: Joost de Valk
@@ -106,7 +106,7 @@ if ( is_admin() && ! class_exists( 'Clicky_Admin' ) ) {
106
  if (!current_user_can('manage_options')) die(__('You cannot edit the Clicky settings.', 'clicky'));
107
  check_admin_referer('clicky-config');
108
 
109
- foreach (array('site_id', 'site_key', 'admin_site_key', 'twitter_username', 'twitter_password', 'twitter_prefix') as $option_name) {
110
  if (isset($_POST[$option_name]))
111
  $options[$option_name] = $_POST[$option_name];
112
  else
@@ -187,6 +187,13 @@ if ( is_admin() && ! class_exists( 'Clicky_Admin' ) ) {
187
  'content' => '<input type="checkbox" '.checked($options['track_names'],true,false).' name="track_names" id="track_names"/>'
188
  );
189
 
 
 
 
 
 
 
 
190
  $this->postbox('clicky_settings',__('Advanced Settings', 'clicky'), $this->form_table($rows));
191
 
192
  ?>
@@ -235,6 +242,7 @@ function clicky_defaults() {
235
  'site_id' => '',
236
  'site_key' => '',
237
  'admin_site_key' => '',
 
238
  'ignore_admin' => false,
239
  'track_names' => true,
240
  );
@@ -261,19 +269,19 @@ function clicky_script() {
261
  // Track commenter name if track_names is true
262
  if( $options['track_names'] ) {
263
  ?>
264
- <script type='text/javascript'>
265
- function clicky_gc( name ) {
266
- var ca = document.cookie.split(';');
267
- for( var i in ca ) {
268
- if( ca[i].indexOf( name+'=' ) != -1 )
269
- return decodeURIComponent( ca[i].split('=')[1] );
270
- }
271
- return '';
272
  }
273
- var clicky_custom_session = {
274
- username: clicky_gc( 'comment_author_<?php echo md5( get_option("siteurl") ); ?>' )
275
- };
276
- </script>
 
 
277
  <?php
278
  }
279
 
@@ -291,6 +299,22 @@ function clicky_script() {
291
  }
292
  }
293
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  // Display the script
295
  ?>
296
  <script type="text/javascript">
1
  <?php
2
  /*
3
  Plugin Name: Clicky for WordPress
4
+ Version: 1.3
5
  Plugin URI: http://getclicky.com/goodies/#wordpress
6
  Description: Integrates Clicky on your blog!
7
  Author: Joost de Valk
106
  if (!current_user_can('manage_options')) die(__('You cannot edit the Clicky settings.', 'clicky'));
107
  check_admin_referer('clicky-config');
108
 
109
+ foreach (array('site_id', 'site_key', 'admin_site_key', 'outbound_pattern') as $option_name) {
110
  if (isset($_POST[$option_name]))
111
  $options[$option_name] = $_POST[$option_name];
112
  else
187
  'content' => '<input type="checkbox" '.checked($options['track_names'],true,false).' name="track_names" id="track_names"/>'
188
  );
189
 
190
+ $rows[] = array(
191
+ 'id' => 'outbound_pattern',
192
+ 'label' => __('Outbound Link Pattern', 'clicky'),
193
+ 'desc' => sprintf( __('If your site uses redirects for outbound links, instead of links that point directly to their external source (this is popular with affiliate links, for example), then you\'ll need to use this variable to tell our tracking code additional patterns to look for when automatically tracking outbound links. %1$sRead more here%1$s.','clicky'), '<a href="https://secure.getclicky.com/helpy?type=customization#outbound_pattern">', '</a>'),
194
+ 'content' => '<input class="text" type="text" value="'.$options['outbound_pattern'].'" name="outbound_pattern" id="outbound_pattern"/> '.__('For instance: <code>/out/,/go/</code>','clicky'),
195
+ );
196
+
197
  $this->postbox('clicky_settings',__('Advanced Settings', 'clicky'), $this->form_table($rows));
198
 
199
  ?>
242
  'site_id' => '',
243
  'site_key' => '',
244
  'admin_site_key' => '',
245
+ 'outbound_pattern' => '',
246
  'ignore_admin' => false,
247
  'track_names' => true,
248
  );
269
  // Track commenter name if track_names is true
270
  if( $options['track_names'] ) {
271
  ?>
272
+ <script type='text/javascript'>
273
+ function clicky_gc( name ) {
274
+ var ca = document.cookie.split(';');
275
+ for( var i in ca ) {
276
+ if( ca[i].indexOf( name+'=' ) != -1 )
277
+ return decodeURIComponent( ca[i].split('=')[1] );
 
 
278
  }
279
+ return '';
280
+ }
281
+ var clicky_custom_session = {
282
+ username: clicky_gc( 'comment_author_<?php echo md5( get_option("siteurl") ); ?>' )
283
+ };
284
+ </script>
285
  <?php
286
  }
287
 
299
  }
300
  }
301
 
302
+ if ( isset( $options['outbound_pattern'] ) && trim( $options['outbound_pattern'] ) != '' ) {
303
+ $patterns = explode( ',', $options['outbound_pattern'] );
304
+ $pattern = '';
305
+ foreach ( $patterns as $pat ) {
306
+ if ( $pattern != '' )
307
+ $pattern .= ',';
308
+ $pat = trim( str_replace( '"', '', str_replace( "'", "", $pat ) ) );
309
+ $pattern .= "'".$pat."'";
310
+ }
311
+ ?>
312
+ <script type="text/javascript">
313
+ var clicky_custom = {};
314
+ clicky_custom.outbound_pattern = [<?php echo $pattern; ?>];
315
+ </script>
316
+ <?php
317
+ }
318
  // Display the script
319
  ?>
320
  <script type="text/javascript">
lang/clicky.pot CHANGED
@@ -260,18 +260,7 @@ msgstr ""
260
  msgid "Clicky for WordPress"
261
  msgstr ""
262
 
263
- #. Plugin URI of an extension
264
- msgid "http://getclicky.com/goodies/#wordpress"
265
- msgstr ""
266
-
267
  #. Description of an extension
268
  msgid "Integrates Clicky on your blog!"
269
  msgstr ""
270
 
271
- #. Author of an extension
272
- msgid "Joost de Valk"
273
- msgstr ""
274
-
275
- #. Author URI of an extension
276
- msgid "http://yoast.com/"
277
- msgstr ""
260
  msgid "Clicky for WordPress"
261
  msgstr ""
262
 
 
 
 
 
263
  #. Description of an extension
264
  msgid "Integrates Clicky on your blog!"
265
  msgstr ""
266
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: joostdevalk
3
  Donate link: http://yoast.com/donate/
4
  Tags: analytics, statistics, clicky, getclicky
5
  Requires at least: 2.8
6
- Tested up to: 3.2
7
- Stable tag: 1.2.3
8
 
9
  Integrates the Clicky (from getClicky.com) web analytics service into your blog.
10
 
@@ -35,6 +35,10 @@ Read the authors [review of Clicky Analytics](http://yoast.com/clicky-analytics-
35
 
36
  == Changelog ==
37
 
 
 
 
 
38
  = 1.2.3 =
39
 
40
  * No longer track preview pages.
3
  Donate link: http://yoast.com/donate/
4
  Tags: analytics, statistics, clicky, getclicky
5
  Requires at least: 2.8
6
+ Tested up to: 3.3
7
+ Stable tag: 1.3
8
 
9
  Integrates the Clicky (from getClicky.com) web analytics service into your blog.
10
 
35
 
36
  == Changelog ==
37
 
38
+ = 1.3 =
39
+
40
+ * Added support for the new [outbound link pattern matching](http://getclicky.com/blog/287/custom-outbound-link-pattern-matching-and-iframe-tracking).
41
+
42
  = 1.2.3 =
43
 
44
  * No longer track preview pages.