Changeset 3289955
- Timestamp:
- 05/08/2025 02:50:29 PM (7 months ago)
- Location:
- wp-ses
- Files:
-
- 18 edited
- 1 copied
-
tags/1.7.2 (copied) (copied from wp-ses/trunk)
-
tags/1.7.2/README.md (modified) (2 diffs)
-
tags/1.7.2/classes/Command-Pool.php (modified) (6 diffs)
-
tags/1.7.2/classes/Queue/Email-Cron.php (modified) (2 diffs)
-
tags/1.7.2/classes/Queue/Email-Worker.php (modified) (5 diffs)
-
tags/1.7.2/classes/SES-API.php (modified) (1 diff)
-
tags/1.7.2/languages/wp-ses-en.pot (modified) (5 diffs)
-
tags/1.7.2/readme.txt (modified) (2 diffs)
-
tags/1.7.2/vendor/Carbon/AbstractTranslator.php (modified) (1 diff)
-
tags/1.7.2/wp-ses.php (modified) (3 diffs)
-
trunk/README.md (modified) (2 diffs)
-
trunk/classes/Command-Pool.php (modified) (6 diffs)
-
trunk/classes/Queue/Email-Cron.php (modified) (2 diffs)
-
trunk/classes/Queue/Email-Worker.php (modified) (5 diffs)
-
trunk/classes/SES-API.php (modified) (1 diff)
-
trunk/languages/wp-ses-en.pot (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/Carbon/AbstractTranslator.php (modified) (1 diff)
-
trunk/wp-ses.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-ses/tags/1.7.2/README.md
r3272205 r3289955 6 6 **Tested up to:** 6.8 \ 7 7 **Requires PHP:** 7.4 \ 8 **Stable tag:** 1.7. 1\8 **Stable tag:** 1.7.2 \ 9 9 **License:** GPLv2 10 10 … … 199 199 ## Changelog 200 200 201 ### 1.7.2 - 2025-05-08 202 203 * Bug fix: Detecting whether running as a must-use plugin is now more robust 204 * Bug fix: Clash with WP Offload SES (Pro) avoided if both are installed as must-use plugins 205 * Bug fix: AWS SES account rate limit exceeded failures no longer occur for high volume bulk sends 206 201 207 ### 1.7.1 - 2024-10-04 202 208 -
wp-ses/tags/1.7.2/classes/Command-Pool.php
r3110370 r3289955 36 36 * @var array 37 37 */ 38 p ublic$commands = array();38 private $commands = array(); 39 39 40 40 /** 41 41 * The maximum concurrency for the AWS CommandPool. 42 42 * 43 * Equates to the number of emails that we can send per second. 44 * 43 45 * @var int 44 46 */ … … 51 53 */ 52 54 private $connection; 55 56 /** 57 * How many emails have been sent within this interval. 58 * 59 * @var int 60 */ 61 private $send_count = 0; 62 63 /** 64 * When did this sending interval start. 65 * 66 * @var int 67 */ 68 private $send_started_at = 0; 53 69 54 70 /** … … 66 82 * Add a command to be run via the CommandPool. 67 83 * 84 * If there are no more jobs to process, or if the batch send rate has been 85 * reached, the command pool will be executed. 86 * 68 87 * @param Command $command The command to add. 69 88 */ 70 89 public function add_command( Command $command ) { 71 90 $this->commands[] = $command; 72 $num_commands = count( $this->commands );73 91 74 92 // Execute if we've reached our max concurrency, or if there are no more unreserved jobs. 75 if ( $this->get_concurrency() <= $ num_commands|| 0 === $this->connection->jobs( true ) ) {93 if ( $this->get_concurrency() <= $this->num_commands() || 0 === $this->connection->jobs( true ) ) { 76 94 $this->execute(); 77 $this->commands = array();78 95 } 79 96 } … … 99 116 } 100 117 101 $this->concurrency = (int) apply_filters( 'wposes_max_concurrency', $send_rate ); 118 $send_rate = (int) apply_filters( 'wposes_max_concurrency', $send_rate ); 119 $this->concurrency = max( 1, min( PHP_INT_MAX, $send_rate ) ); 102 120 103 121 return $this->concurrency; … … 105 123 106 124 /** 107 * Create the command pool and execute the commands. 125 * Create the AWS command pool and execute the commands. 126 * 127 * Does nothing if there are no commands in the pool. 128 * 129 * Empties the command pool once the commands have all attempted execution. 108 130 */ 109 131 public function execute() { 132 if ( 0 === $this->num_commands() ) { 133 return; 134 } 135 136 // Comply with SES per second rate limit. 137 $this->maybe_wait_for_rate_limit_reset(); 138 110 139 /** @var WP_Offload_SES $wp_offload_ses */ 111 140 global $wp_offload_ses; … … 210 239 $promise = $command_pool->promise(); 211 240 $promise->wait(); 241 242 // One way or another we're done with the current commands. 243 $this->clear(); 244 } 245 246 /** 247 * How many commands are in the pool? 248 * 249 * @return int 250 */ 251 public function num_commands(): int { 252 return count( $this->commands ); 253 } 254 255 /** 256 * Empty the command pool. 257 * 258 * @return void 259 */ 260 public function clear() { 261 $this->commands = array(); 262 } 263 264 /** 265 * Determines whether the current second needs to be ticked down 266 * before another batch of items can be processed, and does so. 267 * 268 * Keeps track of how many emails have been sent in the current second, 269 * making sure that if the next batch would exceed the rate limit, then 270 * the wait happens and the count is updated appropriately. 271 * 272 * @return void 273 */ 274 private function maybe_wait_for_rate_limit_reset() { 275 if ( ! $this->send_started() ) { 276 $this->start_send(); 277 278 return; 279 } 280 281 // Update current send interval's item count. 282 $this->send_count += $this->num_commands(); 283 284 if ( ! $this->rate_limit_exceeded() ) { 285 return; 286 } 287 288 $this->maybe_wait_until_next_second(); 289 290 $this->start_send(); 291 } 292 293 /** 294 * Have we already started a sending interval? 295 * 296 * @return bool 297 */ 298 private function send_started(): bool { 299 return 0 !== $this->send_started_at && 0 !== $this->send_count; 300 } 301 302 /** 303 * Start a new send interval. 304 * 305 * @return void 306 */ 307 private function start_send(): void { 308 $this->send_count = $this->num_commands(); 309 $this->send_started_at = time(); 310 } 311 312 /** 313 * Has the rate limit been exceeded for the current send interval? 314 * 315 * @return bool 316 */ 317 private function rate_limit_exceeded(): bool { 318 if ( $this->get_concurrency() < $this->send_count ) { 319 return true; 320 } 321 322 return false; 323 } 324 325 /** 326 * If a second hasn't ticked over since last send started, wait until it has. 327 * 328 * @return void 329 */ 330 private function maybe_wait_until_next_second(): void { 331 $next_send_time = $this->send_started_at + 1; 332 333 if ( time() < $next_send_time ) { 334 time_sleep_until( $next_send_time ); 335 } 212 336 } 213 337 } -
wp-ses/tags/1.7.2/classes/Queue/Email-Cron.php
r3110370 r3289955 12 12 */ 13 13 class Email_Cron extends Cron { 14 /** 15 * @var Email_Worker 16 */ 17 protected $worker; 14 18 15 19 /** … … 64 68 65 69 while ( ! $this->time_exceeded() && ! $this->memory_exceeded() ) { 70 // Puts the next job into the command pool. 71 // If the command pool is full (we've hit the per second rate limit), 72 // or queue emptied, the command pool will be executed and cleared. 66 73 if ( ! $this->worker->process() ) { 67 74 break; 68 75 } 69 76 } 77 78 // Executes remaining commands in the command pool. 79 $this->worker->cleanup(); 70 80 71 81 $this->unlock_worker(); -
wp-ses/tags/1.7.2/classes/Queue/Email-Worker.php
r3033377 r3289955 35 35 36 36 /** 37 * Process a job on the queue. 37 * Process a job on the queue, adding it to the command pool. 38 * 39 * The command pool will be executed if there are no more jobs, or 40 * if the batch send limit (concurrency) is reached. 41 * 42 * Returns false if: 43 * - no job was retrieved but there are still jobs to process; or 44 * - the AWS command for the job could not be constructed. 45 * 46 * Returns true otherwise, but note that this does not mean the job 47 * was added to the command pool; it may have been failed or released. 38 48 * 39 49 * @return bool … … 47 57 /** 48 58 * We couldn't get the job, but there are still unreserved jobs. 49 * This shouldn't happen, so let's log an error and fire off the command pool just in case.59 * This shouldn't happen, so let's log an error and bail. 50 60 */ 51 61 new Error( … … 53 63 __( 'There was an error retrieving the job while processing the queue.', 'wp-offload-ses' ) 54 64 ); 55 56 if ( 0 !== count( $this->command_pool->commands ) ) {57 $this->command_pool->execute();58 }59 65 } 60 66 … … 62 68 } 63 69 64 try { 65 if ( $job->attempts() >= $this->attempts ) { 70 // Assemble command unless job already reached current attempts limit. 71 if ( $job->attempts() >= $this->attempts ) { 72 $job->release(); 73 } else { 74 try { 75 $command = $job->handle(); 76 } catch ( Exception $exception ) { 66 77 $job->release(); 67 } else {68 $command = $job->handle();69 78 } 70 } catch ( Exception $exception ) {71 $job->release();72 79 } 73 80 … … 79 86 } 80 87 88 // Record failed job and shortcut out. 81 89 if ( $job->failed() ) { 82 90 $this->connection->failure( $job, $exception ); 83 } else {84 if ( ! $job->released() ) {85 if ( empty( $command ) ) {86 /**87 * We couldn't get the job's command.88 * This shouldn't happen, so let's log an error and fire off the command pool just in case.89 */90 new Error(91 Error::$cmd_construction_failure,92 __( 'There was an error constructing the job while processing the queue.', 'wp-offload-ses' )93 );94 91 95 if ( 0 !== count( $this->command_pool->commands ) ) { 96 $this->command_pool->execute(); 97 } 92 return true; 93 } 98 94 99 return false; 100 } 95 // Record unhandled job and shortcut out. 96 if ( $job->released() ) { 97 $this->connection->release( $job ); 101 98 102 $this->command_pool->add_command( $command ); 103 } else { 104 $this->connection->release( $job ); 105 } 99 return true; 106 100 } 101 102 if ( empty( $command ) ) { 103 /** 104 * We couldn't get the job's command. 105 * This shouldn't happen, so let's log an error and bail. 106 */ 107 new Error( 108 Error::$cmd_construction_failure, 109 __( 'There was an error constructing the job while processing the queue.', 'wp-offload-ses' ) 110 ); 111 112 return false; 113 } 114 115 $this->command_pool->add_command( $command ); 107 116 108 117 return true; 109 118 } 110 119 120 /** 121 * Execute any commands already retrieved. 122 * 123 * @return void 124 */ 125 public function cleanup() { 126 $this->command_pool->execute(); 127 } 111 128 } -
wp-ses/tags/1.7.2/classes/SES-API.php
r3228120 r3289955 121 121 * Get the sending quota. 122 122 * 123 * Returns an array in the form: 124 * 125 * [ 126 * 'used' => float, // Percentage of the quota used over the last 24 hours 127 * 'limit' => string, // The maximum number of emails that can be sent in a 24 hour period 128 * 'sent' => string, // The number of emails sent in the last 24 hours 129 * 'rate' => string, // The maximum number of emails that can be sent per second 130 * ] 131 * 132 * Returns an OSES Error object if the quotas could not be retrieved. 133 * 123 134 * @return array|Error 124 135 */ -
wp-ses/tags/1.7.2/languages/wp-ses-en.pot
r3228120 r3289955 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WP Offload SES Lite 1.7. 1\n"5 "Project-Id-Version: WP Offload SES Lite 1.7.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-ses\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-0 1-24T15:02:36+00:00\n"12 "POT-Creation-Date: 2025-05-08T14:43:38+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 116 116 msgstr "" 117 117 118 #: classes/Command-Pool.php:1 32119 #: classes/Command-Pool.php: 185118 #: classes/Command-Pool.php:161 119 #: classes/Command-Pool.php:214 120 120 msgid "Failed to retrieve the job while executing the command pool." 121 121 msgstr "" … … 313 313 msgstr "" 314 314 315 #: classes/Queue/Email-Worker.php: 53315 #: classes/Queue/Email-Worker.php:63 316 316 msgid "There was an error retrieving the job while processing the queue." 317 317 msgstr "" 318 318 319 #: classes/Queue/Email-Worker.php: 92319 #: classes/Queue/Email-Worker.php:109 320 320 msgid "There was an error constructing the job while processing the queue." 321 321 msgstr "" … … 441 441 msgstr "" 442 442 443 #: classes/SES-API.php:1 72443 #: classes/SES-API.php:183 444 444 msgid "There was an error attempting to receive your SES identities." 445 445 msgstr "" 446 446 447 #: classes/SES-API.php:2 20447 #: classes/SES-API.php:231 448 448 msgid "There was an error deleting the provided identity." 449 449 msgstr "" 450 450 451 #: classes/SES-API.php:2 40451 #: classes/SES-API.php:251 452 452 msgid "There was an error retrieving the details of your \"%s\" SES identity." 453 453 msgstr "" 454 454 455 #: classes/SES-API.php:2 66455 #: classes/SES-API.php:277 456 456 msgid "There was an error attempting to validate the domain." 457 457 msgstr "" 458 458 459 #: classes/SES-API.php: 289459 #: classes/SES-API.php:300 460 460 msgid "There was an error attempting to validate the email address." 461 461 msgstr "" -
wp-ses/tags/1.7.2/readme.txt
r3272205 r3289955 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.7. 17 Stable tag: 1.7.2 8 8 License: GPLv2 9 9 … … 186 186 == Changelog == 187 187 188 = 1.7.2 - 2025-05-08 = 189 * Bug fix: Detecting whether running as a must-use plugin is now more robust 190 * Bug fix: Clash with WP Offload SES (Pro) avoided if both are installed as must-use plugins 191 * Bug fix: AWS SES account rate limit exceeded failures no longer occur for high volume bulk sends 192 188 193 = 1.7.1 - 2024-10-04 = 189 194 * Security: The plugin can now serve updates from WP Engine servers, however this update mechanism is not included when installed directly from WordPress.org -
wp-ses/tags/1.7.2/vendor/Carbon/AbstractTranslator.php
r2914170 r3289955 137 137 return \true; 138 138 } 139 $this->assertValidLocale($locale); 139 140 foreach ($this->getDirectories() as $directory) { 140 141 $data = @(include \sprintf('%s/%s.php', \rtrim($directory, '\\/'), $locale)); -
wp-ses/tags/1.7.2/wp-ses.php
r3228120 r3289955 4 4 Description: Automatically send WordPress mail through Amazon SES (Simple Email Service). 5 5 Author: Delicious Brains 6 Version: 1.7. 16 Version: 1.7.2 7 7 Author URI: https://deliciousbrains.com/ 8 8 Plugin URI: https://deliciousbrains.com/ … … 32 32 } 33 33 34 $GLOBALS['wposes_meta']['wp-ses']['version'] = '1.7.1'; 34 // Avoid clash with WP Offload SES (Pro) if both installed as must-use plugins. 35 if ( defined( 'WPOSES_FILE' ) ) { 36 return; 37 } 38 39 $GLOBALS['wposes_meta']['wp-ses']['version'] = '1.7.2'; 35 40 36 41 if ( ! defined( 'WPOSESLITE_FILE' ) ) { … … 105 110 */ 106 111 function wposes_lite_get_plugin_dir_path() { 107 $abspath = wp_normalize_path( dirname( WPOSESLITE_FILE ) ); 108 $mu_path = wp_normalize_path( WPMU_PLUGIN_DIR ); 109 110 if ( $mu_path === $abspath ) { 111 $abspath = $abspath . '/wp-ses/'; 112 $abspath = wp_normalize_path( dirname( WPOSESLITE_FILE ) ); 113 $mu_path = $abspath . '/wp-ses'; 114 $core_class = '/classes/WP-Offload-SES.php'; 115 116 // Is entry point file in directory above where plugin's files are? 117 if ( file_exists( $mu_path . $core_class ) ) { 118 $abspath = $mu_path; 112 119 } 113 120 -
wp-ses/trunk/README.md
r3272205 r3289955 6 6 **Tested up to:** 6.8 \ 7 7 **Requires PHP:** 7.4 \ 8 **Stable tag:** 1.7. 1\8 **Stable tag:** 1.7.2 \ 9 9 **License:** GPLv2 10 10 … … 199 199 ## Changelog 200 200 201 ### 1.7.2 - 2025-05-08 202 203 * Bug fix: Detecting whether running as a must-use plugin is now more robust 204 * Bug fix: Clash with WP Offload SES (Pro) avoided if both are installed as must-use plugins 205 * Bug fix: AWS SES account rate limit exceeded failures no longer occur for high volume bulk sends 206 201 207 ### 1.7.1 - 2024-10-04 202 208 -
wp-ses/trunk/classes/Command-Pool.php
r3110370 r3289955 36 36 * @var array 37 37 */ 38 p ublic$commands = array();38 private $commands = array(); 39 39 40 40 /** 41 41 * The maximum concurrency for the AWS CommandPool. 42 42 * 43 * Equates to the number of emails that we can send per second. 44 * 43 45 * @var int 44 46 */ … … 51 53 */ 52 54 private $connection; 55 56 /** 57 * How many emails have been sent within this interval. 58 * 59 * @var int 60 */ 61 private $send_count = 0; 62 63 /** 64 * When did this sending interval start. 65 * 66 * @var int 67 */ 68 private $send_started_at = 0; 53 69 54 70 /** … … 66 82 * Add a command to be run via the CommandPool. 67 83 * 84 * If there are no more jobs to process, or if the batch send rate has been 85 * reached, the command pool will be executed. 86 * 68 87 * @param Command $command The command to add. 69 88 */ 70 89 public function add_command( Command $command ) { 71 90 $this->commands[] = $command; 72 $num_commands = count( $this->commands );73 91 74 92 // Execute if we've reached our max concurrency, or if there are no more unreserved jobs. 75 if ( $this->get_concurrency() <= $ num_commands|| 0 === $this->connection->jobs( true ) ) {93 if ( $this->get_concurrency() <= $this->num_commands() || 0 === $this->connection->jobs( true ) ) { 76 94 $this->execute(); 77 $this->commands = array();78 95 } 79 96 } … … 99 116 } 100 117 101 $this->concurrency = (int) apply_filters( 'wposes_max_concurrency', $send_rate ); 118 $send_rate = (int) apply_filters( 'wposes_max_concurrency', $send_rate ); 119 $this->concurrency = max( 1, min( PHP_INT_MAX, $send_rate ) ); 102 120 103 121 return $this->concurrency; … … 105 123 106 124 /** 107 * Create the command pool and execute the commands. 125 * Create the AWS command pool and execute the commands. 126 * 127 * Does nothing if there are no commands in the pool. 128 * 129 * Empties the command pool once the commands have all attempted execution. 108 130 */ 109 131 public function execute() { 132 if ( 0 === $this->num_commands() ) { 133 return; 134 } 135 136 // Comply with SES per second rate limit. 137 $this->maybe_wait_for_rate_limit_reset(); 138 110 139 /** @var WP_Offload_SES $wp_offload_ses */ 111 140 global $wp_offload_ses; … … 210 239 $promise = $command_pool->promise(); 211 240 $promise->wait(); 241 242 // One way or another we're done with the current commands. 243 $this->clear(); 244 } 245 246 /** 247 * How many commands are in the pool? 248 * 249 * @return int 250 */ 251 public function num_commands(): int { 252 return count( $this->commands ); 253 } 254 255 /** 256 * Empty the command pool. 257 * 258 * @return void 259 */ 260 public function clear() { 261 $this->commands = array(); 262 } 263 264 /** 265 * Determines whether the current second needs to be ticked down 266 * before another batch of items can be processed, and does so. 267 * 268 * Keeps track of how many emails have been sent in the current second, 269 * making sure that if the next batch would exceed the rate limit, then 270 * the wait happens and the count is updated appropriately. 271 * 272 * @return void 273 */ 274 private function maybe_wait_for_rate_limit_reset() { 275 if ( ! $this->send_started() ) { 276 $this->start_send(); 277 278 return; 279 } 280 281 // Update current send interval's item count. 282 $this->send_count += $this->num_commands(); 283 284 if ( ! $this->rate_limit_exceeded() ) { 285 return; 286 } 287 288 $this->maybe_wait_until_next_second(); 289 290 $this->start_send(); 291 } 292 293 /** 294 * Have we already started a sending interval? 295 * 296 * @return bool 297 */ 298 private function send_started(): bool { 299 return 0 !== $this->send_started_at && 0 !== $this->send_count; 300 } 301 302 /** 303 * Start a new send interval. 304 * 305 * @return void 306 */ 307 private function start_send(): void { 308 $this->send_count = $this->num_commands(); 309 $this->send_started_at = time(); 310 } 311 312 /** 313 * Has the rate limit been exceeded for the current send interval? 314 * 315 * @return bool 316 */ 317 private function rate_limit_exceeded(): bool { 318 if ( $this->get_concurrency() < $this->send_count ) { 319 return true; 320 } 321 322 return false; 323 } 324 325 /** 326 * If a second hasn't ticked over since last send started, wait until it has. 327 * 328 * @return void 329 */ 330 private function maybe_wait_until_next_second(): void { 331 $next_send_time = $this->send_started_at + 1; 332 333 if ( time() < $next_send_time ) { 334 time_sleep_until( $next_send_time ); 335 } 212 336 } 213 337 } -
wp-ses/trunk/classes/Queue/Email-Cron.php
r3110370 r3289955 12 12 */ 13 13 class Email_Cron extends Cron { 14 /** 15 * @var Email_Worker 16 */ 17 protected $worker; 14 18 15 19 /** … … 64 68 65 69 while ( ! $this->time_exceeded() && ! $this->memory_exceeded() ) { 70 // Puts the next job into the command pool. 71 // If the command pool is full (we've hit the per second rate limit), 72 // or queue emptied, the command pool will be executed and cleared. 66 73 if ( ! $this->worker->process() ) { 67 74 break; 68 75 } 69 76 } 77 78 // Executes remaining commands in the command pool. 79 $this->worker->cleanup(); 70 80 71 81 $this->unlock_worker(); -
wp-ses/trunk/classes/Queue/Email-Worker.php
r3033377 r3289955 35 35 36 36 /** 37 * Process a job on the queue. 37 * Process a job on the queue, adding it to the command pool. 38 * 39 * The command pool will be executed if there are no more jobs, or 40 * if the batch send limit (concurrency) is reached. 41 * 42 * Returns false if: 43 * - no job was retrieved but there are still jobs to process; or 44 * - the AWS command for the job could not be constructed. 45 * 46 * Returns true otherwise, but note that this does not mean the job 47 * was added to the command pool; it may have been failed or released. 38 48 * 39 49 * @return bool … … 47 57 /** 48 58 * We couldn't get the job, but there are still unreserved jobs. 49 * This shouldn't happen, so let's log an error and fire off the command pool just in case.59 * This shouldn't happen, so let's log an error and bail. 50 60 */ 51 61 new Error( … … 53 63 __( 'There was an error retrieving the job while processing the queue.', 'wp-offload-ses' ) 54 64 ); 55 56 if ( 0 !== count( $this->command_pool->commands ) ) {57 $this->command_pool->execute();58 }59 65 } 60 66 … … 62 68 } 63 69 64 try { 65 if ( $job->attempts() >= $this->attempts ) { 70 // Assemble command unless job already reached current attempts limit. 71 if ( $job->attempts() >= $this->attempts ) { 72 $job->release(); 73 } else { 74 try { 75 $command = $job->handle(); 76 } catch ( Exception $exception ) { 66 77 $job->release(); 67 } else {68 $command = $job->handle();69 78 } 70 } catch ( Exception $exception ) {71 $job->release();72 79 } 73 80 … … 79 86 } 80 87 88 // Record failed job and shortcut out. 81 89 if ( $job->failed() ) { 82 90 $this->connection->failure( $job, $exception ); 83 } else {84 if ( ! $job->released() ) {85 if ( empty( $command ) ) {86 /**87 * We couldn't get the job's command.88 * This shouldn't happen, so let's log an error and fire off the command pool just in case.89 */90 new Error(91 Error::$cmd_construction_failure,92 __( 'There was an error constructing the job while processing the queue.', 'wp-offload-ses' )93 );94 91 95 if ( 0 !== count( $this->command_pool->commands ) ) { 96 $this->command_pool->execute(); 97 } 92 return true; 93 } 98 94 99 return false; 100 } 95 // Record unhandled job and shortcut out. 96 if ( $job->released() ) { 97 $this->connection->release( $job ); 101 98 102 $this->command_pool->add_command( $command ); 103 } else { 104 $this->connection->release( $job ); 105 } 99 return true; 106 100 } 101 102 if ( empty( $command ) ) { 103 /** 104 * We couldn't get the job's command. 105 * This shouldn't happen, so let's log an error and bail. 106 */ 107 new Error( 108 Error::$cmd_construction_failure, 109 __( 'There was an error constructing the job while processing the queue.', 'wp-offload-ses' ) 110 ); 111 112 return false; 113 } 114 115 $this->command_pool->add_command( $command ); 107 116 108 117 return true; 109 118 } 110 119 120 /** 121 * Execute any commands already retrieved. 122 * 123 * @return void 124 */ 125 public function cleanup() { 126 $this->command_pool->execute(); 127 } 111 128 } -
wp-ses/trunk/classes/SES-API.php
r3228120 r3289955 121 121 * Get the sending quota. 122 122 * 123 * Returns an array in the form: 124 * 125 * [ 126 * 'used' => float, // Percentage of the quota used over the last 24 hours 127 * 'limit' => string, // The maximum number of emails that can be sent in a 24 hour period 128 * 'sent' => string, // The number of emails sent in the last 24 hours 129 * 'rate' => string, // The maximum number of emails that can be sent per second 130 * ] 131 * 132 * Returns an OSES Error object if the quotas could not be retrieved. 133 * 123 134 * @return array|Error 124 135 */ -
wp-ses/trunk/languages/wp-ses-en.pot
r3228120 r3289955 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WP Offload SES Lite 1.7. 1\n"5 "Project-Id-Version: WP Offload SES Lite 1.7.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-ses\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-0 1-24T15:02:36+00:00\n"12 "POT-Creation-Date: 2025-05-08T14:43:38+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 116 116 msgstr "" 117 117 118 #: classes/Command-Pool.php:1 32119 #: classes/Command-Pool.php: 185118 #: classes/Command-Pool.php:161 119 #: classes/Command-Pool.php:214 120 120 msgid "Failed to retrieve the job while executing the command pool." 121 121 msgstr "" … … 313 313 msgstr "" 314 314 315 #: classes/Queue/Email-Worker.php: 53315 #: classes/Queue/Email-Worker.php:63 316 316 msgid "There was an error retrieving the job while processing the queue." 317 317 msgstr "" 318 318 319 #: classes/Queue/Email-Worker.php: 92319 #: classes/Queue/Email-Worker.php:109 320 320 msgid "There was an error constructing the job while processing the queue." 321 321 msgstr "" … … 441 441 msgstr "" 442 442 443 #: classes/SES-API.php:1 72443 #: classes/SES-API.php:183 444 444 msgid "There was an error attempting to receive your SES identities." 445 445 msgstr "" 446 446 447 #: classes/SES-API.php:2 20447 #: classes/SES-API.php:231 448 448 msgid "There was an error deleting the provided identity." 449 449 msgstr "" 450 450 451 #: classes/SES-API.php:2 40451 #: classes/SES-API.php:251 452 452 msgid "There was an error retrieving the details of your \"%s\" SES identity." 453 453 msgstr "" 454 454 455 #: classes/SES-API.php:2 66455 #: classes/SES-API.php:277 456 456 msgid "There was an error attempting to validate the domain." 457 457 msgstr "" 458 458 459 #: classes/SES-API.php: 289459 #: classes/SES-API.php:300 460 460 msgid "There was an error attempting to validate the email address." 461 461 msgstr "" -
wp-ses/trunk/readme.txt
r3272205 r3289955 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.7. 17 Stable tag: 1.7.2 8 8 License: GPLv2 9 9 … … 186 186 == Changelog == 187 187 188 = 1.7.2 - 2025-05-08 = 189 * Bug fix: Detecting whether running as a must-use plugin is now more robust 190 * Bug fix: Clash with WP Offload SES (Pro) avoided if both are installed as must-use plugins 191 * Bug fix: AWS SES account rate limit exceeded failures no longer occur for high volume bulk sends 192 188 193 = 1.7.1 - 2024-10-04 = 189 194 * Security: The plugin can now serve updates from WP Engine servers, however this update mechanism is not included when installed directly from WordPress.org -
wp-ses/trunk/vendor/Carbon/AbstractTranslator.php
r2914170 r3289955 137 137 return \true; 138 138 } 139 $this->assertValidLocale($locale); 139 140 foreach ($this->getDirectories() as $directory) { 140 141 $data = @(include \sprintf('%s/%s.php', \rtrim($directory, '\\/'), $locale)); -
wp-ses/trunk/wp-ses.php
r3228120 r3289955 4 4 Description: Automatically send WordPress mail through Amazon SES (Simple Email Service). 5 5 Author: Delicious Brains 6 Version: 1.7. 16 Version: 1.7.2 7 7 Author URI: https://deliciousbrains.com/ 8 8 Plugin URI: https://deliciousbrains.com/ … … 32 32 } 33 33 34 $GLOBALS['wposes_meta']['wp-ses']['version'] = '1.7.1'; 34 // Avoid clash with WP Offload SES (Pro) if both installed as must-use plugins. 35 if ( defined( 'WPOSES_FILE' ) ) { 36 return; 37 } 38 39 $GLOBALS['wposes_meta']['wp-ses']['version'] = '1.7.2'; 35 40 36 41 if ( ! defined( 'WPOSESLITE_FILE' ) ) { … … 105 110 */ 106 111 function wposes_lite_get_plugin_dir_path() { 107 $abspath = wp_normalize_path( dirname( WPOSESLITE_FILE ) ); 108 $mu_path = wp_normalize_path( WPMU_PLUGIN_DIR ); 109 110 if ( $mu_path === $abspath ) { 111 $abspath = $abspath . '/wp-ses/'; 112 $abspath = wp_normalize_path( dirname( WPOSESLITE_FILE ) ); 113 $mu_path = $abspath . '/wp-ses'; 114 $core_class = '/classes/WP-Offload-SES.php'; 115 116 // Is entry point file in directory above where plugin's files are? 117 if ( file_exists( $mu_path . $core_class ) ) { 118 $abspath = $mu_path; 112 119 } 113 120
Note: See TracChangeset
for help on using the changeset viewer.