diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-05-15 12:14:32 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-05-15 12:14:32 +0000 |
commit | 38153c0f3e739f3d89a1a7734fd7d199bf457fab (patch) | |
tree | 28e19f4e091d5182a2c63bc98377e5381b0043ac /Postman/PostmanAdminController.php | |
parent | 942aa536210fe204a2d097eb8878c1d690e0547b (diff) | |
download | Post-SMTP-38153c0f3e739f3d89a1a7734fd7d199bf457fab.zip |
= 2.0 - 2019-05-15
* New: Mailer Type - Added an option to send without overwrite the 'wp_mail' function, better compability to WordPress delivery. hopefully will be the default in the future.
* Updated: Sendgrid API was upgraded and rewritten to the new version.
* Fixed: Message-Id header was missing on SMTP
* Fixed: Email logger optimization - better query for large amount of records.
* Fixed: The localization was fixed to match translate.wordpress.org translation system ( Thanks to Niels de Blaauw from Level-Level ).
* Fixed: Code and optimization ( Thanks to Niels de Blaauw from Level-Level ).
Diffstat (limited to 'Postman/PostmanAdminController.php')
-rw-r--r-- | Postman/PostmanAdminController.php | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/Postman/PostmanAdminController.php b/Postman/PostmanAdminController.php index f85e30c..f92bc2c 100644 --- a/Postman/PostmanAdminController.php +++ b/Postman/PostmanAdminController.php @@ -78,7 +78,7 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { /** * Constructor * - * @param unknown $rootPluginFilenameAndPath + * @param mixed $rootPluginFilenameAndPath * @param PostmanOptions $options * @param PostmanOAuthToken $authorizationToken * @param PostmanMessageHandler $messageHandler @@ -111,7 +111,7 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { // do a redirect on the init hook $this->registerInitFunction( 'handleSuccessfulSave' ); // add a saved message to be shown after the redirect - $this->messageHandler->addMessage( _x( 'Settings saved.', 'The plugin successfully saved new settings.', Postman::TEXT_DOMAIN ) ); + $this->messageHandler->addMessage( _x( 'Settings saved.', 'The plugin successfully saved new settings.', 'post-smtp' ) ); return; } else { // unset the action in the failed case as well @@ -162,11 +162,11 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { ?> <input type="hidden" name="<?php echo PostmanOptions::POSTMAN_NETWORK_OPTIONS; ?>[post_smtp_global_settings]" value="null"> <input type="hidden" name="<?php echo PostmanOptions::POSTMAN_NETWORK_OPTIONS; ?>[post_smtp_allow_overwrite]" value="null"> - <h2><?php _e( 'Post SMTP Settings', Postman::TEXT_DOMAIN ); ?></h2> + <h2><?php _e( 'Post SMTP Settings', 'post-smtp' ); ?></h2> <table id="menu" class="form-table"> <tr> <th scope="row"> - <?php _e( 'Enable global settings', Postman::TEXT_DOMAIN ); ?> + <?php _e( 'Enable global settings', 'post-smtp' ); ?> </th> <td> <?php $checked = checked( $options['post_smtp_global_settings'], 1, false ); ?> @@ -177,14 +177,14 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { <?php echo $checked; ?> > <p class="description"> - <?php _e('Same settings as the main site/blog (id:1)', Postman::TEXT_DOMAIN ); ?> + <?php _e('Same settings as the main site/blog (id:1)', 'post-smtp' ); ?> </p> </label> </td> </tr> <tr> <th scope="row"> - <?php _e( 'Allow user to load saved options', Postman::TEXT_DOMAIN ); ?> + <?php _e( 'Allow user to load saved options', 'post-smtp' ); ?> </th> <td> <?php $checked = checked( $options['post_smtp_allow_overwrite'], 1, false ); ?> @@ -252,7 +252,7 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { foreach ( $states as $state ) { if ( ! $state ['ready'] ) { /* Translators: where %1$s is the name of the library */ - $message = sprintf( __( 'This PHP installation requires the <b>%1$s</b> library.', Postman::TEXT_DOMAIN ), $state ['name'] ); + $message = sprintf( __( 'This PHP installation requires the <b>%1$s</b> library.', 'post-smtp' ), $state ['name'] ); if ( $state ['required'] ) { $this->messageHandler->addError( $message ); } else { @@ -264,8 +264,8 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { /** * - * @param unknown $actionName - * @param unknown $callbackName + * @param mixed $actionName + * @param mixed $callbackName */ private function registerInitFunction( $callbackName ) { $this->logger->debug( 'Registering init function ' . $callbackName ); @@ -278,8 +278,8 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { /** * Registers actions posted by am HTML FORM with the WordPress 'action' parameter * - * @param unknown $actionName - * @param unknown $callbankName + * @param mixed $actionName + * @param mixed $callbankName */ private function registerAdminPostAction( $actionName, $callbankName ) { // $this->logger->debug ( 'Registering ' . $actionName . ' Action Post handler' ); @@ -292,15 +292,16 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { /** * Add "Settings" link to the plugin action page * - * @param unknown $links + * @param mixed $links * @return multitype: */ public function postmanModifyLinksOnPluginsListPage( $links ) { // only administrators should be able to trigger this if ( PostmanUtils::isAdmin() ) { $mylinks = array( - sprintf( '<a href="%s" class="postman_settings">%s</a>', PostmanUtils::getSettingsPageUrl(), __( 'Settings', Postman::TEXT_DOMAIN ) ), - sprintf( '<a href="%s" class="postman_settings">%s</a>', 'https://postmansmtp.com', __( 'Visit us', Postman::TEXT_DOMAIN ) ), + sprintf( '<a href="%s" target="_blank" class="postman_settings">%s</a>', 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehuda@myinbox.in&item_name=Donation+for+PostSMTP', __( 'Donate', 'post-smtp' ) ), + sprintf( '<a href="%s" class="postman_settings">%s</a>', PostmanUtils::getSettingsPageUrl(), __( 'Settings', 'post-smtp' ) ), + sprintf( '<a href="%s" class="postman_settings">%s</a>', 'https://postmansmtp.com', __( 'Visit us', 'post-smtp' ) ), ); return array_merge( $mylinks, $links ); } @@ -328,7 +329,7 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { $success = false; } if ( ! $success ) { - $this->messageHandler->addError( __( 'There was an error importing the data.', Postman::TEXT_DOMAIN ) ); + $this->messageHandler->addError( __( 'There was an error importing the data.', 'post-smtp' ) ); $this->logger->error( 'There was an error importing the data' ); } PostmanUtils::redirect( PostmanUtils::POSTMAN_HOME_PAGE_RELATIVE_URL ); @@ -345,7 +346,7 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { delete_option( PostmanAdminController::TEST_OPTIONS ); $logPurger = new PostmanEmailLogPurger(); $logPurger->removeAll(); - $this->messageHandler->addMessage( __( 'Plugin data was removed.', Postman::TEXT_DOMAIN ) ); + $this->messageHandler->addMessage( __( 'Plugin data was removed.', 'post-smtp' ) ); PostmanUtils::redirect( PostmanUtils::POSTMAN_HOME_PAGE_RELATIVE_URL ); } } @@ -369,16 +370,16 @@ if ( ! class_exists( 'PostmanAdminController' ) ) { $logger->debug( 'Authorization successful' ); // save to database $authorizationToken->save(); - $this->messageHandler->addMessage( __( 'The OAuth 2.0 authorization was successful. Ready to send e-mail.', Postman::TEXT_DOMAIN ) ); + $this->messageHandler->addMessage( __( 'The OAuth 2.0 authorization was successful. Ready to send e-mail.', 'post-smtp' ) ); } else { - $this->messageHandler->addError( __( 'Your email provider did not grant Postman permission. Try again.', Postman::TEXT_DOMAIN ) ); + $this->messageHandler->addError( __( 'Your email provider did not grant Postman permission. Try again.', 'post-smtp' ) ); } } catch ( PostmanStateIdMissingException $e ) { - $this->messageHandler->addError( __( 'The grant code from Google had no accompanying state and may be a forgery', Postman::TEXT_DOMAIN ) ); + $this->messageHandler->addError( __( 'The grant code from Google had no accompanying state and may be a forgery', 'post-smtp' ) ); } catch ( Exception $e ) { $logger->error( 'Error: ' . get_class( $e ) . ' code=' . $e->getCode() . ' message=' . $e->getMessage() ); /* translators: %s is the error message */ - $this->messageHandler->addError( sprintf( __( 'Error authenticating with this Client ID. [%s]', Postman::TEXT_DOMAIN ), '<em>' . $e->getMessage() . '</em>' ) ); + $this->messageHandler->addError( sprintf( __( 'Error authenticating with this Client ID. [%s]', 'post-smtp' ), '<em>' . $e->getMessage() . '</em>' ) ); } // clean-up |