Plugin Directory

Changeset 3269994


Ignore:
Timestamp:
04/09/2025 08:35:41 PM (12 months ago)
Author:
teamgrow
Message:

Release version 1.5.3 of Grow for WordPress

Location:
grow-for-wp
Files:
137 added
19 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • grow-for-wp/trunk/grow-for-wp.php

    r3219838 r3269994  
    44 * Plugin URI:          https://grow.me/publishers
    55 * Description:         Integrate your WordPress Site with Grow
    6  * Version:             1.5.2
     6 * Version:             1.5.3
    77 * Requires at least:   5.2
    88 * Requires PHP:        7.4
  • grow-for-wp/trunk/inc/Grow/API/V1/Settings.php

    r2980893 r3269994  
    4141        return [
    4242            'type'        => 'string',
    43             'description' => esc_html__( 'Grow Site ID', 'grow-for-wp' ),
     43            'description' => 'Grow Site ID',
    4444        ];
    4545    }
  • grow-for-wp/trunk/inc/Grow/API/V1/Status.php

    r2980893 r3269994  
    2424            'properties' => [
    2525                'version'   => [
    26                     'description' => esc_html__( 'Current Grow for WordPress version', 'grow-for-wp' ),
     26                    'description' => 'Current Grow for WordPress version',
    2727                    'pattern'     => '^[\\d]+\\.[\\d]+\\.[\\d]$',
    2828                    'type'        => [ 'null', 'string' ],
    2929                ],
    3030                'connected' => [
    31                     'description' => esc_html__( 'Whether the site is connected to Grow', 'grow-for-wp' ),
     31                    'description' => 'Whether the site is connected to Grow',
    3232                    'type'        => 'boolean',
    3333                ],
    3434                'valid'     => [
    35                     'description' => esc_html__( 'Whether the passed id is the same as the connected id of the site', 'grow-for-wp' ),
     35                    'description' => 'Whether the passed id is the same as the connected id of the site',
    3636                    'type'        => 'boolean',
    3737                ],
     
    5050            'site_id' => [
    5151                'type'              => 'string',
    52                 'description'       => esc_html__( 'Site ID to check validity of', 'grow-for-wp' ),
     52                'description'       => 'Site ID to check validity of',
    5353                'required'          => false,
    5454                'validate_callback' => function( $param ) {
  • grow-for-wp/trunk/inc/Grow/AdsScript.php

    r3205022 r3269994  
    1717    private string $grow_journey_status;
    1818
     19    /** @var string $script_handle Handle for the mediavine script wrapper
     20     *  This is the same as the Mediavine Control Panel Script wrapper to take advantage of automations and integrations
     21     */
     22    private string $script_handle = 'mv-script-wrapper';
     23
    1924    /** @var EnvironmentInterface Provides access to environment related information */
    2025    private EnvironmentInterface $environment;
     
    5964     */
    6065    public function enqueue_ads_script() {
     66        // The MCP script handle is currently the same as the Journey Script Handle, but kept in a separate variable for clarity's sake
     67        $mcp_script_handle = 'mv-script-wrapper';
    6168        // Check if MCP already doing this and stop gracefully, if so.
    62         if ( $this->environment->get_has_mcp() && WordPress::wp_script_is( 'mv-script-wrapper' ) ) {
     69        if ( $this->environment->get_has_mcp() && WordPress::wp_script_is( $mcp_script_handle ) ) {
    6370            return;
    6471        }
     
    7784        }
    7885
    79         WordPress::enqueue_script( 'mv-script-wrapper', 'https://scripts.scriptwrapper.com/tags/' . $this->grow_site_uuid . '.js' );
     86        WordPress::enqueue_script( $this->script_handle, 'https://scripts.scriptwrapper.com/tags/' . $this->grow_site_uuid . '.js' );
    8087    }
    8188
     
    8996     */
    9097    public function add_script_attributes( $tag, $handle ) {
    91         if ( 'mv-script-wrapper' !== $handle ) {
     98        if ( $this->script_handle !== $handle ) {
    9299            return $tag;
    93100        }
    94101
    95         $tag = str_replace( ' src', ' async="async" src', $tag );
    96         $tag = str_replace( ' src', ' data-noptimize="1" src', $tag );
     102        $tag = self::add_attribute( $tag, 'async', 'async' );
     103        $tag = self::add_attribute( $tag, 'fetchpriority', 'high' );
     104        $tag = self::add_attribute( $tag, 'data-noptimize', '1' );
    97105        // Disable Cloudflare Rocket Loader.
    98106        // @see https://developers.cloudflare.com/speed/optimization/content/rocket-loader/ignore-javascripts/ .
    99         $tag = str_replace( ' src', ' data-cfasync="false" src', $tag );
     107        $tag = self::add_attribute( $tag, 'data-cfasync', 'false' );
    100108
    101109        return $tag;
     110    }
     111
     112    /**
     113     * Add an attribute to a passed in script tag
     114     *
     115     * @param string $tag Script Tag to add attribute to
     116     * @param string $attribute Attribute ato add
     117     * @param string $value value for attribute
     118     * @return string Tag with added attribute
     119     */
     120    private static function add_attribute( $tag, $attribute, $value ) {
     121        if ( str_contains($tag, ' ' . $attribute . '=') ) {
     122            return $tag;
     123        }
     124        return str_replace( ' src', ' ' . $attribute . '="' . $value . '" src', $tag );
    102125    }
    103126
  • grow-for-wp/trunk/inc/Grow/Options.php

    r3127526 r3269994  
    1010class Options implements OptionsInterface {
    1111
     12    /** @var array<string, string|null|mixed> $options_values  */
     13    private array $options_values = [
     14        'grow_site_id'                            => null,
     15        'grow_site_uuid'                          => null,
     16        'grow_first_install'                      => null,
     17        'grow_current_version'                    => null,
     18        'grow_first_install_version'              => null,
     19        'grow_just_activated'                     => null,
     20        'grow_journey_status'                     => null,
     21        'grow_ads_txt_method'                     => null,
     22        'grow_ads_txt_redirect_check_in_progress' => null,
     23        'grow_show_need_connection_message'       => null,
     24    ];
     25
    1226    /** @var OptionProviderInterface Allows access to WordPress core option getting and setting functions */
    1327    public OptionProviderInterface $option_provider;
     
    220234     */
    221235    private function set( string $key, string $value ) : bool {
     236        if ( ! array_key_exists($key, $this->options_values) ) {
     237            return false;
     238        }
    222239        $success = $this->option_provider::update_option( $key, $value );
    223240        if ( $success ) {
    224             $this->{$key} = $value;
     241            $this->options_values[ $key ] = $value;
     242
    225243        }
    226244        return $success;
     
    233251     * @param string $key    Key for the option
    234252     * @param mixed  $default The value to be returned if no value is present in the database
    235      * @param bool   $force check the database again even if we have a value in memoryd value is empty    If true, this will always force a check of the value in the database regardless of what
     253     * @param bool   $force If true, this will always force a check of the value in the database regardless of what
    236254     *                         value this class has
    237255     *
     
    239257     */
    240258    private function get( string $key, $default = null, bool $force = false ) {
    241         if ( isset( $this->{$key} ) && ! $force ) {
    242             return $this->{$key};
    243         }
    244         $this->{$key} = $this->option_provider::get_option( $key, $default ) ?? '';
    245         return $this->{$key};
    246     }
     259        if ( ! array_key_exists($key, $this->options_values) ) {
     260            return null;
     261        }
     262
     263        if ( isset( $this->options_values[ $key ] ) && ! $force ) {
     264            return $this->options_values[ $key ];
     265        }
     266        $this->options_values[ $key ] = $this->option_provider::get_option( $key, $default ) ?? '';
     267        return $this->options_values[ $key ];
     268    }
     269
     270
    247271}
  • grow-for-wp/trunk/inc/Grow/Plugin.php

    r3219838 r3269994  
    1717
    1818    /** @var string|null VERSION */
    19     const VERSION = '1.5.2';
     19    const VERSION = '1.5.3';
    2020
    2121    /** @var Repository */
  • grow-for-wp/trunk/readme.txt

    r3219838 r3269994  
    33Tags: social, sharing, grow, subscribe
    44Requires at least: 5.2
    5 Tested up to: 6.7
     5Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.5.2
     7Stable tag: 1.5.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    104104
    105105# Changelog
     106## 1.5.3 - 2025-04-09
     107- Prevent duplicate script attributes from appearing on Ads Scripts
     108- Increase Priority for loading of Ads Scripts
     109- Prevent accidental dynamic properties in the Options Class leading to php notices
     110- Fix persisting issues with textdomain notice
    106111
    107112## 1.5.2 - 2025-01-08
     
    110115## 1.5.1 - 2024-12-09
    111116 - Prevent plugin from being optimized in some third-party site optimization plugins.
    112  
     117
    113118## 1.5.0 - 2024-07-16
    114119 - Fix issues with blank page appearing when attempting to enable Journey.
    115  - Fix issues with Redirectin plugin when Journey is enabled.
     120 - Fix issues with Redirection plugin when Journey is enabled.
    116121
    117122## 1.4.1 - 2024-06-24
     
    181186  * feat: Add changelog Generation
    182187  * fix: Direct Users to correct Grow Site
     188
  • grow-for-wp/trunk/vendor/composer/InstalledVersions.php

    r3219839 r3269994  
    323323
    324324        $installed = array();
    325         $copiedLocalDir = false;
    326325
    327326        if (self::$canGetVendors) {
     
    332331                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
    333332                    $required = require $vendorDir.'/composer/installed.php';
    334                     self::$installedByVendor[$vendorDir] = $required;
    335                     $installed[] = $required;
    336                     if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    337                         self::$installed = $required;
    338                         $copiedLocalDir = true;
     333                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
     334                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
     335                        self::$installed = $installed[count($installed) - 1];
    339336                    }
    340337                }
     
    354351        }
    355352
    356         if (self::$installed !== array() && !$copiedLocalDir) {
     353        if (self::$installed !== array()) {
    357354            $installed[] = self::$installed;
    358355        }
  • grow-for-wp/trunk/vendor/composer/autoload_classmap.php

    r3205022 r3269994  
    5050    'Grow\\Tests\\Unit\\TestActivation' => $baseDir . '/inc/Grow/Tests/Unit/TestActivation.php',
    5151    'Grow\\Tests\\Unit\\TestAdminPage' => $baseDir . '/inc/Grow/Tests/Unit/TestAdminPage.php',
     52    'Grow\\Tests\\Unit\\TestAdsScript' => $baseDir . '/inc/Grow/Tests/Unit/TestAdsScript.php',
    5253    'Grow\\Tests\\Unit\\TestAdsTxt' => $baseDir . '/inc/Grow/Tests/Unit/TestAdsTxt.php',
    5354    'Grow\\Tests\\Unit\\TestAssetLoader' => $baseDir . '/inc/Grow/Tests/Unit/TestAssetLoader.php',
    5455    'Grow\\Tests\\Unit\\TestGrowRemote' => $baseDir . '/inc/Grow/Tests/Unit/TestGrowRemote.php',
    5556    'Grow\\Tests\\Unit\\TestHook' => $baseDir . '/inc/Grow/Tests/Unit/TestHook.php',
     57    'Grow\\Tests\\Unit\\TestJourneyConfirm' => $baseDir . '/inc/Grow/Tests/Unit/TestJourneyConfirm.php',
    5658    'Grow\\Tests\\Unit\\TestOptions' => $baseDir . '/inc/Grow/Tests/Unit/TestOptions.php',
    5759    'Grow\\Tests\\Unit\\TestPlugin' => $baseDir . '/inc/Grow/Tests/Unit/TestPlugin.php',
  • grow-for-wp/trunk/vendor/composer/autoload_static.php

    r3205022 r3269994  
    6565        'Grow\\Tests\\Unit\\TestActivation' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestActivation.php',
    6666        'Grow\\Tests\\Unit\\TestAdminPage' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestAdminPage.php',
     67        'Grow\\Tests\\Unit\\TestAdsScript' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestAdsScript.php',
    6768        'Grow\\Tests\\Unit\\TestAdsTxt' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestAdsTxt.php',
    6869        'Grow\\Tests\\Unit\\TestAssetLoader' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestAssetLoader.php',
    6970        'Grow\\Tests\\Unit\\TestGrowRemote' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestGrowRemote.php',
    7071        'Grow\\Tests\\Unit\\TestHook' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestHook.php',
     72        'Grow\\Tests\\Unit\\TestJourneyConfirm' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestJourneyConfirm.php',
    7173        'Grow\\Tests\\Unit\\TestOptions' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestOptions.php',
    7274        'Grow\\Tests\\Unit\\TestPlugin' => __DIR__ . '/../..' . '/inc/Grow/Tests/Unit/TestPlugin.php',
  • grow-for-wp/trunk/vendor/composer/installed.php

    r3219839 r3269994  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '3e42a382c18fae06a81d8530ef59b10861e22ec1',
     6        'reference' => '8294166bd4293b48d63ec2adef75e56a5e11ac83',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '3e42a382c18fae06a81d8530ef59b10861e22ec1',
     16            'reference' => '8294166bd4293b48d63ec2adef75e56a5e11ac83',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.