Changeset 3358498
- Timestamp:
- 09/09/2025 10:39:24 AM (7 months ago)
- Location:
- mailpoet/trunk
- Files:
-
- 2 added
- 17 edited
-
generated/FreeCachedContainer.php (modified) (2 diffs)
-
lang/mailpoet.pot (modified) (3 diffs)
-
lib/AdminPages/Pages/DynamicSegments.php (modified) (1 diff)
-
lib/Analytics/Reporter.php (modified) (1 diff)
-
lib/Captcha/CaptchaFormRenderer.php (modified) (6 diffs)
-
lib/Cron/CronWorkerScheduler.php (modified) (1 diff)
-
lib/Cron/Daemon.php (modified) (1 diff)
-
lib/Cron/Workers/LogCleanup.php (added)
-
lib/Cron/Workers/WorkersFactory.php (modified) (2 diffs)
-
lib/DI/ContainerConfigurator.php (modified) (1 diff)
-
lib/EmailEditor/Integrations/MailPoet/Blocks/BlockTypes/PoweredByMailpoet.php (modified) (1 diff)
-
lib/Form/AssetsController.php (modified) (1 diff)
-
lib/Form/Block/Image.php (modified) (2 diffs)
-
lib/Logging/LogHandler.php (modified) (3 diffs)
-
lib/Logging/LogRepository.php (modified) (2 diffs)
-
lib/Migrations/Db/Migration_20250903_151331_Db.php (added)
-
mailpoet.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mailpoet/trunk/generated/FreeCachedContainer.php
r3350424 r3358498 265 265 'MailPoet\\Cron\\Workers\\KeyCheck\\PremiumKeyCheck' => 'getPremiumKeyCheckService', 266 266 'MailPoet\\Cron\\Workers\\KeyCheck\\SendingServiceKeyCheck' => 'getSendingServiceKeyCheckService', 267 'MailPoet\\Cron\\Workers\\LogCleanup' => 'getLogCleanupService', 267 268 'MailPoet\\Cron\\Workers\\Mixpanel' => 'getMixpanelService', 268 269 'MailPoet\\Cron\\Workers\\NewsletterTemplateThumbnails' => 'getNewsletterTemplateThumbnailsService', … … 3152 3153 3153 3154 /** 3155 * Gets the public 'MailPoet\Cron\Workers\LogCleanup' shared autowired service. 3156 * 3157 * @return \MailPoet\Cron\Workers\LogCleanup 3158 */ 3159 protected function getLogCleanupService() 3160 { 3161 return $this->services['MailPoet\\Cron\\Workers\\LogCleanup'] = new \MailPoet\Cron\Workers\LogCleanup(($this->services['MailPoet\\Logging\\LogRepository'] ?? $this->getLogRepositoryService())); 3162 } 3163 3164 /** 3154 3165 * Gets the public 'MailPoet\Cron\Workers\Mixpanel' shared autowired service. 3155 3166 * -
mailpoet/trunk/lang/mailpoet.pot
r3354771 r3358498 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: MailPoet 5.14. 1\n"5 "Project-Id-Version: MailPoet 5.14.2\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-09-0 1T17:39:39+00:00\n"12 "POT-Creation-Date: 2025-09-09T07:26:19+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" … … 8780 8780 msgstr "" 8781 8781 8782 #: lib/Captcha/CaptchaFormRenderer.php:11 28782 #: lib/Captcha/CaptchaFormRenderer.php:113 8783 8783 msgid "Subscribe" 8784 8784 msgstr "" 8785 8785 8786 #: lib/Captcha/CaptchaFormRenderer.php:15 78786 #: lib/Captcha/CaptchaFormRenderer.php:159 8787 8787 msgid "Type in the characters you see in the picture above:" 8788 8788 msgstr "" 8789 8789 8790 #: lib/Captcha/CaptchaFormRenderer.php:19 78790 #: lib/Captcha/CaptchaFormRenderer.php:199 8791 8791 msgid "CAPTCHA" 8792 8792 msgstr "" 8793 8793 8794 #: lib/Captcha/CaptchaFormRenderer.php: 1998794 #: lib/Captcha/CaptchaFormRenderer.php:201 8795 8795 msgid "Reload CAPTCHA" 8796 8796 msgstr "" 8797 8797 8798 #: lib/Captcha/CaptchaFormRenderer.php:20 08798 #: lib/Captcha/CaptchaFormRenderer.php:202 8799 8799 msgid "Play CAPTCHA" 8800 8800 msgstr "" 8801 8801 8802 #: lib/Captcha/CaptchaFormRenderer.php:22 78802 #: lib/Captcha/CaptchaFormRenderer.php:229 8803 8803 msgid "The characters you entered did not match the CAPTCHA image. Please try again with this new image." 8804 8804 msgstr "" -
mailpoet/trunk/lib/AdminPages/Pages/DynamicSegments.php
r3254132 r3358498 147 147 ); 148 148 149 if ( !isset($attributeTerms['errors'])) {149 if ((!$attributeTerms instanceof \WP_Error) && !isset($attributeTerms['errors'])) { 150 150 $data['product_attributes'][$taxonomy] = [ // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps 151 151 'id' => $attribute->attribute_id, // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps -
mailpoet/trunk/lib/Analytics/Reporter.php
r3328158 r3358498 189 189 'Open and click tracking' => $this->trackingConfig->isEmailTrackingEnabled(), 190 190 'Tracking level' => $this->settings->get('tracking.level', TrackingConfig::LEVEL_FULL), 191 'Logging level' => $this->settings->get('logging', 'errors'), 191 192 'Premium key valid' => $this->servicesChecker->isPremiumKeyValid(), 192 193 'New subscriber notifications' => NewSubscriberNotificationMailer::isDisabled($this->settings->get(NewSubscriberNotificationMailer::SETTINGS_KEY)), -
mailpoet/trunk/lib/Captcha/CaptchaFormRenderer.php
r3254132 r3358498 67 67 } 68 68 69 if ($data['referrer_form'] == CaptchaUrlFactory::REFERER_MP_FORM) { 69 $ref = $data['referrer_form'] ?? null; 70 if ($ref === CaptchaUrlFactory::REFERER_MP_FORM) { 70 71 return $this->renderFormInSubscriptionForm($sessionId); 71 } elseif ($ data['referrer_form']== CaptchaUrlFactory::REFERER_WP_FORM) {72 } elseif ($ref === CaptchaUrlFactory::REFERER_WP_FORM) { 72 73 return $this->renderFormInWPRegisterForm($data, 'wp-submit'); 73 } elseif ($ data['referrer_form']== CaptchaUrlFactory::REFERER_WC_FORM) {74 } elseif ($ref === CaptchaUrlFactory::REFERER_WC_FORM) { 74 75 return $this->renderFormInWPRegisterForm($data, 'register'); 75 76 } … … 106 107 $hiddenFields .= '<input type="hidden" name="endpoint" value="subscribers" />'; 107 108 $hiddenFields .= '<input type="hidden" name="mailpoet_method" value="subscribe" />'; 108 $hiddenFields .= '<input type="hidden" name="mailpoet_redirect" value="' . $this->wp->esc Attr($redirectUrl) . '" />';109 $hiddenFields .= '<input type="hidden" name="mailpoet_redirect" value="' . $this->wp->escUrl($redirectUrl) . '" />'; 109 110 110 111 $actionUrl = admin_url('admin-post.php?action=mailpoet_subscription_form'); … … 135 136 unset($data['referrer_form']); 136 137 foreach ($data as $key => $value) { 137 $hiddenFields .= '<input type="hidden" name="' . $key . '" value="' . $this->wp->escAttr($value) . '" />'; 138 if (!is_scalar($value)) continue; 139 $hiddenFields .= '<input type="hidden" name="' . $this->wp->escAttr($key) . '" value="' . $this->wp->escAttr($value) . '" />'; 138 140 } 139 141 … … 186 188 } 187 189 188 $formHtml = '<form method="POST" action="' . $this->wp->esc Attr($actionUrl) . '" class="' . $this->wp->escAttr($classes) . '" id="mailpoet_captcha_form" novalidate>';190 $formHtml = '<form method="POST" action="' . $this->wp->escUrl($actionUrl) . '" class="' . $this->wp->escAttr($classes) . '" id="mailpoet_captcha_form" novalidate>'; 189 191 $formHtml .= $hiddenFields; 190 192 … … 198 200 $formHtml .= '<div class="mailpoet_form_hide_on_success">'; 199 201 $formHtml .= '<p class="mailpoet_paragraph">'; 200 $formHtml .= '<img class="mailpoet_captcha" src="' . $this->wp->esc Attr($captchaUrl) . '" width="' . $this->wp->escAttr($width) . '" height="' . $this->wp->escAttr($height) . '" title="' . esc_attr__('CAPTCHA', 'mailpoet') . '" />';202 $formHtml .= '<img class="mailpoet_captcha" src="' . $this->wp->escUrl($captchaUrl) . '" width="' . $this->wp->escAttr($width) . '" height="' . $this->wp->escAttr($height) . '" title="' . esc_attr__('CAPTCHA', 'mailpoet') . '" />'; 201 203 $formHtml .= '</p>'; 202 $formHtml .= '<button type="button" class="mailpoet_icon_button mailpoet_captcha_update" title="' . esc_attr(__('Reload CAPTCHA', 'mailpoet')) . '"><img src="' . $this->wp->esc Attr($reloadIcon) . '" alt="" /></button>';203 $formHtml .= '<button type="button" class="mailpoet_icon_button mailpoet_captcha_audio" title="' . esc_attr(__('Play CAPTCHA', 'mailpoet')) . '"><img src="' . $this->wp->esc Attr($playIcon) . '" alt="" /></button>';204 $formHtml .= '<button type="button" class="mailpoet_icon_button mailpoet_captcha_update" title="' . esc_attr(__('Reload CAPTCHA', 'mailpoet')) . '"><img src="' . $this->wp->escUrl($reloadIcon) . '" alt="" /></button>'; 205 $formHtml .= '<button type="button" class="mailpoet_icon_button mailpoet_captcha_audio" title="' . esc_attr(__('Play CAPTCHA', 'mailpoet')) . '"><img src="' . $this->wp->escUrl($playIcon) . '" alt="" /></button>'; 204 206 $formHtml .= '<audio class="mailpoet_captcha_player">'; 205 $formHtml .= '<source src="' . $this->wp->esc Attr($mp3CaptchaUrl) . '" type="audio/mpeg">';207 $formHtml .= '<source src="' . $this->wp->escUrl($mp3CaptchaUrl) . '" type="audio/mpeg">'; 206 208 $formHtml .= '</audio>'; 207 209 … … 230 232 $errorMessage = __('The characters you entered did not match the CAPTCHA image. Please try again with this new image.', 'mailpoet'); 231 233 234 $success = isset($settings['success_message']) ? (string)$settings['success_message'] : ''; 235 232 236 $formHtml = '<div class="mailpoet_message" role="alert" aria-live="assertive">'; 233 $formHtml .= '<p class="mailpoet_validate_success" ' . ($showSuccessMessage ? '' : ' style="display:none;"') . '>' . $this->wp->escHtml($s ettings['success_message']) . '</p>';237 $formHtml .= '<p class="mailpoet_validate_success" ' . ($showSuccessMessage ? '' : ' style="display:none;"') . '>' . $this->wp->escHtml($success) . '</p>'; 234 238 $formHtml .= '<p class="mailpoet_validate_error" ' . ($showErrorMessage ? '' : ' style="display:none;"') . '>' . $this->wp->escHtml($errorMessage) . '</p>'; 235 239 $formHtml .= '</div>'; -
mailpoet/trunk/lib/Cron/CronWorkerScheduler.php
r3138648 r3358498 42 42 return $alreadyScheduled; 43 43 } 44 return $this->createAndPersistTask($taskType, $nextRunDate, $priority); 45 } 46 47 public function scheduleMultiple($taskType, $nextRunDate, $priority = ScheduledTaskEntity::PRIORITY_LOW): ScheduledTaskEntity { 48 // Allow multiple tasks of the same type with different run dates 49 return $this->createAndPersistTask($taskType, $nextRunDate, $priority); 50 } 51 52 private function createAndPersistTask($taskType, $nextRunDate, $priority): ScheduledTaskEntity { 44 53 $task = new ScheduledTaskEntity(); 45 54 $task->setType($taskType); -
mailpoet/trunk/lib/Cron/Daemon.php
r3209644 r3358498 100 100 yield $this->workersFactory->createBounceWorker(); 101 101 yield $this->workersFactory->createExportFilesCleanupWorker(); 102 yield $this->workersFactory->createLogCleanupWorker(); 102 103 yield $this->workersFactory->createSubscribersEmailCountsWorker(); 103 104 yield $this->workersFactory->createInactiveSubscribersWorker(); -
mailpoet/trunk/lib/Cron/Workers/WorkersFactory.php
r3218389 r3358498 36 36 Mixpanel::TASK_TYPE, 37 37 AbandonedCartWorker::TASK_TYPE, 38 LogCleanup::TASK_TYPE, 38 39 ]; 39 40 … … 90 91 public function createExportFilesCleanupWorker() { 91 92 return $this->container->get(ExportFilesCleanup::class); 93 } 94 95 /** @return LogCleanup */ 96 public function createLogCleanupWorker() { 97 return $this->container->get(LogCleanup::class); 92 98 } 93 99 -
mailpoet/trunk/lib/DI/ContainerConfigurator.php
r3350424 r3358498 326 326 $container->autowire(\MailPoet\Cron\Workers\WooCommerceSync::class)->setPublic(true); 327 327 $container->autowire(\MailPoet\Cron\Workers\ExportFilesCleanup::class)->setPublic(true); 328 $container->autowire(\MailPoet\Cron\Workers\LogCleanup::class)->setPublic(true); 328 329 $container->autowire(\MailPoet\Cron\Workers\SubscribersEmailCount::class)->setPublic(true); 329 330 $container->autowire(\MailPoet\Cron\Workers\InactiveSubscribers::class)->setPublic(true); -
mailpoet/trunk/lib/EmailEditor/Integrations/MailPoet/Blocks/BlockTypes/PoweredByMailpoet.php
r3350424 r3358498 33 33 '<div class="%1$s" style="text-align:center">%2$s</div>', 34 34 esc_attr('wp-block-' . $this->blockName), 35 '<img src="' . esc_ attr($logoUrl) . '" alt="Powered by MailPoet" width="100px" />'35 '<img src="' . esc_url($logoUrl) . '" alt="Powered by MailPoet" width="100px" />' 36 36 ), $block->parsed_block['email_attrs'] ?? []); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps 37 37 } -
mailpoet/trunk/lib/Form/AssetsController.php
r3209644 r3358498 42 42 $captcha = $this->settings->get('captcha'); 43 43 if (!empty($captcha['type']) && CaptchaConstants::isReCaptcha($captcha['type'])) { 44 echo '<script src="' . esc_ attr(self::RECAPTCHA_API_URL) . '" async defer></script>';44 echo '<script src="' . esc_url(self::RECAPTCHA_API_URL) . '" async defer></script>'; 45 45 } 46 46 -
mailpoet/trunk/lib/Form/Block/Image.php
r3169194 r3358498 34 34 $attributes = []; 35 35 $styles = []; 36 $attributes[] = 'src="' . $this->wp->esc Attr($params['url']) . '"';36 $attributes[] = 'src="' . $this->wp->escUrl($params['url']) . '"'; 37 37 $attributes[] = $params['alt'] ? 'alt="' . $this->wp->escAttr($params['alt']) . '"' : 'alt'; 38 38 if ($params['title']) { … … 78 78 79 79 private function wrapToLink(array $params, string $img): string { 80 $attributes = ['href="' . $this->wp->esc Attr($params['href']) . '"'];80 $attributes = ['href="' . $this->wp->escUrl($params['href']) . '"']; 81 81 if ($params['link_class']) { 82 82 $attributes[] = 'class="' . $this->wp->escAttr($params['link_class']) . '"'; -
mailpoet/trunk/lib/Logging/LogHandler.php
r3005646 r3358498 10 10 11 11 class LogHandler extends AbstractProcessingHandler { 12 /**13 * Logs older than this many days will be deleted14 */15 const DAYS_TO_KEEP_LOGS = 30;16 17 /**18 * How many records to delete on one run of purge routine19 */20 const PURGE_LIMIT = 1000;21 22 /**23 * Percentage value, what is the probability of running purge routine24 * @var int25 */26 const LOG_PURGE_PROBABILITY = 5;27 28 /** @var callable|null */29 private $randFunction;30 12 31 13 /** @var LogRepository */ … … 35 17 LogRepository $logRepository, 36 18 $level = \MailPoetVendor\Monolog\Logger::DEBUG, 37 $bubble = \true, 38 $randFunction = null 19 $bubble = \true 39 20 ) { 40 21 parent::__construct($level, $bubble); 41 $this->randFunction = $randFunction;42 22 $this->logRepository = $logRepository; 43 23 } … … 53 33 $entity->setContext($record['context']); 54 34 $this->logRepository->saveLog($entity); 55 56 if ($this->getRandom() <= self::LOG_PURGE_PROBABILITY) {57 $this->purgeOldLogs();58 }59 }60 61 private function getRandom() {62 if ($this->randFunction) {63 return call_user_func($this->randFunction, 0, 100);64 }65 return rand(0, 100);66 }67 68 private function purgeOldLogs() {69 $this->logRepository->purgeOldLogs(self::DAYS_TO_KEEP_LOGS, self::PURGE_LIMIT);70 35 } 71 36 } -
mailpoet/trunk/lib/Logging/LogRepository.php
r3254132 r3358498 94 94 } 95 95 96 public function purgeOldLogs(int $daysToKeepLogs, int $limit = 1000) {96 public function purgeOldLogs(int $daysToKeepLogs, int $limit = 1000): int { 97 97 $logsTable = $this->entityManager->getClassMetadata(LogEntity::class)->getTableName(); 98 $ this->entityManager->getConnection()->executeStatement(98 $result = $this->entityManager->getConnection()->executeStatement( 99 99 " 100 DELETE FROM $logsTable100 DELETE FROM `{$logsTable}` 101 101 WHERE `created_at` < :date 102 ORDER BY `id` ASC LIMIT :limit 102 ORDER BY `created_at` ASC, `id` ASC 103 LIMIT :limit 103 104 ", 104 105 [ … … 111 112 ] 112 113 ); 114 115 return (int)$result; 113 116 } 114 117 -
mailpoet/trunk/mailpoet.php
r3354771 r3358498 6 6 /* 7 7 * Plugin Name: MailPoet 8 * Version: 5.14. 18 * Version: 5.14.2 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. 1',26 'version' => '5.14.2', 27 27 'filename' => __FILE__, 28 28 'path' => dirname(__FILE__), -
mailpoet/trunk/readme.txt
r3354771 r3358498 4 4 Requires at least: 6.7 5 5 Tested up to: 6.8 6 Stable tag: 5.14. 16 Stable tag: 5.14.2 7 7 Requires PHP: 7.4 8 8 License: GPLv3 … … 228 228 == Changelog == 229 229 230 = 5.14.1 - 2025-09-01 = 231 * Improved: Use specific version when downloading premium plugin. 230 = 5.14.2 - 2025-09-09 = 231 * Improved: Optimized log cleanup by moving it to a dedicated recurring task.; 232 * Improved: Enhanced CAPTCHA form HTML output processing; 233 * Fixed: Invalid product attributes may break the Segments page. 232 234 233 235 [See the changelog for all versions.](https://github.com/mailpoet/mailpoet/blob/trunk/mailpoet/changelog.txt) -
mailpoet/trunk/vendor/composer/installed.php
r3354771 r3358498 6 6 'pretty_version' => 'dev-trunk', 7 7 'version' => 'dev-trunk', 8 'reference' => ' aedf8f4c5c21ce058e3fe283df12b423a801acd7',8 'reference' => '83548afce56cbf857c32a5dfded296868e43afa2', 9 9 'type' => 'library', 10 10 'install_path' => __DIR__ . '/../../', … … 16 16 'pretty_version' => 'dev-trunk', 17 17 'version' => 'dev-trunk', 18 'reference' => ' aedf8f4c5c21ce058e3fe283df12b423a801acd7',18 'reference' => '83548afce56cbf857c32a5dfded296868e43afa2', 19 19 'type' => 'library', 20 20 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.