Plugin Directory

Changeset 3455323


Ignore:
Timestamp:
02/06/2026 11:47:26 AM (2 weeks ago)
Author:
plausible
Message:

Update to version 2.5.3 from GitHub

Location:
plausible-analytics
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • plausible-analytics/tags/2.5.3/languages/plausible-analytics.pot

    r3454869 r3455323  
    88"Content-Transfer-Encoding: 8bit\n"
    99"Language-Team: Plausible Analytics Team <[email protected]>\n"
    10 "POT-Creation-Date: 2026-02-05 18:00+0000\n"
     10"POT-Creation-Date: 2026-02-06 11:46+0000\n"
    1111"Report-Msgid-Bugs-To: https://github.com/plausible/wordpress/issues/new\n"
    1212"X-Poedit-Basepath: ..\n"
     
    5757msgstr ""
    5858
    59 #: src/Client.php:227
     59#: src/Client.php:232
    6060msgid "Something went wrong while updating tracker script configuration: %s"
    6161msgstr ""
    6262
    63 #: src/Client.php:252
     63#: src/Client.php:257
    6464msgid "Something went wrong, try again later."
    6565msgstr ""
    6666
    67 #: src/Client.php:298
     67#: src/Client.php:303
    6868msgid "Something went wrong while creating Shared Link: %s"
    6969msgstr ""
    7070
    71 #: src/Client.php:336
     71#: src/Client.php:341
    7272msgid "Something went wrong while creating Custom Event Goal: %s"
    7373msgstr ""
    7474
    75 #: src/Client.php:353
     75#: src/Client.php:358
    7676msgid "Something went wrong while creating Funnel: %s"
    7777msgstr ""
    7878
    79 #: src/Client.php:370
     79#: src/Client.php:375
    8080msgid "Something went wrong while deleting a Custom Event Goal: %s"
    8181msgstr ""
    8282
    83 #: src/Client.php:393
     83#: src/Client.php:398
    8484msgid "Something went wrong while enabling Pageview Properties: %s"
    8585msgstr ""
     
    142142msgstr ""
    143143
     144#: src/Admin/Upgrades.php:383
     145msgid "An API token for Plausible Analytics is required. Please create one from the <a href=\"%s\">Settings screen</a> and upgrade Plausible CE if necessary."
     146msgstr ""
     147
    144148#: src/Integrations/EDD.php:37, src/Integrations/WooCommerce.php:40
    145149msgid "Visit %s*"
  • plausible-analytics/tags/2.5.3/plausible-analytics.php

    r3454869 r3455323  
    66 * Author: Plausible.io
    77 * Author URI: https://plausible.io
    8  * Version: 2.5.2
     8 * Version: 2.5.3
    99 * Text Domain: plausible-analytics
    1010 * Domain Path: /languages
  • plausible-analytics/tags/2.5.3/readme.txt

    r3454869 r3455323  
    66Tested up to: 6.9
    77Requires PHP: 7.2
    8 Stable tag: 2.5.2
     8Stable tag: 2.5.3
    99License: Massachusetts Institute of Technology (MIT) license
    1010License URI: https://opensource.org/licenses/MIT
     
    157157== Changelog ==
    158158
     159= 2.5.3 =
     160* Fixed: display a notice to CE users that haven't entered an API token yet.
     161* Fixed: a critical error would occur if the entered API token was invalid.
     162
    159163= 2.5.2 =
    160164* Fixed: CE users still using a self-hosted version without Plugins API support would get a critical error after updating to 2.5.1.
  • plausible-analytics/tags/2.5.3/src/Admin/Upgrades.php

    r3454684 r3455323  
    9595        }
    9696
     97        if ( version_compare( $plausible_analytics_version, '2.5.3', '<' ) ) {
     98            $this->upgrade_to_253();
     99        }
     100
    97101        // Add required upgrade routines for future versions here.
    98102    }
     
    347351        update_option( 'plausible_analytics_version', '2.5.1' );
    348352    }
     353
     354    /**
     355     * Show an admin-wide notice to CE users that haven't entered an API token yet.
     356     *
     357     * @return void
     358     */
     359    public function upgrade_to_253() {
     360        $self_hosted_domain = Helpers::get_settings()['self_hosted_domain'];
     361        $api_token          = Helpers::get_settings()['api_token'];
     362
     363        // Not a CE user or a CE user already using the Plugins API.
     364        if ( empty( $self_hosted_domain ) || ! empty( $api_token ) ) {
     365            update_option( 'plausible_analytics_version', '2.5.3' );
     366
     367            return;
     368        }
     369
     370        add_action( 'admin_notices', [ $this, 'show_api_token_notice' ] );
     371    }
     372
     373    /**
     374     * Display a notice to CE users that haven't entered an API token yet.
     375     *
     376     * @return void
     377     */
     378    public function show_api_token_notice() {
     379        $url = admin_url( 'options-general.php?page=plausible_analytics' );
     380
     381        ?>
     382        <div class="notice notice-warning">
     383            <p><?php echo sprintf( __( 'An API token for Plausible Analytics is required. Please create one from the <a href="%s">Settings screen</a> and upgrade Plausible CE if necessary.',
     384                        'plausible-analytics' )
     385                    , $url ); ?></p>
     386        </div>
     387        <?php
     388    }
    349389}
  • plausible-analytics/tags/2.5.3/src/Client.php

    r3454684 r3455323  
    185185        if ( ! $id ) {
    186186            $tracker_configuration = $this->get_configuration();
    187             $id                    = $tracker_configuration->getId();
     187
     188            if ( ! $tracker_configuration instanceof Client\Model\TrackerScriptConfigurationTrackerScriptConfiguration ) {
     189                return '';
     190            }
     191
     192            $id = $tracker_configuration->getId();
    188193
    189194            update_option( 'plausible_analytics_tracker_id', $id );
  • plausible-analytics/trunk/languages/plausible-analytics.pot

    r3454869 r3455323  
    88"Content-Transfer-Encoding: 8bit\n"
    99"Language-Team: Plausible Analytics Team <[email protected]>\n"
    10 "POT-Creation-Date: 2026-02-05 18:00+0000\n"
     10"POT-Creation-Date: 2026-02-06 11:46+0000\n"
    1111"Report-Msgid-Bugs-To: https://github.com/plausible/wordpress/issues/new\n"
    1212"X-Poedit-Basepath: ..\n"
     
    5757msgstr ""
    5858
    59 #: src/Client.php:227
     59#: src/Client.php:232
    6060msgid "Something went wrong while updating tracker script configuration: %s"
    6161msgstr ""
    6262
    63 #: src/Client.php:252
     63#: src/Client.php:257
    6464msgid "Something went wrong, try again later."
    6565msgstr ""
    6666
    67 #: src/Client.php:298
     67#: src/Client.php:303
    6868msgid "Something went wrong while creating Shared Link: %s"
    6969msgstr ""
    7070
    71 #: src/Client.php:336
     71#: src/Client.php:341
    7272msgid "Something went wrong while creating Custom Event Goal: %s"
    7373msgstr ""
    7474
    75 #: src/Client.php:353
     75#: src/Client.php:358
    7676msgid "Something went wrong while creating Funnel: %s"
    7777msgstr ""
    7878
    79 #: src/Client.php:370
     79#: src/Client.php:375
    8080msgid "Something went wrong while deleting a Custom Event Goal: %s"
    8181msgstr ""
    8282
    83 #: src/Client.php:393
     83#: src/Client.php:398
    8484msgid "Something went wrong while enabling Pageview Properties: %s"
    8585msgstr ""
     
    142142msgstr ""
    143143
     144#: src/Admin/Upgrades.php:383
     145msgid "An API token for Plausible Analytics is required. Please create one from the <a href=\"%s\">Settings screen</a> and upgrade Plausible CE if necessary."
     146msgstr ""
     147
    144148#: src/Integrations/EDD.php:37, src/Integrations/WooCommerce.php:40
    145149msgid "Visit %s*"
  • plausible-analytics/trunk/plausible-analytics.php

    r3454869 r3455323  
    66 * Author: Plausible.io
    77 * Author URI: https://plausible.io
    8  * Version: 2.5.2
     8 * Version: 2.5.3
    99 * Text Domain: plausible-analytics
    1010 * Domain Path: /languages
  • plausible-analytics/trunk/readme.txt

    r3454869 r3455323  
    66Tested up to: 6.9
    77Requires PHP: 7.2
    8 Stable tag: 2.5.2
     8Stable tag: 2.5.3
    99License: Massachusetts Institute of Technology (MIT) license
    1010License URI: https://opensource.org/licenses/MIT
     
    157157== Changelog ==
    158158
     159= 2.5.3 =
     160* Fixed: display a notice to CE users that haven't entered an API token yet.
     161* Fixed: a critical error would occur if the entered API token was invalid.
     162
    159163= 2.5.2 =
    160164* Fixed: CE users still using a self-hosted version without Plugins API support would get a critical error after updating to 2.5.1.
  • plausible-analytics/trunk/src/Admin/Upgrades.php

    r3454684 r3455323  
    9595        }
    9696
     97        if ( version_compare( $plausible_analytics_version, '2.5.3', '<' ) ) {
     98            $this->upgrade_to_253();
     99        }
     100
    97101        // Add required upgrade routines for future versions here.
    98102    }
     
    347351        update_option( 'plausible_analytics_version', '2.5.1' );
    348352    }
     353
     354    /**
     355     * Show an admin-wide notice to CE users that haven't entered an API token yet.
     356     *
     357     * @return void
     358     */
     359    public function upgrade_to_253() {
     360        $self_hosted_domain = Helpers::get_settings()['self_hosted_domain'];
     361        $api_token          = Helpers::get_settings()['api_token'];
     362
     363        // Not a CE user or a CE user already using the Plugins API.
     364        if ( empty( $self_hosted_domain ) || ! empty( $api_token ) ) {
     365            update_option( 'plausible_analytics_version', '2.5.3' );
     366
     367            return;
     368        }
     369
     370        add_action( 'admin_notices', [ $this, 'show_api_token_notice' ] );
     371    }
     372
     373    /**
     374     * Display a notice to CE users that haven't entered an API token yet.
     375     *
     376     * @return void
     377     */
     378    public function show_api_token_notice() {
     379        $url = admin_url( 'options-general.php?page=plausible_analytics' );
     380
     381        ?>
     382        <div class="notice notice-warning">
     383            <p><?php echo sprintf( __( 'An API token for Plausible Analytics is required. Please create one from the <a href="%s">Settings screen</a> and upgrade Plausible CE if necessary.',
     384                        'plausible-analytics' )
     385                    , $url ); ?></p>
     386        </div>
     387        <?php
     388    }
    349389}
  • plausible-analytics/trunk/src/Client.php

    r3454684 r3455323  
    185185        if ( ! $id ) {
    186186            $tracker_configuration = $this->get_configuration();
    187             $id                    = $tracker_configuration->getId();
     187
     188            if ( ! $tracker_configuration instanceof Client\Model\TrackerScriptConfigurationTrackerScriptConfiguration ) {
     189                return '';
     190            }
     191
     192            $id = $tracker_configuration->getId();
    188193
    189194            update_option( 'plausible_analytics_tracker_id', $id );
Note: See TracChangeset for help on using the changeset viewer.