Plugin Directory

Changeset 3047542


Ignore:
Timestamp:
03/08/2024 12:52:34 AM (2 years ago)
Author:
jimmitchell
Message:

tagging version 1.1.0

Location:
jmitch-tinylytics
Files:
4 edited
15 copied

Legend:

Unmodified
Added
Removed
  • jmitch-tinylytics/tags/1.1.0/inc/user-shortcodes.php

    r3039297 r3047542  
    7070    $options = get_option( 'jmitch_tinylytics_settings' );
    7171    $stats = $options['display_stats'];
     72    $stats_label = $options['stats_label'];
    7273    $hits = $options['display_hits'];
    7374    $uptime = $options['display_uptime'];
    7475    if ( $stats && $hits ) {
    75         $output .= '<span class="tiny_counter"><a href="" target="_blank" class="tinylytics_public_stats">' . esc_html__( 'My Stats', 'jmitch-tinylytics' ) . '</a>: <span class="tinylytics_hits"></span></span>';
     76        if ( $stats_label == '' || $stats_label == NULL ) {
     77            $stats_label = esc_html__( 'My Stats', 'jmitch-tinylytics' );
     78        }
     79        $output .= '<span class="tiny_counter"><a href="" target="_blank" class="tinylytics_public_stats">' . $stats_label . '</a>: <span class="tinylytics_hits"></span></span>';
    7680    }
    7781    else if ( $hits ) {
  • jmitch-tinylytics/tags/1.1.0/jmitch-tinylytics.php

    r3039479 r3047542  
    33 * Plugin Name: Tinylytics
    44 * Plugin URI: https://jimmitchell.org/tinylytics-wp-plugin/
    5  * Description: A simple plugin for embedding the Tinylytics script.
    6  * Tags: analytics, ga, google, google analytics, tracking, statistics, stats
     5 * Description: A simple plugin to embed a <a href="https://tinylytics.app">Tinylytics</a> tracking script to your site.
     6 * Tags: analytics, ga, google, google analytics, tracking, statistics, stats, hits
    77 * Author: Jim Mitchell
    88 * Author URI: https://jimmitchell.org
     
    1010 * Requires at least: 4.6
    1111 * Test up to: 6.4.3
    12  * Version: 1.0.6
     12 * Version: 1.1.0
    1313 * Requires PHP: 5.6.20
    1414 * Text Domain: jmitch-tinylytics
     
    3434*/
    3535
    36 if ( !defined( 'ABSPATH' )) die();
    37 
    38 define( 'TINYLYTICS__VERSION', '1.0.6' );
     36if ( ! defined( 'ABSPATH' )) die();
     37
     38define( 'TINYLYTICS__VERSION', '1.1.0' );
    3939
    4040// Hook functions into WordPress
     41add_action( 'init', 'jmitch_tinylytics_start_session', 1 );
     42add_action( 'init', 'jmitch_tinylytics_load_i18n' );
    4143add_action( 'admin_init', 'jmitch_tinylytics_register_settings' );
    4244add_action( 'admin_menu', 'jmitch_tinylytics_add_menu_page' );
    43 add_action( 'init', 'jmitch_tinylytics_load_i18n' );
     45add_action( 'wp_logout', 'jmitch_tinylytics_end_session' );
     46add_action( 'wp_login', 'jmitch_tinylytics_end_session' );
    4447
    4548// Register the settings
     
    5255   
    5356    add_settings_field( 'site_id', esc_html__( 'Site ID','jmitch-tinylytics' ), 'jmitch_tinylytics_site_id_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_general_section' );
    54     add_settings_field( 'display_hits', esc_html__( 'Display hits?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_hits_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
     57    add_settings_field( 'ignore_hits', esc_html__( 'Ignore admin hits?','jmitch-tinylytics' ), 'jmitch_tinylytics_ignore_hits_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
     58    add_settings_field( 'display_hits', esc_html__( 'Display visitor hits?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_hits_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
    5559    add_settings_field( 'display_stats', esc_html__( 'Link to your public stats?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_stats_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
     60    add_settings_field( 'stats_label', esc_html__( 'Public stats label','jmitch-tinylytics' ), 'jmitch_tinylytics_stats_label_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
    5661    add_settings_field( 'display_uptime', esc_html__( 'Display uptime?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_uptime_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
    5762    add_settings_field( 'display_kudos', esc_html__( 'Display Kudos?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_kudos_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
     
    7378    }
    7479
     80    if ( isset( $input['stats_label'] ) ) {
     81        $sanitized_input['stats_label']     = sanitize_text_field( $input['stats_label'] );
     82    }
     83   
    7584    if ( isset( $input['kudos_label'] ) ) {
    7685        $sanitized_input['kudos_label']     = sanitize_text_field( $input['kudos_label'] );
     
    8190    }
    8291
     92    $sanitized_input['ignore_hits']         = isset( $input['ignore_hits'] ) ? true : false;
    8393    $sanitized_input['display_hits']        = isset( $input['display_hits'] ) ? true : false;
    8494    $sanitized_input['display_stats']       = isset( $input['display_stats'] ) ? true : false;
     
    110120
    111121    $options = get_option( 'jmitch_tinylytics_settings' );
    112     echo '<input type="text" id="site_id" size="40" name="jmitch_tinylytics_settings[site_id]" placeholder="' . esc_html__( 'Enter your Tinylytics unique site id...','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['site_id'] ?? '' ) . '" />';
     122    echo '<input type="text" id="site_id" size="50" name="jmitch_tinylytics_settings[site_id]" placeholder="' . esc_html__( 'Enter your Tinylytics unique site id...','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['site_id'] ?? '' ) . '" />';
     123
     124}
     125
     126// Public stats label callback
     127function jmitch_tinylytics_stats_label_callback() {
     128
     129    $options = get_option( 'jmitch_tinylytics_settings' );
     130    echo '<input type="text" id="stats_label" size="50" name="jmitch_tinylytics_settings[stats_label]" placeholder="' . esc_html__( 'Add a custom public stats label','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['stats_label'] ?? '' ) . '" />';
    113131
    114132}
     
    118136
    119137    $options = get_option( 'jmitch_tinylytics_settings' );
    120     echo '<input type="text" id="kudos_label" size="40" name="jmitch_tinylytics_settings[kudos_label]" placeholder="' . esc_html__( 'Enter any combination of text or emoji 👋','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['kudos_label'] ?? '' ) . '" />';
     138    echo '<input type="text" id="kudos_label" size="50" name="jmitch_tinylytics_settings[kudos_label]" placeholder="' . esc_html__( 'Enter any combination of text or emoji 👋','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['kudos_label'] ?? '' ) . '" />';
    121139
    122140}
     
    126144
    127145    $options = get_option( 'jmitch_tinylytics_settings' );
    128     echo '<input type="text" id="webring_label" size="40" name="jmitch_tinylytics_settings[webring_label]" placeholder="' . esc_html__( 'Enter any combination of text or emoji 🕸️💍','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['webring_label'] ?? '' ) . '" />';
     146    echo '<input type="text" id="webring_label" size="50" name="jmitch_tinylytics_settings[webring_label]" placeholder="' . esc_html__( 'Enter any combination of text or emoji 🕸️💍','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['webring_label'] ?? '' ) . '" />';
     147
     148}
     149
     150// Ignore Hits callback
     151function jmitch_tinylytics_ignore_hits_callback() {
     152
     153    $options = get_option( 'jmitch_tinylytics_settings' );
     154    echo '<input type="checkbox" id="ignore_hits" name="jmitch_tinylytics_settings[ignore_hits]" ' . checked( true, $options['ignore_hits'] ?? false, false ) . ' />';
    129155
    130156}
     
    240266
    241267    $options = get_option( 'jmitch_tinylytics_settings' );
     268
     269    $ignore = false;
     270    if( isset( $_SESSION['isAdmin'] ) && $options['ignore_hits'] == true ) {
     271        $ignore = $_SESSION['isAdmin'];
     272    }
    242273   
    243274    if ( $options && esc_attr( $options['site_id'] ) != '' ) {
     
    253284        $avatars = $options['display_avatars'];
    254285        $flags = $options['display_flags'];
    255    
     286       
    256287        $script_url = "https://tinylytics.app/embed/{$site_id}.js?";
     288        $script_url .= $ignore ? 'ignore&' : '';
    257289        $script_url .= $hits ? 'hits&' : '';
    258290        $script_url .= $stats ? 'publicstats&' : '';
     
    279311add_action( 'wp_footer', 'jmitch_tinylytics_output_script' );
    280312
     313
    281314// *** Enqueue user scripts
    282315function jmitch_tinylytics_user_scripts() {
     
    332365
    333366
     367// *** Session management
     368function jmitch_tinylytics_start_session() {
     369    if(!session_id()) {
     370        session_start();
     371    }
     372    if ( current_user_can( 'manage_options' ) ) {
     373        $_SESSION[ 'isAdmin' ] = true;
     374    }
     375}
     376function jmitch_tinylytics_end_session() {
     377    session_destroy ();
     378}
     379
     380
    334381// *** Wordpress shortcodes to use in posts and pages
    335382include plugin_dir_path( __FILE__ ) . '/inc/user-shortcodes.php';
  • jmitch-tinylytics/tags/1.1.0/languages/jmitch-tinylytics.pot

    r3037227 r3047542  
    1515"X-Generator: Loco https://localise.biz/"
    1616
    17 #: jmitch-tinylytics.php:50
     17#: jmitch-tinylytics.php:53
    1818msgid "General Settings"
    1919msgstr ""
    2020
    21 #: jmitch-tinylytics.php:51
     21#: jmitch-tinylytics.php:54
    2222msgid "Tinylytics Options"
    2323msgstr ""
    2424
    25 #: jmitch-tinylytics.php:53
     25#: jmitch-tinylytics.php:56
    2626msgid "Site ID"
    2727msgstr ""
    2828
    29 #: jmitch-tinylytics.php:54
    30 msgid "Display hits?"
     29#: jmitch-tinylytics.php:57
     30msgid "Ignore admin hits?"
    3131msgstr ""
    3232
    33 #: jmitch-tinylytics.php:55
     33#: jmitch-tinylytics.php:58
     34msgid "Display visitor hits?"
     35msgstr ""
     36
     37#: jmitch-tinylytics.php:59
    3438msgid "Link to your public stats?"
    3539msgstr ""
    3640
    37 #: jmitch-tinylytics.php:56
     41#: jmitch-tinylytics.php:60
     42msgid "Public stats label"
     43msgstr ""
     44
     45#: jmitch-tinylytics.php:61
    3846msgid "Display uptime?"
    3947msgstr ""
    4048
    41 #: jmitch-tinylytics.php:57
     49#: jmitch-tinylytics.php:62
    4250msgid "Display Kudos?"
    4351msgstr ""
    4452
    45 #: jmitch-tinylytics.php:58
     53#: jmitch-tinylytics.php:63
    4654msgid "Kudos label"
    4755msgstr ""
    4856
    49 #: jmitch-tinylytics.php:59
     57#: jmitch-tinylytics.php:64
    5058msgid "Display webring?"
    5159msgstr ""
    5260
    53 #: jmitch-tinylytics.php:60
     61#: jmitch-tinylytics.php:65
    5462msgid "Webring label"
    5563msgstr ""
    5664
    57 #: jmitch-tinylytics.php:61
     65#: jmitch-tinylytics.php:66
    5866msgid "Display webring avatars?"
    5967msgstr ""
    6068
    61 #: jmitch-tinylytics.php:62
     69#: jmitch-tinylytics.php:67
    6270msgid "Display country flags?"
    6371msgstr ""
    6472
    65 #: jmitch-tinylytics.php:98
     73#: jmitch-tinylytics.php:108
    6674msgid "Your unique site id can be found on your"
    6775msgstr ""
    6876
    69 #: jmitch-tinylytics.php:98
     77#: jmitch-tinylytics.php:108
    7078msgid "site page"
    7179msgstr ""
    7280
    73 #: jmitch-tinylytics.php:104
     81#: jmitch-tinylytics.php:114
    7482msgid "These settings enable the various tracking features of"
    7583msgstr ""
    7684
    77 #: jmitch-tinylytics.php:112
     85#: jmitch-tinylytics.php:122
    7886msgid "Enter your Tinylytics unique site id..."
    7987msgstr ""
    8088
    81 #: jmitch-tinylytics.php:120
     89#: jmitch-tinylytics.php:130
     90msgid "Add a custom public stats label"
     91msgstr ""
     92
     93#: jmitch-tinylytics.php:138
    8294msgid "Enter any combination of text or emoji 👋"
    8395msgstr ""
    8496
    85 #: jmitch-tinylytics.php:128
     97#: jmitch-tinylytics.php:146
    8698msgid "Enter any combination of text or emoji 🕸️💍"
    8799msgstr ""
    88100
    89 #: jmitch-tinylytics.php:204
     101#: jmitch-tinylytics.php:230
    90102msgid "Settings Saved"
    91103msgstr ""
    92104
    93 #: jmitch-tinylytics.php:214
     105#: jmitch-tinylytics.php:240
    94106msgid "for"
    95107msgstr ""
    96108
    97 #: jmitch-tinylytics.php:298
     109#: jmitch-tinylytics.php:331
    98110msgid "Settings"
    99111msgstr ""
    100112
    101 #: jmitch-tinylytics.php:299
     113#: jmitch-tinylytics.php:332
    102114msgid "Donate"
    103115msgstr ""
     
    179191msgstr ""
    180192
    181 #: user-shortcodes.php:75
     193#: user-shortcodes.php:77
    182194msgid "My Stats"
    183195msgstr ""
  • jmitch-tinylytics/tags/1.1.0/readme.txt

    r3039479 r3047542  
    1010Requires at least: 4.6
    1111Tested up to: 6.4.3
    12 Stable tag: 1.0.6
    13 Version:    1.0.6
     12Stable tag: 1.1.0
     13Version:    1.1.0
    1414Requires PHP: 5.6.20
    1515Text Domain: jmitch-tinylytics
     
    142142If you like Tinylytics, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/jmitch-tinylytics/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you!
    143143
     144**Version 1.1.0 (02-21-2024)**
     145
     146* Add option to ignore hits for WordPress admins who are logged into their site.
     147* Add the ability to set a custom link label when the display public stats option is enabled.
     148
    144149**Version 1.0.6 (02-21-2024)**
    145150
  • jmitch-tinylytics/trunk/inc/user-shortcodes.php

    r3039297 r3047542  
    7070    $options = get_option( 'jmitch_tinylytics_settings' );
    7171    $stats = $options['display_stats'];
     72    $stats_label = $options['stats_label'];
    7273    $hits = $options['display_hits'];
    7374    $uptime = $options['display_uptime'];
    7475    if ( $stats && $hits ) {
    75         $output .= '<span class="tiny_counter"><a href="" target="_blank" class="tinylytics_public_stats">' . esc_html__( 'My Stats', 'jmitch-tinylytics' ) . '</a>: <span class="tinylytics_hits"></span></span>';
     76        if ( $stats_label == '' || $stats_label == NULL ) {
     77            $stats_label = esc_html__( 'My Stats', 'jmitch-tinylytics' );
     78        }
     79        $output .= '<span class="tiny_counter"><a href="" target="_blank" class="tinylytics_public_stats">' . $stats_label . '</a>: <span class="tinylytics_hits"></span></span>';
    7680    }
    7781    else if ( $hits ) {
  • jmitch-tinylytics/trunk/jmitch-tinylytics.php

    r3039479 r3047542  
    33 * Plugin Name: Tinylytics
    44 * Plugin URI: https://jimmitchell.org/tinylytics-wp-plugin/
    5  * Description: A simple plugin for embedding the Tinylytics script.
    6  * Tags: analytics, ga, google, google analytics, tracking, statistics, stats
     5 * Description: A simple plugin to embed a <a href="https://tinylytics.app">Tinylytics</a> tracking script to your site.
     6 * Tags: analytics, ga, google, google analytics, tracking, statistics, stats, hits
    77 * Author: Jim Mitchell
    88 * Author URI: https://jimmitchell.org
     
    1010 * Requires at least: 4.6
    1111 * Test up to: 6.4.3
    12  * Version: 1.0.6
     12 * Version: 1.1.0
    1313 * Requires PHP: 5.6.20
    1414 * Text Domain: jmitch-tinylytics
     
    3434*/
    3535
    36 if ( !defined( 'ABSPATH' )) die();
    37 
    38 define( 'TINYLYTICS__VERSION', '1.0.6' );
     36if ( ! defined( 'ABSPATH' )) die();
     37
     38define( 'TINYLYTICS__VERSION', '1.1.0' );
    3939
    4040// Hook functions into WordPress
     41add_action( 'init', 'jmitch_tinylytics_start_session', 1 );
     42add_action( 'init', 'jmitch_tinylytics_load_i18n' );
    4143add_action( 'admin_init', 'jmitch_tinylytics_register_settings' );
    4244add_action( 'admin_menu', 'jmitch_tinylytics_add_menu_page' );
    43 add_action( 'init', 'jmitch_tinylytics_load_i18n' );
     45add_action( 'wp_logout', 'jmitch_tinylytics_end_session' );
     46add_action( 'wp_login', 'jmitch_tinylytics_end_session' );
    4447
    4548// Register the settings
     
    5255   
    5356    add_settings_field( 'site_id', esc_html__( 'Site ID','jmitch-tinylytics' ), 'jmitch_tinylytics_site_id_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_general_section' );
    54     add_settings_field( 'display_hits', esc_html__( 'Display hits?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_hits_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
     57    add_settings_field( 'ignore_hits', esc_html__( 'Ignore admin hits?','jmitch-tinylytics' ), 'jmitch_tinylytics_ignore_hits_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
     58    add_settings_field( 'display_hits', esc_html__( 'Display visitor hits?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_hits_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
    5559    add_settings_field( 'display_stats', esc_html__( 'Link to your public stats?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_stats_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
     60    add_settings_field( 'stats_label', esc_html__( 'Public stats label','jmitch-tinylytics' ), 'jmitch_tinylytics_stats_label_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
    5661    add_settings_field( 'display_uptime', esc_html__( 'Display uptime?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_uptime_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
    5762    add_settings_field( 'display_kudos', esc_html__( 'Display Kudos?','jmitch-tinylytics' ), 'jmitch_tinylytics_display_kudos_callback', 'jmitch-tinylytics', 'jmitch_tinylytics_options_section' );
     
    7378    }
    7479
     80    if ( isset( $input['stats_label'] ) ) {
     81        $sanitized_input['stats_label']     = sanitize_text_field( $input['stats_label'] );
     82    }
     83   
    7584    if ( isset( $input['kudos_label'] ) ) {
    7685        $sanitized_input['kudos_label']     = sanitize_text_field( $input['kudos_label'] );
     
    8190    }
    8291
     92    $sanitized_input['ignore_hits']         = isset( $input['ignore_hits'] ) ? true : false;
    8393    $sanitized_input['display_hits']        = isset( $input['display_hits'] ) ? true : false;
    8494    $sanitized_input['display_stats']       = isset( $input['display_stats'] ) ? true : false;
     
    110120
    111121    $options = get_option( 'jmitch_tinylytics_settings' );
    112     echo '<input type="text" id="site_id" size="40" name="jmitch_tinylytics_settings[site_id]" placeholder="' . esc_html__( 'Enter your Tinylytics unique site id...','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['site_id'] ?? '' ) . '" />';
     122    echo '<input type="text" id="site_id" size="50" name="jmitch_tinylytics_settings[site_id]" placeholder="' . esc_html__( 'Enter your Tinylytics unique site id...','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['site_id'] ?? '' ) . '" />';
     123
     124}
     125
     126// Public stats label callback
     127function jmitch_tinylytics_stats_label_callback() {
     128
     129    $options = get_option( 'jmitch_tinylytics_settings' );
     130    echo '<input type="text" id="stats_label" size="50" name="jmitch_tinylytics_settings[stats_label]" placeholder="' . esc_html__( 'Add a custom public stats label','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['stats_label'] ?? '' ) . '" />';
    113131
    114132}
     
    118136
    119137    $options = get_option( 'jmitch_tinylytics_settings' );
    120     echo '<input type="text" id="kudos_label" size="40" name="jmitch_tinylytics_settings[kudos_label]" placeholder="' . esc_html__( 'Enter any combination of text or emoji 👋','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['kudos_label'] ?? '' ) . '" />';
     138    echo '<input type="text" id="kudos_label" size="50" name="jmitch_tinylytics_settings[kudos_label]" placeholder="' . esc_html__( 'Enter any combination of text or emoji 👋','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['kudos_label'] ?? '' ) . '" />';
    121139
    122140}
     
    126144
    127145    $options = get_option( 'jmitch_tinylytics_settings' );
    128     echo '<input type="text" id="webring_label" size="40" name="jmitch_tinylytics_settings[webring_label]" placeholder="' . esc_html__( 'Enter any combination of text or emoji 🕸️💍','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['webring_label'] ?? '' ) . '" />';
     146    echo '<input type="text" id="webring_label" size="50" name="jmitch_tinylytics_settings[webring_label]" placeholder="' . esc_html__( 'Enter any combination of text or emoji 🕸️💍','jmitch-tinylytics' ) . '" value="' . esc_attr( $options['webring_label'] ?? '' ) . '" />';
     147
     148}
     149
     150// Ignore Hits callback
     151function jmitch_tinylytics_ignore_hits_callback() {
     152
     153    $options = get_option( 'jmitch_tinylytics_settings' );
     154    echo '<input type="checkbox" id="ignore_hits" name="jmitch_tinylytics_settings[ignore_hits]" ' . checked( true, $options['ignore_hits'] ?? false, false ) . ' />';
    129155
    130156}
     
    240266
    241267    $options = get_option( 'jmitch_tinylytics_settings' );
     268
     269    $ignore = false;
     270    if( isset( $_SESSION['isAdmin'] ) && $options['ignore_hits'] == true ) {
     271        $ignore = $_SESSION['isAdmin'];
     272    }
    242273   
    243274    if ( $options && esc_attr( $options['site_id'] ) != '' ) {
     
    253284        $avatars = $options['display_avatars'];
    254285        $flags = $options['display_flags'];
    255    
     286       
    256287        $script_url = "https://tinylytics.app/embed/{$site_id}.js?";
     288        $script_url .= $ignore ? 'ignore&' : '';
    257289        $script_url .= $hits ? 'hits&' : '';
    258290        $script_url .= $stats ? 'publicstats&' : '';
     
    279311add_action( 'wp_footer', 'jmitch_tinylytics_output_script' );
    280312
     313
    281314// *** Enqueue user scripts
    282315function jmitch_tinylytics_user_scripts() {
     
    332365
    333366
     367// *** Session management
     368function jmitch_tinylytics_start_session() {
     369    if(!session_id()) {
     370        session_start();
     371    }
     372    if ( current_user_can( 'manage_options' ) ) {
     373        $_SESSION[ 'isAdmin' ] = true;
     374    }
     375}
     376function jmitch_tinylytics_end_session() {
     377    session_destroy ();
     378}
     379
     380
    334381// *** Wordpress shortcodes to use in posts and pages
    335382include plugin_dir_path( __FILE__ ) . '/inc/user-shortcodes.php';
  • jmitch-tinylytics/trunk/languages/jmitch-tinylytics.pot

    r3037227 r3047542  
    1515"X-Generator: Loco https://localise.biz/"
    1616
    17 #: jmitch-tinylytics.php:50
     17#: jmitch-tinylytics.php:53
    1818msgid "General Settings"
    1919msgstr ""
    2020
    21 #: jmitch-tinylytics.php:51
     21#: jmitch-tinylytics.php:54
    2222msgid "Tinylytics Options"
    2323msgstr ""
    2424
    25 #: jmitch-tinylytics.php:53
     25#: jmitch-tinylytics.php:56
    2626msgid "Site ID"
    2727msgstr ""
    2828
    29 #: jmitch-tinylytics.php:54
    30 msgid "Display hits?"
     29#: jmitch-tinylytics.php:57
     30msgid "Ignore admin hits?"
    3131msgstr ""
    3232
    33 #: jmitch-tinylytics.php:55
     33#: jmitch-tinylytics.php:58
     34msgid "Display visitor hits?"
     35msgstr ""
     36
     37#: jmitch-tinylytics.php:59
    3438msgid "Link to your public stats?"
    3539msgstr ""
    3640
    37 #: jmitch-tinylytics.php:56
     41#: jmitch-tinylytics.php:60
     42msgid "Public stats label"
     43msgstr ""
     44
     45#: jmitch-tinylytics.php:61
    3846msgid "Display uptime?"
    3947msgstr ""
    4048
    41 #: jmitch-tinylytics.php:57
     49#: jmitch-tinylytics.php:62
    4250msgid "Display Kudos?"
    4351msgstr ""
    4452
    45 #: jmitch-tinylytics.php:58
     53#: jmitch-tinylytics.php:63
    4654msgid "Kudos label"
    4755msgstr ""
    4856
    49 #: jmitch-tinylytics.php:59
     57#: jmitch-tinylytics.php:64
    5058msgid "Display webring?"
    5159msgstr ""
    5260
    53 #: jmitch-tinylytics.php:60
     61#: jmitch-tinylytics.php:65
    5462msgid "Webring label"
    5563msgstr ""
    5664
    57 #: jmitch-tinylytics.php:61
     65#: jmitch-tinylytics.php:66
    5866msgid "Display webring avatars?"
    5967msgstr ""
    6068
    61 #: jmitch-tinylytics.php:62
     69#: jmitch-tinylytics.php:67
    6270msgid "Display country flags?"
    6371msgstr ""
    6472
    65 #: jmitch-tinylytics.php:98
     73#: jmitch-tinylytics.php:108
    6674msgid "Your unique site id can be found on your"
    6775msgstr ""
    6876
    69 #: jmitch-tinylytics.php:98
     77#: jmitch-tinylytics.php:108
    7078msgid "site page"
    7179msgstr ""
    7280
    73 #: jmitch-tinylytics.php:104
     81#: jmitch-tinylytics.php:114
    7482msgid "These settings enable the various tracking features of"
    7583msgstr ""
    7684
    77 #: jmitch-tinylytics.php:112
     85#: jmitch-tinylytics.php:122
    7886msgid "Enter your Tinylytics unique site id..."
    7987msgstr ""
    8088
    81 #: jmitch-tinylytics.php:120
     89#: jmitch-tinylytics.php:130
     90msgid "Add a custom public stats label"
     91msgstr ""
     92
     93#: jmitch-tinylytics.php:138
    8294msgid "Enter any combination of text or emoji 👋"
    8395msgstr ""
    8496
    85 #: jmitch-tinylytics.php:128
     97#: jmitch-tinylytics.php:146
    8698msgid "Enter any combination of text or emoji 🕸️💍"
    8799msgstr ""
    88100
    89 #: jmitch-tinylytics.php:204
     101#: jmitch-tinylytics.php:230
    90102msgid "Settings Saved"
    91103msgstr ""
    92104
    93 #: jmitch-tinylytics.php:214
     105#: jmitch-tinylytics.php:240
    94106msgid "for"
    95107msgstr ""
    96108
    97 #: jmitch-tinylytics.php:298
     109#: jmitch-tinylytics.php:331
    98110msgid "Settings"
    99111msgstr ""
    100112
    101 #: jmitch-tinylytics.php:299
     113#: jmitch-tinylytics.php:332
    102114msgid "Donate"
    103115msgstr ""
     
    179191msgstr ""
    180192
    181 #: user-shortcodes.php:75
     193#: user-shortcodes.php:77
    182194msgid "My Stats"
    183195msgstr ""
  • jmitch-tinylytics/trunk/readme.txt

    r3039479 r3047542  
    1010Requires at least: 4.6
    1111Tested up to: 6.4.3
    12 Stable tag: 1.0.6
    13 Version:    1.0.6
     12Stable tag: 1.1.0
     13Version:    1.1.0
    1414Requires PHP: 5.6.20
    1515Text Domain: jmitch-tinylytics
     
    142142If you like Tinylytics, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/jmitch-tinylytics/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you!
    143143
     144**Version 1.1.0 (02-21-2024)**
     145
     146* Add option to ignore hits for WordPress admins who are logged into their site.
     147* Add the ability to set a custom link label when the display public stats option is enabled.
     148
    144149**Version 1.0.6 (02-21-2024)**
    145150
Note: See TracChangeset for help on using the changeset viewer.