Plugin Directory


Ignore:
Timestamp:
12/15/2013 05:01:09 PM (12 years ago)
Author:
Alphawolf
Message:

Version 1.0.1 update

  • 'Redefining already defined constructor' bug that occured on several configurations
  • WP 3.8 compatibility
Location:
goolytics-simple-google-analytics/trunk
Files:
68 added
3 edited

Legend:

Unmodified
Added
Removed
  • goolytics-simple-google-analytics/trunk/goolytics.php

    r664341 r822550  
    22/*
    33Plugin Name: Goolytics - Simple Google Analytics
    4 Version: 1.0
     4Version: 1.0.1
    55Plugin URI: http://www.schloebe.de/wordpress/goolytics-plugin/
    66Description: A simple Google Analytics solution that works without slowing down your WordPress installation.
     
    3636 * Define the plugin version
    3737 */
    38 define("GOOLYTICSVERSION", "1.0");
     38define("GOOLYTICSVERSION", "1.0.1");
    3939
    4040/**
     
    6969    * initializing required stuff for the plugin
    7070    *
    71     * PHP 4 Compatible Goolytics
    72     *
    73     * @since        1.0
    74     * @author       scripts@schloebe.de
    75     */
    76     function Goolytics() {
    77         $this->__construct();
    78     }
    79    
    80    
    81     /**
    82     * The Goolytics class constructor
    83     * initializing required stuff for the plugin
    84     *
    8571    * PHP 5 Constructor
    8672    *
     
    10187        add_filter('plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2);
    10288       
    103         add_action('admin_init', array(&$this, 'load_textdomain'));
     89        add_action('plugins_loaded', array(&$this, 'load_textdomain'));
    10490        add_action('admin_init', array(&$this, 'admin_init'));
    10591        add_action('admin_menu', array(&$this, 'admin_menu_goolytics'));
     
    10793        if (!is_admin())
    10894            add_action('wp_head', array(&$this, 'print_code'));
     95    }
     96   
     97   
     98    /**
     99    * The Goolytics class constructor
     100    * initializing required stuff for the plugin
     101    *
     102    * PHP 4 Compatible Goolytics
     103    *
     104    * @since        1.0
     105    * @author       scripts@schloebe.de
     106    */
     107    function Goolytics() {
     108        $this->__construct();
    109109    }
    110110   
     
    192192    function load_textdomain() {
    193193        if($this->textdomain_loaded) return;
    194         load_plugin_textdomain('goolytics', false, dirname(plugin_basename(__FILE__)) . '/languages');
     194        load_plugin_textdomain('goolytics', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    195195        $this->textdomain_loaded = true;
    196196    }
  • goolytics-simple-google-analytics/trunk/inc/options.php

    r664341 r822550  
     1<?php
     2require_once( trailingslashit(dirname(__FILE__)) . 'google-api-php-client/src/Google_Client.php');
     3require_once( trailingslashit(dirname(__FILE__)) . 'google-api-php-client/src/contrib/Google_AnalyticsService.php');
     4
     5$client = new Google_Client();
     6$client->setApplicationName("Goolytics - Simple Google Analytics");
     7
     8$service = new Google_AnalyticsService($client);
     9
     10if (isset($_GET['logout'])) {
     11    unset($_SESSION['token']);
     12}
     13
     14if (isset($_GET['code'])) {
     15    $client->authenticate();
     16    $_SESSION['token'] = $client->getAccessToken();
     17    $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
     18    header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
     19}
     20
     21if (isset($_SESSION['token'])) {
     22    $client->setAccessToken($_SESSION['token']);
     23}
     24
     25if ($client->getAccessToken()) {
     26    $props = $service->management_webproperties->listManagementWebproperties("~all");
     27    print "<h1>Web Properties</h1><pre>" . print_r($props, true) . "</pre>";
     28
     29    $accounts = $service->management_accounts->listManagementAccounts();
     30    print "<h1>Accounts</h1><pre>" . print_r($accounts, true) . "</pre>";
     31
     32    $_SESSION['token'] = $client->getAccessToken();
     33} else {
     34    $authUrl = $client->createAuthUrl();
     35    print "<a class='login' href='$authUrl'>Connect Me!</a>";
     36}
     37?>
     38
    139<div class="wrap">
    240    <h2>Goolytics - Simple Google Analytics</h2>
  • goolytics-simple-google-analytics/trunk/readme.txt

    r664341 r822550  
    44Tags: google, analytics, web tracking, tracking, goolytics
    55Requires at least: 3.0
    6 Tested up to: 3.6
     6Tested up to: 3.9
    77Stable tag: trunk
    88License: GPLv2 or later
     
    4444== Changelog ==
    4545
     46= 1.0.1 =
     47* 'Redefining already defined constructor' bug that occured on several configurations
     48* WP 3.8 compatibility
     49
    4650= 1.0 =
    4751* Initial release
Note: See TracChangeset for help on using the changeset viewer.