Plugin Directory

Changeset 3358498


Ignore:
Timestamp:
09/09/2025 10:39:24 AM (7 months ago)
Author:
costasovo
Message:

Release 5.14.2

Location:
mailpoet/trunk
Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • mailpoet/trunk/generated/FreeCachedContainer.php

    r3350424 r3358498  
    265265            'MailPoet\\Cron\\Workers\\KeyCheck\\PremiumKeyCheck' => 'getPremiumKeyCheckService',
    266266            'MailPoet\\Cron\\Workers\\KeyCheck\\SendingServiceKeyCheck' => 'getSendingServiceKeyCheckService',
     267            'MailPoet\\Cron\\Workers\\LogCleanup' => 'getLogCleanupService',
    267268            'MailPoet\\Cron\\Workers\\Mixpanel' => 'getMixpanelService',
    268269            'MailPoet\\Cron\\Workers\\NewsletterTemplateThumbnails' => 'getNewsletterTemplateThumbnailsService',
     
    31523153
    31533154    /**
     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    /**
    31543165     * Gets the public 'MailPoet\Cron\Workers\Mixpanel' shared autowired service.
    31553166     *
  • mailpoet/trunk/lang/mailpoet.pot

    r3354771 r3358498  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: MailPoet 5.14.1\n"
     5"Project-Id-Version: MailPoet 5.14.2\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-09-01T17:39:39+00:00\n"
     12"POT-Creation-Date: 2025-09-09T07:26:19+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    87808780msgstr ""
    87818781
    8782 #: lib/Captcha/CaptchaFormRenderer.php:112
     8782#: lib/Captcha/CaptchaFormRenderer.php:113
    87838783msgid "Subscribe"
    87848784msgstr ""
    87858785
    8786 #: lib/Captcha/CaptchaFormRenderer.php:157
     8786#: lib/Captcha/CaptchaFormRenderer.php:159
    87878787msgid "Type in the characters you see in the picture above:"
    87888788msgstr ""
    87898789
    8790 #: lib/Captcha/CaptchaFormRenderer.php:197
     8790#: lib/Captcha/CaptchaFormRenderer.php:199
    87918791msgid "CAPTCHA"
    87928792msgstr ""
    87938793
    8794 #: lib/Captcha/CaptchaFormRenderer.php:199
     8794#: lib/Captcha/CaptchaFormRenderer.php:201
    87958795msgid "Reload CAPTCHA"
    87968796msgstr ""
    87978797
    8798 #: lib/Captcha/CaptchaFormRenderer.php:200
     8798#: lib/Captcha/CaptchaFormRenderer.php:202
    87998799msgid "Play CAPTCHA"
    88008800msgstr ""
    88018801
    8802 #: lib/Captcha/CaptchaFormRenderer.php:227
     8802#: lib/Captcha/CaptchaFormRenderer.php:229
    88038803msgid "The characters you entered did not match the CAPTCHA image. Please try again with this new image."
    88048804msgstr ""
  • mailpoet/trunk/lib/AdminPages/Pages/DynamicSegments.php

    r3254132 r3358498  
    147147        );
    148148
    149         if (!isset($attributeTerms['errors'])) {
     149        if ((!$attributeTerms instanceof \WP_Error) && !isset($attributeTerms['errors'])) {
    150150          $data['product_attributes'][$taxonomy] = [ // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
    151151            'id' => $attribute->attribute_id, // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
  • mailpoet/trunk/lib/Analytics/Reporter.php

    r3328158 r3358498  
    189189      'Open and click tracking' => $this->trackingConfig->isEmailTrackingEnabled(),
    190190      'Tracking level' => $this->settings->get('tracking.level', TrackingConfig::LEVEL_FULL),
     191      'Logging level' => $this->settings->get('logging', 'errors'),
    191192      'Premium key valid' => $this->servicesChecker->isPremiumKeyValid(),
    192193      'New subscriber notifications' => NewSubscriberNotificationMailer::isDisabled($this->settings->get(NewSubscriberNotificationMailer::SETTINGS_KEY)),
  • mailpoet/trunk/lib/Captcha/CaptchaFormRenderer.php

    r3254132 r3358498  
    6767    }
    6868
    69     if ($data['referrer_form'] == CaptchaUrlFactory::REFERER_MP_FORM) {
     69    $ref = $data['referrer_form'] ?? null;
     70    if ($ref === CaptchaUrlFactory::REFERER_MP_FORM) {
    7071      return $this->renderFormInSubscriptionForm($sessionId);
    71     } elseif ($data['referrer_form'] == CaptchaUrlFactory::REFERER_WP_FORM) {
     72    } elseif ($ref === CaptchaUrlFactory::REFERER_WP_FORM) {
    7273      return $this->renderFormInWPRegisterForm($data, 'wp-submit');
    73     } elseif ($data['referrer_form'] == CaptchaUrlFactory::REFERER_WC_FORM) {
     74    } elseif ($ref === CaptchaUrlFactory::REFERER_WC_FORM) {
    7475      return $this->renderFormInWPRegisterForm($data, 'register');
    7576    }
     
    106107    $hiddenFields .= '<input type="hidden" name="endpoint" value="subscribers" />';
    107108    $hiddenFields .= '<input type="hidden" name="mailpoet_method" value="subscribe" />';
    108     $hiddenFields .= '<input type="hidden" name="mailpoet_redirect" value="' . $this->wp->escAttr($redirectUrl) . '" />';
     109    $hiddenFields .= '<input type="hidden" name="mailpoet_redirect" value="' . $this->wp->escUrl($redirectUrl) . '" />';
    109110
    110111    $actionUrl = admin_url('admin-post.php?action=mailpoet_subscription_form');
     
    135136    unset($data['referrer_form']);
    136137    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) . '" />';
    138140    }
    139141
     
    186188    }
    187189
    188     $formHtml = '<form method="POST" action="' . $this->wp->escAttr($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>';
    189191    $formHtml .= $hiddenFields;
    190192
     
    198200    $formHtml .= '<div class="mailpoet_form_hide_on_success">';
    199201    $formHtml .= '<p class="mailpoet_paragraph">';
    200     $formHtml .= '<img class="mailpoet_captcha" src="' . $this->wp->escAttr($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') . '" />';
    201203    $formHtml .= '</p>';
    202     $formHtml .= '<button type="button" class="mailpoet_icon_button mailpoet_captcha_update" title="' . esc_attr(__('Reload CAPTCHA', 'mailpoet')) . '"><img src="' . $this->wp->escAttr($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->escAttr($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>';
    204206    $formHtml .= '<audio class="mailpoet_captcha_player">';
    205     $formHtml .= '<source src="' . $this->wp->escAttr($mp3CaptchaUrl) . '" type="audio/mpeg">';
     207    $formHtml .= '<source src="' . $this->wp->escUrl($mp3CaptchaUrl) . '" type="audio/mpeg">';
    206208    $formHtml .= '</audio>';
    207209
     
    230232    $errorMessage = __('The characters you entered did not match the CAPTCHA image. Please try again with this new image.', 'mailpoet');
    231233
     234    $success = isset($settings['success_message']) ? (string)$settings['success_message'] : '';
     235
    232236    $formHtml = '<div class="mailpoet_message" role="alert" aria-live="assertive">';
    233     $formHtml .= '<p class="mailpoet_validate_success" ' . ($showSuccessMessage ? '' : ' style="display:none;"') . '>' . $this->wp->escHtml($settings['success_message']) . '</p>';
     237    $formHtml .= '<p class="mailpoet_validate_success" ' . ($showSuccessMessage ? '' : ' style="display:none;"') . '>' . $this->wp->escHtml($success) . '</p>';
    234238    $formHtml .= '<p class="mailpoet_validate_error" ' . ($showErrorMessage ? '' : ' style="display:none;"') . '>' . $this->wp->escHtml($errorMessage) . '</p>';
    235239    $formHtml .= '</div>';
  • mailpoet/trunk/lib/Cron/CronWorkerScheduler.php

    r3138648 r3358498  
    4242      return $alreadyScheduled;
    4343    }
     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 {
    4453    $task = new ScheduledTaskEntity();
    4554    $task->setType($taskType);
  • mailpoet/trunk/lib/Cron/Daemon.php

    r3209644 r3358498  
    100100    yield $this->workersFactory->createBounceWorker();
    101101    yield $this->workersFactory->createExportFilesCleanupWorker();
     102    yield $this->workersFactory->createLogCleanupWorker();
    102103    yield $this->workersFactory->createSubscribersEmailCountsWorker();
    103104    yield $this->workersFactory->createInactiveSubscribersWorker();
  • mailpoet/trunk/lib/Cron/Workers/WorkersFactory.php

    r3218389 r3358498  
    3636    Mixpanel::TASK_TYPE,
    3737    AbandonedCartWorker::TASK_TYPE,
     38    LogCleanup::TASK_TYPE,
    3839  ];
    3940
     
    9091  public function createExportFilesCleanupWorker() {
    9192    return $this->container->get(ExportFilesCleanup::class);
     93  }
     94
     95  /** @return LogCleanup */
     96  public function createLogCleanupWorker() {
     97    return $this->container->get(LogCleanup::class);
    9298  }
    9399
  • mailpoet/trunk/lib/DI/ContainerConfigurator.php

    r3350424 r3358498  
    326326    $container->autowire(\MailPoet\Cron\Workers\WooCommerceSync::class)->setPublic(true);
    327327    $container->autowire(\MailPoet\Cron\Workers\ExportFilesCleanup::class)->setPublic(true);
     328    $container->autowire(\MailPoet\Cron\Workers\LogCleanup::class)->setPublic(true);
    328329    $container->autowire(\MailPoet\Cron\Workers\SubscribersEmailCount::class)->setPublic(true);
    329330    $container->autowire(\MailPoet\Cron\Workers\InactiveSubscribers::class)->setPublic(true);
  • mailpoet/trunk/lib/EmailEditor/Integrations/MailPoet/Blocks/BlockTypes/PoweredByMailpoet.php

    r3350424 r3358498  
    3333      '<div class="%1$s" style="text-align:center">%2$s</div>',
    3434      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" />'
    3636    ), $block->parsed_block['email_attrs'] ?? []); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
    3737  }
  • mailpoet/trunk/lib/Form/AssetsController.php

    r3209644 r3358498  
    4242    $captcha = $this->settings->get('captcha');
    4343    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>';
    4545    }
    4646
  • mailpoet/trunk/lib/Form/Block/Image.php

    r3169194 r3358498  
    3434    $attributes = [];
    3535    $styles = [];
    36     $attributes[] = 'src="' . $this->wp->escAttr($params['url']) . '"';
     36    $attributes[] = 'src="' . $this->wp->escUrl($params['url']) . '"';
    3737    $attributes[] = $params['alt'] ? 'alt="' . $this->wp->escAttr($params['alt']) . '"' : 'alt';
    3838    if ($params['title']) {
     
    7878
    7979  private function wrapToLink(array $params, string $img): string {
    80     $attributes = ['href="' . $this->wp->escAttr($params['href']) . '"'];
     80    $attributes = ['href="' . $this->wp->escUrl($params['href']) . '"'];
    8181    if ($params['link_class']) {
    8282      $attributes[] = 'class="' . $this->wp->escAttr($params['link_class']) . '"';
  • mailpoet/trunk/lib/Logging/LogHandler.php

    r3005646 r3358498  
    1010
    1111class LogHandler extends AbstractProcessingHandler {
    12   /**
    13    * Logs older than this many days will be deleted
    14    */
    15   const DAYS_TO_KEEP_LOGS = 30;
    16 
    17   /**
    18    * How many records to delete on one run of purge routine
    19    */
    20   const PURGE_LIMIT = 1000;
    21 
    22   /**
    23    * Percentage value, what is the probability of running purge routine
    24    * @var int
    25    */
    26   const LOG_PURGE_PROBABILITY = 5;
    27 
    28   /** @var callable|null */
    29   private $randFunction;
    3012
    3113  /** @var LogRepository */
     
    3517    LogRepository $logRepository,
    3618    $level = \MailPoetVendor\Monolog\Logger::DEBUG,
    37     $bubble = \true,
    38     $randFunction = null
     19    $bubble = \true
    3920  ) {
    4021    parent::__construct($level, $bubble);
    41     $this->randFunction = $randFunction;
    4222    $this->logRepository = $logRepository;
    4323  }
     
    5333    $entity->setContext($record['context']);
    5434    $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);
    7035  }
    7136}
  • mailpoet/trunk/lib/Logging/LogRepository.php

    r3254132 r3358498  
    9494  }
    9595
    96   public function purgeOldLogs(int $daysToKeepLogs, int $limit = 1000) {
     96  public function purgeOldLogs(int $daysToKeepLogs, int $limit = 1000): int {
    9797    $logsTable = $this->entityManager->getClassMetadata(LogEntity::class)->getTableName();
    98     $this->entityManager->getConnection()->executeStatement(
     98    $result = $this->entityManager->getConnection()->executeStatement(
    9999      "
    100       DELETE FROM $logsTable
     100      DELETE FROM `{$logsTable}`
    101101      WHERE `created_at` < :date
    102       ORDER BY `id` ASC LIMIT :limit
     102      ORDER BY `created_at` ASC, `id` ASC
     103      LIMIT :limit
    103104    ",
    104105      [
     
    111112      ]
    112113    );
     114
     115    return (int)$result;
    113116  }
    114117
  • mailpoet/trunk/mailpoet.php

    r3354771 r3358498  
    66/*
    77 * Plugin Name: MailPoet
    8  * Version: 5.14.1
     8 * Version: 5.14.2
    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.1',
     26  'version' => '5.14.2',
    2727  'filename' => __FILE__,
    2828  'path' => dirname(__FILE__),
  • mailpoet/trunk/readme.txt

    r3354771 r3358498  
    44Requires at least: 6.7
    55Tested up to: 6.8
    6 Stable tag: 5.14.1
     6Stable tag: 5.14.2
    77Requires PHP: 7.4
    88License: GPLv3
     
    228228== Changelog ==
    229229
    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.
    232234
    233235[See the changelog for all versions.](https://github.com/mailpoet/mailpoet/blob/trunk/mailpoet/changelog.txt)
  • mailpoet/trunk/vendor/composer/installed.php

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