Plugin Directory

Changeset 3166181


Ignore:
Timestamp:
10/10/2024 03:57:45 AM (14 months ago)
Author:
donmhico
Message:

WP Mail Logging v1.13.1

Location:
wp-mail-logging
Files:
169 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • wp-mail-logging/trunk/assets/languages/wp-mail-logging.pot

    r3164976 r3166181  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: WP Mail Logging 1.13.0\n"
     3"Project-Id-Version: WP Mail Logging 1.13.1\n"
    44"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-mail-logging\n"
    55"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    88"Content-Type: text/plain; charset=UTF-8\n"
    99"Content-Transfer-Encoding: 8bit\n"
    10 "POT-Creation-Date: 2024-10-08T08:43:32+00:00\n"
     10"POT-Creation-Date: 2024-10-10T03:46:09+00:00\n"
    1111"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1212"X-Generator: WP-CLI 2.8.1\n"
     
    595595#: src/WPML_OptionsManager.php:420
    596596#: src/WPML_OptionsManager.php:421
    597 #: src/WPML_Plugin.php:301
     597#: src/WPML_Plugin.php:302
    598598msgid "Settings"
    599599msgstr ""
     
    609609#: src/WPML_OptionsManager.php:409
    610610#: src/WPML_OptionsManager.php:410
    611 #: src/WPML_Plugin.php:291
     611#: src/WPML_Plugin.php:292
    612612msgid "Email Log"
    613613msgstr ""
     
    615615#: src/WPML_OptionsManager.php:428
    616616#: src/WPML_OptionsManager.php:429
    617 #: src/WPML_Plugin.php:305
     617#: src/WPML_Plugin.php:306
    618618msgid "SMTP"
    619619msgstr ""
     
    656656msgstr ""
    657657
    658 #: src/WPML_Plugin.php:420
     658#: src/WPML_Plugin.php:421
    659659msgid "Heads up!"
    660660msgstr ""
    661661
    662 #: src/WPML_Plugin.php:421
     662#: src/WPML_Plugin.php:422
    663663#: src/WPML_UserFeedback.php:116
    664664msgid "Yes"
    665665msgstr ""
    666666
    667 #: src/WPML_Plugin.php:422
     667#: src/WPML_Plugin.php:423
    668668msgid "Cancel"
    669669msgstr ""
    670670
    671 #: src/WPML_Plugin.php:424
     671#: src/WPML_Plugin.php:425
    672672msgid "Warning!"
    673673msgstr ""
    674674
    675675#. translators: $1$s - WP Mail Logging plugin name; $2$s - WP.org review link; $3$s - WP.org review link.
    676 #: src/WPML_Plugin.php:607
     676#: src/WPML_Plugin.php:628
    677677msgid "Please rate %1$s <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">&#9733;&#9733;&#9733;&#9733;&#9733;</a> on <a href=\"%3$s\" target=\"_blank\" rel=\"noopener\">WordPress.org</a> to help us spread the word."
    678678msgstr ""
  • wp-mail-logging/trunk/readme.txt

    r3164976 r3166181  
    77Tested up to: 6.6
    88Requires PHP: 7.1
    9 Stable tag: 1.13.0
     9Stable tag: 1.13.1
    1010
    1111Log, view, and resend all emails sent from your WordPress site. Great for resolving email sending issues or keeping a copy for auditing.
     
    109109
    110110== Changelog ==
     111= 1.13.1 - 2024-10-10 =
     112Added: Action hook when saving email logs.
     113Fixed: Issue with email content type.
     114
    111115= 1.13.0 - 2024-10-08 =
    112116Improved: Allow admins to always have access to WP Mail Logging logs.
  • wp-mail-logging/trunk/src/WPML_Plugin.php

    r3164976 r3166181  
    191191        add_filter( 'plugin_action_links', array( &$this, 'registerPluginActionLinks'), 10, 5 );
    192192        add_filter( 'wp_mail', array( $this, self::HOOK_LOGGING_MAIL ), self::HOOK_LOGGING_MAIL_PRIORITY );
     193        add_action( 'wp_mail_logging_log_email', [ $this, 'save_email_log' ] );
    193194        add_action( 'wp_mail_failed', array( &$this, 'log_email_failed' ) );
    194195        add_filter( 'set-screen-option', array( &$this, 'save_screen_options' ), 10, 3);
     
    502503     * @since 1.12.0 Short-circuit if $mailArray is not an array.
    503504     * @since 1.13.0 Trim the subject to < 200 characters and save the Content-Type header if not set.
     505     * @since 1.13.1 Add a hook action `wp_mail_logging_log_email` to log email data before being sent.
    504506     *
    505507     * @return array $mailOriginal
    506508     */
    507509    public function log_email( $mailArray ) {
     510
     511        /**
     512         * Log email data before being sent.
     513         *
     514         * @since 1.13.1
     515         *
     516         * @param array $mailArray Array containing the mail data to be logged.
     517         */
     518        do_action( 'wp_mail_logging_log_email', $mailArray );
     519
     520        return $mailArray;
     521    }
     522
     523    /**
     524     * Save the email logs to the database.
     525     *
     526     * @since 1.13.1
     527     *
     528     * @param array $mail_data Array containing the mail data to be logged.
     529     */
     530    public function save_email_log( $mail_data ) {
    508531
    509532        /**
     
    512535         * @since 1.12.0
    513536         *
    514          * @param array $mailArray Array containing the mail data to be logged.
     537         * @param array $mail_data Array containing the mail data to be logged.
    515538         */
    516         $mailArray = apply_filters( 'wp_mail_logging_before_log_email', $mailArray );
    517 
    518         if ( ! is_array( $mailArray ) ) {
    519             return $mailArray;
     539        $mail_data = apply_filters( 'wp_mail_logging_before_log_email', $mail_data );
     540
     541        if ( ! is_array( $mail_data ) ) {
     542            return $mail_data;
    520543        }
    521544
    522545        global $wpml_current_mail_id;
    523546
    524         if ( ! empty( $mailArray['subject'] ) && mb_strlen( $mailArray['subject'] ) > 200 ) {
    525             $mailArray['subject'] = mb_substr( $mailArray['subject'], 0, 195 ) . '...';
    526         }
    527 
    528         $mailArray['headers'] = $this->get_mail_headers( $mailArray );
    529 
    530         $mail = (new WPML_MailExtractor())->extract($mailArray);
    531         $mail->set_plugin_version($this->getVersionSaved());
    532         $mail->set_timestamp(current_time( 'mysql' ));
    533         $mail->set_host( isset( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '');
     547        if ( ! empty( $mail_data['subject'] ) && mb_strlen( $mail_data['subject'] ) > 200 ) {
     548            $mail_data['subject'] = mb_substr( $mail_data['subject'], 0, 195 ) . '...';
     549        }
     550
     551        $mail_data['headers'] = $this->get_mail_headers( $mail_data );
     552
     553        $mail = (new WPML_MailExtractor())->extract( $mail_data );
     554        $mail->set_plugin_version( $this->getVersionSaved() );
     555        $mail->set_timestamp( current_time( 'mysql' ) );
     556        $mail->set_host( isset( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '' );
    534557
    535558        $wpml_current_mail_id = $mail->save();
    536 
    537         return $mailArray;
    538559    }
    539560
  • wp-mail-logging/trunk/vendor/composer/installed.php

    r3164976 r3166181  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => 'ccb6d3c3aa1f70230dee921b173d45ac9ac52b52',
     6        'reference' => '78981966fd06134e4d31d5c69eaea22a46b85237',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-master',
    1515            'version' => 'dev-master',
    16             'reference' => 'ccb6d3c3aa1f70230dee921b173d45ac9ac52b52',
     16            'reference' => '78981966fd06134e4d31d5c69eaea22a46b85237',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • wp-mail-logging/trunk/wp-mail-logging.php

    r3164976 r3166181  
    33 * Plugin Name: WP Mail Logging
    44 * Plugin URI: https://wordpress.org/plugins/wp-mail-logging/
    5  * Version: 1.13.0
     5 * Version: 1.13.1
    66 * Requires at least: 5.0
    77 * Requires PHP: 7.1
Note: See TracChangeset for help on using the changeset viewer.