Plugin Directory

Changeset 3354771


Ignore:
Timestamp:
09/02/2025 01:56:00 PM (3 months ago)
Author:
neosinner
Message:

Release 5.14.1

Location:
mailpoet/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • mailpoet/trunk/lang/mailpoet.pot

    r3350424 r3354771  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: MailPoet 5.14.0\n"
     5"Project-Id-Version: MailPoet 5.14.1\n"
    66"Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
    77"Last-Translator: MailPoet i18n (https://www.transifex.com/organization/wysija)\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-08-25T19:08:16+00:00\n"
     12"POT-Creation-Date: 2025-09-01T17:39:39+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    69576957msgstr ""
    69586958
    6959 #: lib/API/JSON/v1/Premium.php:45
    6960 #: lib/API/JSON/v1/Premium.php:80
     6959#: lib/API/JSON/v1/Premium.php:46
     6960#: lib/API/JSON/v1/Premium.php:71
    69616961msgid "Premium key is not valid."
    69626962msgstr ""
    69636963
    6964 #: lib/API/JSON/v1/Premium.php:53
    6965 #: lib/API/JSON/v1/Premium.php:72
     6964#: lib/API/JSON/v1/Premium.php:63
    69666965msgid "Error when installing MailPoet Premium plugin."
    69676966msgstr ""
    69686967
    6969 #: lib/API/JSON/v1/Premium.php:85
     6968#: lib/API/JSON/v1/Premium.php:76
    69706969msgid "Error when activating MailPoet Premium plugin."
    69716970msgstr ""
  • mailpoet/trunk/lib/API/JSON/v1/Premium.php

    r2983550 r3354771  
    99use MailPoet\API\JSON\Error as APIError;
    1010use MailPoet\Config\AccessControl;
     11use MailPoet\Config\Installer;
    1112use MailPoet\Config\ServicesChecker;
    1213use MailPoet\WP\Functions as WPFunctions;
    1314use MailPoet\WPCOM\DotcomHelperFunctions;
    14 use WP_Error;
    1515
    1616class Premium extends APIEndpoint {
     
    2424  ];
    2525
    26   /** @var ServicesChecker */
    27   private $servicesChecker;
     26  private ServicesChecker $servicesChecker;
    2827
    29   /** @var WPFunctions */
    30   private $wp;
     28  private WPFunctions $wp;
    3129
    32   /** @var DotcomHelperFunctions */
    33   private $dotcomHelperFunctions;
     30  private DotcomHelperFunctions $dotcomHelperFunctions;
     31
     32  private Installer $premiumInstaller;
    3433
    3534  public function __construct(
    3635    ServicesChecker $servicesChecker,
    3736    WPFunctions $wp,
    38     DotcomHelperFunctions $dotcomHelperFunctions
     37    DotcomHelperFunctions $dotcomHelperFunctions,
     38    ?Installer $premiumInstaller = null
    3939  ) {
    4040    $this->servicesChecker = $servicesChecker;
    4141    $this->wp = $wp;
    4242    $this->dotcomHelperFunctions = $dotcomHelperFunctions;
     43    $this->premiumInstaller = $premiumInstaller ?? new Installer(Installer::PREMIUM_PLUGIN_SLUG);
    4344  }
    4445
     
    4849      return $this->error(__('Premium key is not valid.', 'mailpoet'));
    4950    }
    50 
    51     $pluginInfo = $this->wp->pluginsApi('plugin_information', [
    52       'slug' => self::PREMIUM_PLUGIN_SLUG,
    53     ]);
    54 
    55     if (!$pluginInfo || $pluginInfo instanceof WP_Error) {
    56       return $this->error(__('Error when installing MailPoet Premium plugin.', 'mailpoet'));
    57     }
    58 
    59     $pluginInfo = (array)$pluginInfo;
    6051
    6152    // If we are in Dotcom platform, we try to symlink the plugin instead of downloading it
     
    7162    }
    7263
    73     $result = $this->wp->installPlugin($pluginInfo['download_link']);
     64    $result = $this->wp->installPlugin($this->premiumInstaller->generatePluginDownloadUrl());
    7465    if ($result !== true) {
    7566      return $this->error(__('Error when installing MailPoet Premium plugin.', 'mailpoet'));
  • mailpoet/trunk/lib/Config/Installer.php

    r3017507 r3354771  
    3434  public function generatePluginDownloadUrl(): string {
    3535    $premiumKey = $this->settings->get(Bridge::PREMIUM_KEY_SETTING_NAME);
    36     return "https://release.mailpoet.com/downloads/mailpoet-premium/$premiumKey/latest/mailpoet-premium.zip";
     36    $freeMinorVersion = self::getFreeMinorVersionZero();
     37    return sprintf(
     38      'https://release.mailpoet.com/downloads/mailpoet-premium/%s/%s/mailpoet-premium.zip',
     39      rawurlencode((string)$premiumKey),
     40      rawurlencode($freeMinorVersion)
     41    );
    3742  }
    3843
     
    101106    return $api->getPluginInformation($this->slug);
    102107  }
     108
     109  private static function getFreeMinorVersionZero(): string {
     110    $version = defined('MAILPOET_VERSION') ? (string)MAILPOET_VERSION : '';
     111    if ($version === '') {
     112      return 'latest';
     113    }
     114
     115    $parts = explode('.', $version);
     116    $major = $parts[0] ?? '0';
     117    $minor = $parts[1] ?? '0';
     118    return $major . '.' . $minor . '.0';
     119  }
    103120}
  • mailpoet/trunk/lib/Segments/SegmentSubscribersRepository.php

    r3254132 r3354771  
    1212use MailPoet\Entities\SubscriberSegmentEntity;
    1313use MailPoet\InvalidStateException;
     14use MailPoet\Logging\LoggerFactory;
    1415use MailPoet\NotFoundException;
    1516use MailPoet\Segments\DynamicSegments\Exceptions\InvalidFilterException;
     
    128129    $queryBuilder = $this->filterSubscribersInDynamicSegment($queryBuilder, $segment, null);
    129130    $statement = $this->executeQuery($queryBuilder);
    130     /** @var array{all:string} $result */
    131131    $result = $statement->fetch();
     132
     133    if (!is_array($result)) {
     134      $result = $this->logErrorAndReturnEmptyResult(null, $queryBuilder, $result);
     135    }
     136
    132137    return (int)$result['all'];
    133138  }
     
    327332    $result = $statement->fetch();
    328333
    329     return $result;
     334    if (is_array($result)) {
     335      return $result;
     336    }
     337
     338    return $this->logErrorAndReturnEmptyResult(null, $queryBuilder, $result);
    330339  }
    331340
     
    480489
    481490    $statement = $this->executeQuery($queryBuilder);
    482     return $statement->fetch();
     491    $result = $statement->fetch();
     492    if (is_array($result)) {
     493      return $result;
     494    }
     495
     496    return $this->logErrorAndReturnEmptyResult($segment, $queryBuilder, $result);
    483497  }
    484498
     
    492506
    493507    $statement = $this->executeQuery($queryBuilder);
    494     return $statement->fetch();
     508    $result = $statement->fetch();
     509    if (is_array($result)) {
     510      return $result;
     511    }
     512
     513    return $this->logErrorAndReturnEmptyResult($segment, $queryBuilder, $result);
     514  }
     515
     516  /**
     517   * @param null|SegmentEntity $segment
     518   * @param QueryBuilder $queryBuilder
     519   * @param mixed $result
     520   * @return int[]
     521   */
     522  private function logErrorAndReturnEmptyResult(?SegmentEntity $segment, QueryBuilder $queryBuilder, $result): array {
     523    $logger = LoggerFactory::getInstance()->getLogger(LoggerFactory::TOPIC_SEGMENTS);
     524    $logger->error('Invalid result for segment statistics count', [
     525      'segment_id' => $segment ? $segment->getId() : null,
     526      'result' => $result,
     527      'query' => $queryBuilder->getSQL(),
     528    ]);
     529
     530    return [
     531      'all' => 0,
     532      'trash' => 0,
     533      'subscribed' => 0,
     534      'unsubscribed' => 0,
     535      'inactive' => 0,
     536      'unconfirmed' => 0,
     537      'bounced' => 0,
     538    ];
    495539  }
    496540}
  • mailpoet/trunk/mailpoet.php

    r3350424 r3354771  
    66/*
    77 * Plugin Name: MailPoet
    8  * Version: 5.14.0
     8 * Version: 5.14.1
    99 * Plugin URI: https://www.mailpoet.com
    1010 * Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
     
    2424
    2525$mailpoetPlugin = [
    26   'version' => '5.14.0',
     26  'version' => '5.14.1',
    2727  'filename' => __FILE__,
    2828  'path' => dirname(__FILE__),
  • mailpoet/trunk/readme.txt

    r3350424 r3354771  
    44Requires at least: 6.7
    55Tested up to: 6.8
    6 Stable tag: 5.14.0
     6Stable tag: 5.14.1
    77Requires PHP: 7.4
    88License: GPLv3
     
    228228== Changelog ==
    229229
    230 = 5.14.0 - 2025-08-25 =
    231 * Updated: Update the email editor version;
    232 * Fixed: Fix: license expiration notice was displayed only on the Plugins page; it now appears on all MailPoet admin pages;
    233 * Fixed: Fix the error "Call to a member function format on null"..
     230= 5.14.1 - 2025-09-01 =
     231* Improved: Use specific version when downloading premium plugin.
    234232
    235233[See the changelog for all versions.](https://github.com/mailpoet/mailpoet/blob/trunk/mailpoet/changelog.txt)
  • mailpoet/trunk/vendor/composer/installed.php

    r3350424 r3354771  
    66 'pretty_version' => 'dev-trunk',
    77 'version' => 'dev-trunk',
    8  'reference' => '38d0fc05e6d78c2a372e689d7358021e834ddf69',
     8 'reference' => 'aedf8f4c5c21ce058e3fe283df12b423a801acd7',
    99 'type' => 'library',
    1010 'install_path' => __DIR__ . '/../../',
     
    1616 'pretty_version' => 'dev-trunk',
    1717 'version' => 'dev-trunk',
    18  'reference' => '38d0fc05e6d78c2a372e689d7358021e834ddf69',
     18 'reference' => 'aedf8f4c5c21ce058e3fe283df12b423a801acd7',
    1919 'type' => 'library',
    2020 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.