Plugin Directory

Changeset 3273663


Ignore:
Timestamp:
04/15/2025 02:08:07 PM (10 months ago)
Author:
PressLabs
Message:

Version 4.1.1

  • Fix cron interval settings
Location:
toplytics
Files:
1123 added
3 edited

Legend:

Unmodified
Added
Removed
  • toplytics/trunk/components/Backend.php

    r2991176 r3273663  
    124124        $this->_gapi_errors_count = get_option('toplytics_gapi_errors_count', 0);
    125125
     126        add_action('update_option_toplytics_settings', [ $this, 'onSettingsSaved' ], 10, 2);
     127
    126128        /**
    127129         * If the initialization above worked, we then try to schedule
     
    132134            add_action('toplytics_cron_event', [ $this, 'updateAnalyticsData' ]);
    133135        }
     136    }
     137
     138    public function onSettingsSaved($old_value, $new_value)
     139    {
     140        $this->settings = $new_value;
     141        $this->setupScheduleEvent();
    134142    }
    135143
     
    551559            [
    552560                'id' => 'enable_json',
    553                 'tooltip' => __('Enables and disables the JSON output on a custom endpoint. Use the WP REST API endpoint for common tasks. The endpoint is: ', TOPLYTICS_DOMAIN) . esc_url(home_url('/' . $this->checkSetting('json_path') ? $this->settings['json_path'] : '')) . __(' Default: Disabled', TOPLYTICS_DOMAIN),
     561                'tooltip' => __('Enables and disables the JSON output on a custom endpoint. Use the WP REST API endpoint for common tasks. The endpoint is: ', TOPLYTICS_DOMAIN) . esc_url(home_url('/' . $this->checkSetting('json_path') && isset($this->settings['json_path']) ? $this->settings['json_path'] : '')) . __(' Default: Disabled', TOPLYTICS_DOMAIN),
    554562            ]
    555563        );
     
    649657                'option' => 'toplytics_settings',
    650658                'input' => 'select',
    651                 'options' => ['hourly', 'twicedaily', 'daily'],
     659                'options' => [
     660                    'hourly' => 'Hourly',
     661                    'twicedaily' => 'Twice Daily',
     662                    'daily' => 'Daily',
     663                ],
    652664                'tooltip' => __('How often do you want your data refreshed for your top? Default: hourly', TOPLYTICS_DOMAIN),
    653665            ]
     
    15881600    public function setupScheduleEvent()
    15891601    {
    1590         if (! wp_next_scheduled('toplytics_cron_event')) {
    1591             wp_schedule_event(time(), $this->checkSetting('cron_exec_interval') ? $this->settings['cron_exec_interval'] : 'hourly', 'toplytics_cron_event');
     1602        // Clear any previously scheduled event
     1603        $timestamp = wp_next_scheduled('toplytics_cron_event');
     1604        if ($timestamp) {
     1605            wp_unschedule_event($timestamp, 'toplytics_cron_event');
     1606        }
     1607
     1608        // Schedule a new one
     1609        $interval = $this->checkSetting('cron_exec_interval') ? $this->settings['cron_exec_interval'] : 'hourly';
     1610
     1611        // Only schedule if it's a valid WordPress interval
     1612        if (in_array($interval, array('hourly', 'twicedaily', 'daily'))) {
     1613            wp_schedule_event(time(), $interval, 'toplytics_cron_event');
    15921614        }
    15931615    }
  • toplytics/trunk/readme.txt

    r3127409 r3273663  
    22Contributors: PressLabs, cristianuibar
    33Donate link: http://www.presslabs.com/
    4 Tags: presslabs, analytics, posts, top, most visited, most viewed posts, top content, toplytics, popular, google analytics, high traffic, popular posts, oauth, server resources, settings, widget, embed code, javascript, json, json file, simple, post views
     4Tags: analytics, most viewed posts, google analytics, high traffic, popular posts, post views
    55Requires at least: 4.7.3
    6 Tested up to: 6.6
    7 Stable tag: 4.1
     6Tested up to: 6.8
     7Stable tag: 4.1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1111Displays the most visited posts as a widget using data from Google Analytics. Designed to be used under high-traffic or low server resources.
    1212
    13 For more details check the [official Toplytics documentation](https://www.presslabs.com/code/toplytics/).
    14 
    1513== About the makers ==
    1614This plugin was developed by the crafty people at Presslabs—the Smart Managed WordPress Hosting Platform. Here we bring high-performance hosting and business intelligence for WordPress sites. In our spare time, we contribute to the global open-source community with our plugins.
     
    2018== What is Toplytics? ==
    2119This plugin displays the most visited posts as a widget, using data extracted from Google Analytics. Toplytics is designed to work with high-traffic sites and all types of caching.
    22 
     20For more details check the [official Toplytics documentation](https://www.presslabs.com/code/toplytics/).
    2321== Why Toplytics? ==
    2422You can use this plugin if you want to display the most visited posts of your site in a safe and reliable manner, with no risk of downtime or slowness. The plugin is built for high-traffic sites where counting every visitor’s click loads up the DB and presents the potential of crashing the site. Of course, you need an active Google Analytics setup on your site to use this plugin.
     
    247245== Changelog ==
    248246
     247= 4.1.1 =
     248* Fix cron interval settings
     249
    249250= 4.1 =
    250 * Add support for GA4 and remove support for GA Classic
    251 * Dependency updates
     251* Add support for analytics v4
     252* Match var set up of dimension, etc.
     253* Add filter hook for GA4 API params
     254* Re-add getting result ranges & settings from WP options to allow for adding an option filter hook
     255* Quick connect and manual connect rename
     256* fix null widget id warning
     257* Improve results ranges and reactivate daily
     258* Update settings on update
     259* improve db update logic
     260* break not continue in this first case
     261* Update db version as well
     262* Use current version when updating DB version
    252263
    253264= 4.0.10 =
    254 
    255265* Tweek: Added an error count threshold to prevent "sudden disconnect syndrome"
    256266* Tweek: Improved class handling by importing the required ones where needed
     
    261271
    262272= 4.0.9 =
    263 
    264273* Fixed: Widgets button on the Overview page was not working
    265274
    266275= 4.0.8 =
    267 
    268276* Fixed: Not retrieving the list of GA profiles when empty property present in account. Thanks to @bapman for finding this problem: https://wordpress.org/support/topic/not-retrieving-the-list-of-ga-profiles/
    269277
    270278= 4.0.7 =
    271 
    272279* Fixed: Status messages were not being displayed on the admin settings pages
    273280
    274281= 4.0.6 =
    275 
    276282* Optimized vendor dependencies for a smaller package footprint
    277283
    278284= 4.0.5 =
    279 
    280285* Updating vendor dependencies
    281286* Fix updating date ranges before every update
    282287
    283288= 4.0.4 =
    284 
    285289* Fix #150 - set proper size for featured image
    286290* Fix #146 - Update analytics data on saving plugin settings
     
    302306
    303307= 3.1 =
    304 
    305308* Allow multiple post types via filter
    306309* Add shortcode to features list fix #115
     
    317320
    318321= 3.0 =
    319 
    320322**This is a major update and you need to re-authenticate with Google Analytics for the plugin to work!**
    321323
     
    344346* removed Romanian translation
    345347
    346 
    347348= 2.1.1 =
    348 
    349349* fixed a possible infinite loop
    350350* `WP_DEBUG` enables toplytics debug mode
    351351
    352 
    353352= 2.1 =
    354 
    355353* added new filters and actions
    356354filters:
     
    364362* added `2weeks` in the data range.
    365363
    366 
    367364= 2.0 =
    368 
    369365* Implemented OAuth login method.
    370366* Added `Display posts in real time` option.
  • toplytics/trunk/toplytics.php

    r2991176 r3273663  
    1515 * Plugin URI:        https://www.presslabs.org/toplytics/
    1616 * Description:       Display top posts in a widget without putting any pressure on your host and database. This plugin helps you achieve this using the Google Analytics API to get the data from there so your server will stay clear of the preasure of monitoring and counting every single page view to display top posts.
    17  * Version:           4.1
     17 * Version:           4.1.1
    1818 * Author:            Presslabs
    1919 * Author URI:        https://www.presslabs.com/
     
    3232 * Plugin default settings
    3333 */
    34 define('TOPLYTICS_VERSION', '4.1.0');
     34define('TOPLYTICS_VERSION', '4.1.1');
    3535define('TOPLYTICS_APP_NAME', 'Toplytics - Popular Posts Widget');
    3636define('TOPLYTICS_DOMAIN', 'toplytics');
Note: See TracChangeset for help on using the changeset viewer.