WordPress.org

Plugin Directory

Changeset 522771


Ignore:
Timestamp:
03/23/12 19:10:22 (2 years ago)
Author:
neoxx
Message:

2.33

  • changed handling of contextual help for WordPress 3.3
  • adopted handling of default settings
  • external files are now registered in init-hook
Location:
generalstats/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • generalstats/trunk/generalstats.php

    r436072 r522771  
    66Description: Counts the number of users, categories, posts, comments, pages, links, tags, link-categories, words in posts, words in comments and words in pages. 
    77Author: Dr. Bernhard Riedl 
    8 Version: 2.32 
     8Version: 2.33 
    99Author URI: http://www.bernhard.riedl.name/ 
    1010*/ 
    1111 
    1212/* 
    13 Copyright 2006-2011 Dr. Bernhard Riedl 
    14  
    15 Inspirations & Proof-Reading 2007-2011 
     13Copyright 2006-2012 Dr. Bernhard Riedl 
     14 
     15Inspirations & Proof-Reading 2007-2012 
    1616by Veronika Grascher 
    1717 
     
    268268        $this->set_plugin_url(); 
    269269        $this->retrieve_settings(); 
    270         $this->register_scripts(); 
    271270        $this->register_hooks(); 
    272271    } 
     
    276275    */ 
    277276 
    278     private function register_scripts() { 
     277    function register_scripts() { 
    279278 
    280279        /* 
     
    305304 
    306305    private function register_hooks() { 
     306 
     307        /* 
     308        register externals 
     309        */ 
     310 
     311        add_action('init', array(&$this, 'register_scripts')); 
    307312 
    308313        /* 
     
    866871 
    867872            /* 
    868             for some strange reason, 
    869             WordPress doesn't like to 
    870             write to an empty option 
     873            we intentionally write 
     874            the fallbacks in the 
     875            database to activate 
     876            built-in caching 
     877            and repair a broken 
     878            settings-array 
    871879            */ 
    872880 
    873881            else { 
    874                 update_option($this->get_prefix(false), array()); 
     882                update_option( 
     883                    $this->get_prefix(false), 
     884                    array( 
     885                        'stats_selected' => $this->fallback_stats_selected, 
     886                        'stats_available' => $this->fallback_stats_available, 
     887                        'defaults' => $this->fallback_defaults, 
     888                        'options' => $this->fallback_options 
     889                    ) 
     890                ); 
    875891            } 
    876892        } 
     
    951967 
    952968        /* 
    953         check-fields are either 0 or 1 
     969        check-fields will be 
     970        converted to true/false 
    954971        */ 
    955972 
     
    968985 
    969986        foreach ($check_fields as $check_field) { 
    970             $input[$check_field] = (isset($input[$check_field]) && $input[$check_field] == 1 ? true : false); 
     987            $input[$check_field] = (isset($input[$check_field]) && $input[$check_field] == 1) ? true : false; 
    971988        } 
    972989 
     
    17361753 
    17371754    /* 
     1755    Options Page Help Tab 
     1756    */ 
     1757 
     1758    function options_page_help_tab() { 
     1759        $this->add_help_tab($this->options_page_help()); 
     1760    } 
     1761 
     1762    /* 
    17381763    white list options 
    17391764    */ 
     
    17661791        add_action('admin_print_scripts-'.$options_page, array(&$this, 'settings_print_scripts')); 
    17671792        add_action('admin_head-'.$options_page, array(&$this, 'admin_styles')); 
    1768         add_contextual_help($options_page, $this->options_page_help()); 
     1793        add_action('load-'.$options_page, array(&$this, 'options_page_help_tab')); 
    17691794    } 
    17701795 
     
    17741799 
    17751800    function head_meta() { 
    1776         echo("<meta name=\"".$this->get_nicename()."\" content=\"2.32\"/>\n"); 
     1801        echo("<meta name=\"".$this->get_nicename()."\" content=\"2.33\"/>\n"); 
    17771802    } 
    17781803 
     
    33083333 
    33093334    /* 
     3335    handles adding a help-tab 
     3336    */ 
     3337 
     3338    private function add_help_tab($help_text) { 
     3339        $current_screen=get_current_screen(); 
     3340 
     3341        /* 
     3342        WP >= 3.0 
     3343        */ 
     3344 
     3345        if (!method_exists($current_screen, 'add_help_tab')) 
     3346            add_contextual_help($current_screen, $help_text); 
     3347 
     3348        /* 
     3349        WP >= 3.3 
     3350        */ 
     3351 
     3352        else { 
     3353            $help_options=array( 
     3354                'id' => $this->get_prefix(), 
     3355                'title' => $this->get_nicename(), 
     3356                'content' => $help_text 
     3357            ); 
     3358 
     3359            $current_screen->add_help_tab($help_options); 
     3360        } 
     3361    } 
     3362 
     3363    /* 
    33103364    Settings Page 
    33113365    */ 
     
    39554009            <li>As all stats are retrieved from the server on every refresh, a <em>Ajax Refresh Time</em> of one second is mostly not realizable for the average server out there. Moreover, please remember that every update causes bandwith usage for your readers and your server.</li> 
    39564010 
    3957             <li>Due to security reasons, the time for <abbr title="asynchronous JavaScript and XML">Ajax</abbr> updates will be limited by default. WordPress normally defines this time to 24 hours. If you activate <em>Renew nonce to assure continous updates</em> you override this security feature but provide unlimited time for <abbr title="asynchronous JavaScript and XML">Ajax</abbr> updates of your stats.</li> 
     4011            <li>Due to security reasons, the time for <abbr title="asynchronous JavaScript and XML">Ajax</abbr> updates will be limited by default. In your installation, the nonce-life-time is defined as <?php $nonce_life=apply_filters('nonce_life', 86400); echo(number_format((float) ($nonce_life/3600), 0).' hours ('.$nonce_life.' seconds)'); ?>. If you activate <em>Renew nonce to assure continous updates</em> you override this security feature (only for <?php echo($this->get_nicename()); ?>) but provide unlimited time for <abbr title="asynchronous JavaScript and XML">Ajax</abbr> updates of your stats.</li> 
    39584012 
    39594013            <li>In the last option, <em>Ajax Refresh Library in Front-End</em>, you can choose whether to use <a target="_blank" href="http://jquery.com/">jQuery</a> or <a target="_blank" href="http://www.prototypejs.org/">Prototype</a> for the Ajax Refresh in your theme.</li> 
     
    40064060            <li>If you activate <em>Use Action Hooks</em>, the cache-cycle will be interrupted for events like editing a post or publishing a new comment. Thus, your stats should be updated automatically even if you have defined a longer <em>Cache Time</em>.</li> 
    40074061 
    4008             <li><em>Rows at Once</em> is a expert setting of <?php echo($this->get_nicename()); ?>. This option effects the Words_in_* stats: higher value = increased memory usage, but better performance. Please consult the <a target="_blank" href="http://wordpress.org/extend/plugins/<?php echo($this->get_prefix(false)); ?>/faq/">FAQ</a> for further information.</li> 
     4062            <li><em>Rows at Once</em> is an expert setting of <?php echo($this->get_nicename()); ?>. This option effects the Words_in_* stats: higher value = increased memory usage, but better performance. Please consult the <a target="_blank" href="http://wordpress.org/extend/plugins/<?php echo($this->get_prefix(false)); ?>/faq/">FAQ</a> for further information.</li> 
    40094063 
    40104064        </ul> 
  • generalstats/trunk/readme.txt

    r436072 r522771  
    44Tags: statistics, stats, analytics, count, user, category, post, comment, page, link, tag, link-category, seo, widget, dashboard, sidebar, shortcode, multisite, multi-site, ajax, javascript, jquery, prototype 
    55Requires at least: 2.8 
    6 Tested up to: 3.3 
     6Tested up to: 3.4 
    77Stable tag: trunk 
    88 
     
    1717* fully optionpage-configurable 
    1818* easy to integrate (ships with multi/sidebar- and dashboard-widget functionality) 
    19 * possible to integrate in "Right Now" box on the dashboard 
     19* possible to integrate in "Right Now" box or to display as widget on the dashboard 
    2020* high performing with caching technology and customizable memory usage 
    2121* optional Ajax refresh (jQuery or Prototype) 
     
    261261 
    262262== Changelog == 
     263 
     264= 2.33 = 
     265 
     266* changed handling of contextual help for WordPress 3.3 
     267* adopted handling of default settings 
     268* external files are now registered in init-hook 
    263269 
    264270= 2.32 = 
Note: See TracChangeset for help on using the changeset viewer.