Plugin Directory

Changeset 531460


Ignore:
Timestamp:
04/15/2012 04:26:14 PM (14 years ago)
Author:
hoyce
Message:

New version 1.1 with updates on the validation function for validating the Google Analytics tracking code

Location:
google-analytics-injector/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • google-analytics-injector/trunk/google-analytics-injector.php

    r487245 r531460  
    55 Description: Google Analytics Injector plugin let you inject Google Analytics tracking code into your website to
    66 collect statistics about your visitors. Just add your tracking code from Google Analytics to start the tracking.
    7  Version: 1.0.1
     7 Version: 1.1
    88 Author: Niklas Olsson
    99 Author URI: http://www.geckosolutions.se
     
    4545function inject_google_analytics_code() {
    4646  if (!is_admin() && get_option('ua_tracking_code') != "") {
    47     echo "<!-- Google Analytics Injector 1.0.1 from http://www.geckosolutions.se/blog/wordpress-plugins/ -->\n";
     47    echo "<!-- Google Analytics Injector 1.1 from http://www.geckosolutions.se/blog/wordpress-plugins/ -->\n";
    4848    echo get_google_analytics_tracking_code(get_option('ua_tracking_code'), get_option('site_restriction_url'));
    4949    echo "\n<!-- / Google Analytics Injector -->\n";
     
    187187 */
    188188function isValidUaCode($ua_tracking_code) {
    189   if($ua_tracking_code == "" || preg_match('/^UA-[0-9]*-[0-9]$/', $ua_tracking_code)) {
     189  if($ua_tracking_code == "" || preg_match('/^UA-\d{4,9}-\d{1,2}$/', $ua_tracking_code)) {
    190190    return true;
    191191  }
  • google-analytics-injector/trunk/readme.txt

    r487227 r531460  
    3939* Tested stability up to Wordpress 3.3.1
    4040* Removed a PHP notice regarding an undifined index
     41
     42= 1.1 =
     43* Updated the validation function for validating the Google Analytics tracking code.
Note: See TracChangeset for help on using the changeset viewer.