Changeset 3354771
- Timestamp:
- 09/02/2025 01:56:00 PM (3 months ago)
- Location:
- mailpoet/trunk
- Files:
-
- 7 edited
-
lang/mailpoet.pot (modified) (3 diffs)
-
lib/API/JSON/v1/Premium.php (modified) (4 diffs)
-
lib/Config/Installer.php (modified) (2 diffs)
-
lib/Segments/SegmentSubscribersRepository.php (modified) (5 diffs)
-
mailpoet.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mailpoet/trunk/lang/mailpoet.pot
r3350424 r3354771 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: MailPoet 5.14. 0\n"5 "Project-Id-Version: MailPoet 5.14.1\n" 6 6 "Report-Msgid-Bugs-To: http://support.mailpoet.com/\n" 7 7 "Last-Translator: MailPoet i18n (https://www.transifex.com/organization/wysija)\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-0 8-25T19:08:16+00:00\n"12 "POT-Creation-Date: 2025-09-01T17:39:39+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.10.0\n" … … 6957 6957 msgstr "" 6958 6958 6959 #: lib/API/JSON/v1/Premium.php:4 56960 #: lib/API/JSON/v1/Premium.php: 806959 #: lib/API/JSON/v1/Premium.php:46 6960 #: lib/API/JSON/v1/Premium.php:71 6961 6961 msgid "Premium key is not valid." 6962 6962 msgstr "" 6963 6963 6964 #: lib/API/JSON/v1/Premium.php:53 6965 #: lib/API/JSON/v1/Premium.php:72 6964 #: lib/API/JSON/v1/Premium.php:63 6966 6965 msgid "Error when installing MailPoet Premium plugin." 6967 6966 msgstr "" 6968 6967 6969 #: lib/API/JSON/v1/Premium.php: 856968 #: lib/API/JSON/v1/Premium.php:76 6970 6969 msgid "Error when activating MailPoet Premium plugin." 6971 6970 msgstr "" -
mailpoet/trunk/lib/API/JSON/v1/Premium.php
r2983550 r3354771 9 9 use MailPoet\API\JSON\Error as APIError; 10 10 use MailPoet\Config\AccessControl; 11 use MailPoet\Config\Installer; 11 12 use MailPoet\Config\ServicesChecker; 12 13 use MailPoet\WP\Functions as WPFunctions; 13 14 use MailPoet\WPCOM\DotcomHelperFunctions; 14 use WP_Error;15 15 16 16 class Premium extends APIEndpoint { … … 24 24 ]; 25 25 26 /** @var ServicesChecker */ 27 private $servicesChecker; 26 private ServicesChecker $servicesChecker; 28 27 29 /** @var WPFunctions */ 30 private $wp; 28 private WPFunctions $wp; 31 29 32 /** @var DotcomHelperFunctions */ 33 private $dotcomHelperFunctions; 30 private DotcomHelperFunctions $dotcomHelperFunctions; 31 32 private Installer $premiumInstaller; 34 33 35 34 public function __construct( 36 35 ServicesChecker $servicesChecker, 37 36 WPFunctions $wp, 38 DotcomHelperFunctions $dotcomHelperFunctions 37 DotcomHelperFunctions $dotcomHelperFunctions, 38 ?Installer $premiumInstaller = null 39 39 ) { 40 40 $this->servicesChecker = $servicesChecker; 41 41 $this->wp = $wp; 42 42 $this->dotcomHelperFunctions = $dotcomHelperFunctions; 43 $this->premiumInstaller = $premiumInstaller ?? new Installer(Installer::PREMIUM_PLUGIN_SLUG); 43 44 } 44 45 … … 48 49 return $this->error(__('Premium key is not valid.', 'mailpoet')); 49 50 } 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;60 51 61 52 // If we are in Dotcom platform, we try to symlink the plugin instead of downloading it … … 71 62 } 72 63 73 $result = $this->wp->installPlugin($ pluginInfo['download_link']);64 $result = $this->wp->installPlugin($this->premiumInstaller->generatePluginDownloadUrl()); 74 65 if ($result !== true) { 75 66 return $this->error(__('Error when installing MailPoet Premium plugin.', 'mailpoet')); -
mailpoet/trunk/lib/Config/Installer.php
r3017507 r3354771 34 34 public function generatePluginDownloadUrl(): string { 35 35 $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 ); 37 42 } 38 43 … … 101 106 return $api->getPluginInformation($this->slug); 102 107 } 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 } 103 120 } -
mailpoet/trunk/lib/Segments/SegmentSubscribersRepository.php
r3254132 r3354771 12 12 use MailPoet\Entities\SubscriberSegmentEntity; 13 13 use MailPoet\InvalidStateException; 14 use MailPoet\Logging\LoggerFactory; 14 15 use MailPoet\NotFoundException; 15 16 use MailPoet\Segments\DynamicSegments\Exceptions\InvalidFilterException; … … 128 129 $queryBuilder = $this->filterSubscribersInDynamicSegment($queryBuilder, $segment, null); 129 130 $statement = $this->executeQuery($queryBuilder); 130 /** @var array{all:string} $result */131 131 $result = $statement->fetch(); 132 133 if (!is_array($result)) { 134 $result = $this->logErrorAndReturnEmptyResult(null, $queryBuilder, $result); 135 } 136 132 137 return (int)$result['all']; 133 138 } … … 327 332 $result = $statement->fetch(); 328 333 329 return $result; 334 if (is_array($result)) { 335 return $result; 336 } 337 338 return $this->logErrorAndReturnEmptyResult(null, $queryBuilder, $result); 330 339 } 331 340 … … 480 489 481 490 $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); 483 497 } 484 498 … … 492 506 493 507 $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 ]; 495 539 } 496 540 } -
mailpoet/trunk/mailpoet.php
r3350424 r3354771 6 6 /* 7 7 * Plugin Name: MailPoet 8 * Version: 5.14. 08 * Version: 5.14.1 9 9 * Plugin URI: https://www.mailpoet.com 10 10 * Description: Create and send newsletters, post notifications and welcome emails from your WordPress. … … 24 24 25 25 $mailpoetPlugin = [ 26 'version' => '5.14. 0',26 'version' => '5.14.1', 27 27 'filename' => __FILE__, 28 28 'path' => dirname(__FILE__), -
mailpoet/trunk/readme.txt
r3350424 r3354771 4 4 Requires at least: 6.7 5 5 Tested up to: 6.8 6 Stable tag: 5.14. 06 Stable tag: 5.14.1 7 7 Requires PHP: 7.4 8 8 License: GPLv3 … … 228 228 == Changelog == 229 229 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. 234 232 235 233 [See the changelog for all versions.](https://github.com/mailpoet/mailpoet/blob/trunk/mailpoet/changelog.txt) -
mailpoet/trunk/vendor/composer/installed.php
r3350424 r3354771 6 6 'pretty_version' => 'dev-trunk', 7 7 'version' => 'dev-trunk', 8 'reference' => ' 38d0fc05e6d78c2a372e689d7358021e834ddf69',8 'reference' => 'aedf8f4c5c21ce058e3fe283df12b423a801acd7', 9 9 'type' => 'library', 10 10 'install_path' => __DIR__ . '/../../', … … 16 16 'pretty_version' => 'dev-trunk', 17 17 'version' => 'dev-trunk', 18 'reference' => ' 38d0fc05e6d78c2a372e689d7358021e834ddf69',18 'reference' => 'aedf8f4c5c21ce058e3fe283df12b423a801acd7', 19 19 'type' => 'library', 20 20 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.