Plugin Directory

Changeset 3332419


Ignore:
Timestamp:
07/22/2025 04:45:14 PM (9 months ago)
Author:
wpbrite
Message:

Added - Translations Spanish, French, Italian, German, Russian, Portuguese, Dutch, Czech, Vietnamese.

Added - Tooltips for better understanding.

Location:
mail2admins
Files:
86 added
10 edited

Legend:

Unmodified
Added
Removed
  • mail2admins/trunk/assets/css/mail2a-admin.css

    r3307370 r3332419  
    360360  }
    361361 
     362.mail2a-tooltip {
     363  color :#cccccc;
     364}
  • mail2admins/trunk/assets/js/mail2a-admin.js

    r3307370 r3332419  
    88    if (mail2a_initial_check == true) {
    99        $('#mail2a_admin_emails_send').attr('disabled', false);
    10         $('#mail2a_enable_check').closest("tr").nextAll('tr').css({ 'pointer-events' : 'all', 'opacity':'1', 'cursor': 'pointer'  })
     10        $('#mail2a_enable_check').closest("tr").nextAll('tr').css({ 'pointer-events' : 'all', 'opacity':'1', 'cursor': 'default'  })
    1111
    1212    }
     
    2121        if(is_enable == 1 ) {
    2222            $('#mail2a_admin_emails_send').attr('disabled', false);
    23             $('#mail2a_enable_check').closest("tr").nextAll('tr').css({ 'pointer-events' : 'all', 'opacity':'1', 'cursor': 'pointer'  })
     23            $('#mail2a_enable_check').closest("tr").nextAll('tr').css({ 'pointer-events' : 'all', 'opacity':'1', 'cursor': 'default'  })
    2424
    2525        }
     
    3434        e.preventDefault();
    3535       
     36        var admin_emails = $('.mail2a-emails').val()
     37        console.log(admin_emails.length);
     38        if(admin_emails.length == 0) {
     39            $('#mail2aMailResponse').html('<span class="send_test_failed">Please select the administrator emails.</span>');
     40            setTimeout(function() {
     41                $('#mail2a_loader').hide();
     42                $('#mail2aMailResponse').html('<span class="send_test_failed">Please select the administrator emails.</span>');
     43                $('#mail2aMailResponse').html('');
     44            }, 3000);
     45            return;
     46        }
     47       
     48
    3649        $.ajax({
    3750            url: ajaxurl, // Provided by WordPress in admin
     
    5164                    // $('#mail2a_admin_emails_send').hide();
    5265                    $('#mail2a_loader').hide();
    53 
    54                     $('#mail2aMailResponse').html('<span class="send_test_success">Message sent successfully.</span>');
     66                    $('#mail2aMailResponse').html(`<span class="send_test_success"> ${response.data.message}</span>`);
    5567                }
    5668                //  else {
     
    6173            },
    6274            error: function(xhr, status, error) {
    63                
    64                 console.log(xhr.responseJSON.data);
     75                 console.error('Error:', error);
     76
    6577                if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) {
    6678                    errorMessage = xhr.responseJSON.data.message;
  • mail2admins/trunk/include/class-mail2a-admin.php

    r3307571 r3332419  
    7575                    ?>
    7676                    <?php
    77                     submit_button('Save Settings', 'primary', 'save_settings', false, array(
     77                    submit_button(__('Save Settings', 'mail2admins'), 'primary', 'save_settings', false, array(
    7878                        'id' => 'mail2a-save-settings',
    7979                        'class' => 'mail2a-save-settings',
     
    9494            // Verify request authenticity if using AJAX (recommended)
    9595            if (!check_ajax_referer('mail2a_send_test_email', 'nonce', false)) {
    96                 wp_send_json_error(array( 'message' => 'Invalid request.' ));
     96                wp_send_json_error(array( 'message' => esc_html__('Invalid request.', 'mail2admins' )), 400 );
    9797                return;
    9898            }
     
    100100            $mail2a_options = get_option('mail2a_options');
    101101            $admin_emails = isset( $mail2a_options['mail2a_recipients'] ) ? $mail2a_options['mail2a_recipients'] : array();
    102 
    103102            if (empty($admin_emails)) {
    104                 wp_send_json_error(array( 'message' => 'No valid admin emails found.' ));
    105                 return;
     103                wp_send_json_error(array( 'message' => esc_html__('No valid admin emails found.', 'mail2admins' )), 400 );
     104                exit;
    106105            }
    107106            /**
     
    112111             * @param string 'test email'.
    113112             */
    114             $subject = sanitize_text_field(apply_filters('mail2a_test_email_subject', 'Test Email from mail2admins'));
     113            $subject = sanitize_text_field(apply_filters('mail2a_test_email_subject', esc_html__('Test Email from mail2admins', 'mail2admins')));
    115114            /**
    116115             * Filter the test email message for the plugin.
     
    120119             * @param string 'test email'.
    121120             */
    122             $message = wp_kses_post(apply_filters('mail2a_test_email_message', 'This is a test mail from mail2admins'));
     121            $message = wp_kses_post(apply_filters('mail2a_test_email_message', esc_html__('This is a test mail from mail2admins', 'mail2admins')));
    123122            $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    124123   
     
    133132            }
    134133            if (empty($failed) && !empty($sucess)) {
    135                 wp_send_json_success(array( 'message' => 'Emails sent successfully.' ), 200);
     134                wp_send_json_success(array( 'message' => esc_html__( 'Email sent successfully.', 'mail2admins' )), 200);
    136135            } else if (empty($failed) && empty($sucess)) {
    137                 wp_send_json_error(array( 'message' => 'something went wrong, pls contact to support' ), 400);
     136                wp_send_json_error(array( 'message' => esc_html__('something went wrong, pls contact to support', 'mail2admins' )), 400);
    138137            } else if (!empty($failed)) {
    139                 wp_send_json_error(array( 'message' => 'Failed to send to: ' . implode(', ', $failed) ), 400);
     138                wp_send_json_error(array( 'message' => esc_html__('Failed to send to: ', 'mail2admins') . implode(', ', $failed) ), 400);
    140139            }
    141140            // else if(!empty($failed) && !empty($success)) {
  • mail2admins/trunk/include/class-mail2a-settings.php

    r3307370 r3332419  
    2727            // Setting
    2828            add_settings_section( 'mail2a_general_option', esc_html__('Settings', 'mail2admins' ), array( $this, 'mail2a_gen' ), $this->mail2a_option_page );
    29             add_settings_field( 'mail2a_admin_emails_checkbox', esc_html__('Enable Mail2Admins', 'mail2admins' ), array( $this, 'mail2a_enable' ), $this->mail2a_option_page, 'mail2a_general_option' );
    30             add_settings_field( 'mail2a_admin_emails', esc_html__('Select Administrators', 'mail2admins' ), array( $this, 'mail2a_admin_emails' ), $this->mail2a_option_page, 'mail2a_general_option' );         
    31             add_settings_field( 'mail2a_admin_emails_subject_filter_checkbox', esc_html__('Enable Subject Filter', 'mail2admins' ), array( $this, 'mail2a_enable_subject_forwarder' ), $this->mail2a_option_page, 'mail2a_general_option' );
    32 
    33             add_settings_field( 'mail2a_admin_emails_subject_filter', esc_html__( 'Forward if Subject Contains', 'mail2admins' ), array( $this, 'mail2a_admin_emails_subject_filter' ), $this->mail2a_option_page, 'mail2a_general_option' );
     29           
     30            add_settings_field(
     31            'mail2a_admin_emails_checkbox',
     32            wp_kses(
     33                    sprintf('%s <span class="dashicons dashicons-info tooltip-icon mail2a-tooltip" title="%s" tabindex="0" role="tooltip" aria-label="%s"></span>',
     34                        esc_html__('Enable Mail2Admins', 'mail2admins'),
     35                        esc_attr__("Mail2Admins will work after enabling this option", 'mail2admins'),
     36                        esc_attr__("Mail2Admins will work after enabling this option", 'mail2admins')
     37                    ),
     38                    [
     39                        'span' => [
     40                            'class' => [],
     41                            'title' => [],
     42                            'tabindex' => [],
     43                            'role' => [],
     44                            'aria-label' => []
     45                        ]
     46                    ]
     47            ),
     48            array( $this, 'mail2a_enable' ), $this->mail2a_option_page, 'mail2a_general_option' );
     49           
     50            add_settings_field(
     51            'mail2a_admin_emails',
     52            wp_kses(
     53                sprintf(
     54                    '%s <span class="dashicons dashicons-info tooltip-icon mail2a-tooltip" title="%s" tabindex="0" role="tooltip" aria-label="%s"></span>',
     55                    esc_html__('Select Administrator', 'mail2admins'),
     56                    esc_attr__("The admin email will be sent to the selected administrator email addresses.", 'mail2admins'),
     57                    esc_attr__("The admin email will be sent to the selected administrator email addresses.", 'mail2admins')
     58                ),
     59                [
     60                    'span' => [
     61                        'class' => [],
     62                        'title' => [],
     63                        'tabindex' => [],
     64                        'role' => [],
     65                        'aria-label' => []
     66                    ]
     67                ]
     68            ),
     69            array( $this, 'mail2a_admin_emails' ), $this->mail2a_option_page, 'mail2a_general_option' ); 
     70
     71            add_settings_field(
     72            'mail2a_admin_emails_subject_filter_checkbox',
     73            wp_kses(
     74                    sprintf(
     75                        '%s <span class="dashicons dashicons-info tooltip-icon mail2a-tooltip" title="%s" tabindex="0" role="tooltip" aria-label="%s"></span>',
     76                        esc_html__('Enable Subject Filter', 'mail2admins'),
     77                        esc_attr__("If this option is enabled, you must enter at least one subject — otherwise, the email won't be sent. You can keep it as disable this option to allow all emails.", 'mail2admins'),
     78                        esc_attr__("If this option is enabled, you must enter at least one subject — otherwise, the email won't be sent. You can keep it as disable this option to allow all emails.", 'mail2admins')
     79                    ),
     80                    [
     81                        'span' => [
     82                            'class' => [],
     83                            'title' => [],
     84                            'tabindex' => [],
     85                            'role' => [],
     86                            'aria-label' => []
     87                        ]
     88                    ]
     89            ),
     90            [$this, 'mail2a_enable_subject_forwarder'],
     91            $this->mail2a_option_page,'mail2a_general_option'
     92            );
     93
     94            add_settings_field(
     95            'mail2a_admin_emails_subject_filter',
     96            wp_kses(
     97                    sprintf(
     98                        '%s <span class="dashicons dashicons-info tooltip-icon mail2a-tooltip" title="%s" tabindex="0" role="tooltip" aria-label="%s"></span>',
     99                        esc_html__('Forward if Subject Contains', 'mail2admins'),
     100                        esc_attr__("Emails will only be sent if their subject matches one of the entries in the field", 'mail2admins'),
     101                        esc_attr__("Emails will only be sent if their subject matches one of the entries in the field", 'mail2admins')
     102                    ),
     103                    [
     104                        'span' => [
     105                            'class' => [],
     106                            'title' => [],
     107                            'tabindex' => [],
     108                            'role' => [],
     109                            'aria-label' => []
     110                        ]
     111                    ]
     112                ),array( $this, 'mail2a_admin_emails_subject_filter' ), $this->mail2a_option_page, 'mail2a_general_option' );
     113           
    34114            add_settings_field( 'mail2a_settings_tab', '', array( $this, 'mail2a_settings_tab' ), $this->mail2a_option_page, 'mail2a_general_option' );
    35115        }
     
    72152            echo '</select>';
    73153            echo '<p class="description mail2a_desc">' . esc_html__('To forward admin emails to multiple administrator role users, select their email addresses.', 'mail2admins') . '</p>';
     154
     155            echo '<div class="mail2a_send_email_container">';
    74156            echo '<button id="mail2a_admin_emails_send" class="mail2a_admin_emails_send">' . esc_html__('Send Test', 'mail2admins') . '</button>';
     157            echo '</div>';
    75158            echo '<div id="mail2a_loader" class="mail2a_spinner" style="display: none;"></div>';
    76159            echo '<span id="mail2aMailResponse"></span>';
     
    110193            }
    111194            ?>
    112             <input type="text" class="mail2a-tag-input" id="mail2a-tagInput" placeholder="Type and press comma...">
     195            <input type="text" class="mail2a-tag-input" id="mail2a-tagInput" placeholder="<?php echo esc_html__('Type and press comma...', 'mail2admins') ?>">
    113196            <input type="hidden" name="mail2a_options[mail2a_email_subjects]" id="mail2a-tagsHiddenInput" value="<?php echo esc_attr($tags); ?>">
    114197        </div>
  • mail2admins/trunk/languages/mail2admins-en_US.l10n.php

    r3307370 r3332419  
    11<?php
    2 return array(
    3     'project-id-version'=>'Mail2Admins',
    4     'report-msgid-bugs-to'=>'',
    5     'pot-creation-date'=>'2025-04-27 10:10+0000',
    6     'po-revision-date'=>'2025-04-27 10:10+0000',
    7     'last-translator'=>'',
    8     'language-team'=>'English (United States)',
    9     'language'=>'en_US',
    10     'plural-forms'=>'nplurals=2; plural=n != 1;',
    11     'mime-version'=>'1.0',
    12     'content-type'=>'text/plain; charset=UTF-8',
    13     'content-transfer-encoding'=>'8bit',
    14     'x-generator'=>'Loco https://localise.biz/',
    15     'x-loco-version'=>'2.7.2; wp-6.6.2',
    16     'x-domain'=>'mail2admins',
    17     'messages'=>array(),
    18 );
     2return ['project-id-version'=>'Mail2Admins','report-msgid-bugs-to'=>'','pot-creation-date'=>'2025-07-20 06:18+0000','po-revision-date'=>'2025-07-20 15:23+0000','last-translator'=>'','language-team'=>'English (United States)','language'=>'en_US','plural-forms'=>'nplurals=2; plural=n != 1;','mime-version'=>'1.0','content-type'=>'text/plain; charset=UTF-8','content-transfer-encoding'=>'8bit','x-generator'=>'Loco https://localise.biz/','x-loco-version'=>'2.8.0; wp-6.8.1; php-8.1.29','x-domain'=>'mail2admins','messages'=>[]];
  • mail2admins/trunk/languages/mail2admins-en_US.po

    r3307370 r3332419  
    33"Project-Id-Version: Mail2Admins\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2025-04-27 10:10+0000\n"
    6 "PO-Revision-Date: 2025-04-27 10:10+0000\n"
     5"POT-Creation-Date: 2025-07-20 06:18+0000\n"
     6"PO-Revision-Date: 2025-07-20 15:23+0000\n"
    77"Last-Translator: \n"
    88"Language-Team: English (United States)\n"
     
    1313"Content-Transfer-Encoding: 8bit\n"
    1414"X-Generator: Loco https://localise.biz/\n"
    15 "X-Loco-Version: 2.7.2; wp-6.6.2\n"
     15"X-Loco-Version: 2.8.0; wp-6.8.1; php-8.1.29\n"
    1616"X-Domain: mail2admins"
    1717
    18 #: include/class-m2a-settings.php:38
     18#: include/class-mail2a-settings.php:39
    1919msgid ""
    2020"Automatically forwards Admin emails to multiple users with Administrator-"
     
    2828msgstr ""
    2929
    30 #: include/class-m2a-settings.php:121
     30#: include/class-mail2a-settings.php:116
    3131msgid ""
    3232"Emails will only be forwarded if their subject matches one of the subjects "
     
    3434msgstr ""
    3535
    36 #: include/class-m2a-settings.php:28
     36#: include/class-mail2a-settings.php:29
    3737msgid "Enable Mail2Admins"
    3838msgstr ""
    3939
    40 #: include/class-m2a-settings.php:30
     40#: include/class-mail2a-settings.php:31
    4141msgid "Enable Subject Filter"
    4242msgstr ""
    4343
    44 #: include/class-m2a-settings.php:32
     44#: include/class-mail2a-settings.php:33
    4545msgid "Forward if Subject Contains"
    4646msgstr ""
    4747
    48 #: include/class-m2a-admin.php:40
     48#: include/class-mail2a-admin.php:50
    4949msgid "Get"
    5050msgstr ""
    5151
    52 #: include/class-m2a-admin.php:40
     52#: include/class-mail2a-admin.php:50
    5353msgid "Get Support"
    5454msgstr ""
    5555
    56 #: include/class-m2a-admin.php:40
     56#: include/class-mail2a-admin.php:50
    5757msgid "Help"
    5858msgstr ""
    5959
    6060#. Author URI of the plugin
    61 msgid "https://WPBrite.com"
     61msgid "https://wpbrite.com"
    6262msgstr ""
    6363
    6464#. URI of the plugin
    65 msgid "https://WPBrite.com/"
     65msgid "https://wpbrite.com/"
    6666msgstr ""
    6767
     
    7070msgstr ""
    7171
    72 #: include/class-m2a-settings.php:29
     72#: include/class-mail2a-admin.php:77
     73msgid "Save Settings"
     74msgstr ""
     75
     76#: include/class-mail2a-settings.php:30
    7377msgid "Select Administrators"
    7478msgstr ""
    7579
    76 #: include/class-m2a-settings.php:74
     80#: include/class-mail2a-settings.php:74
    7781msgid "Send Test"
    7882msgstr ""
    7983
    80 #: include/class-m2a-settings.php:27
     84#: include/class-mail2a-settings.php:28
    8185msgid "Settings"
    8286msgstr ""
    8387
    84 #: include/class-m2a-settings.php:73
     88#: include/class-mail2a-settings.php:73
    8589msgid ""
    8690"To forward admin emails to multiple administrator role users, select their "
     
    8892msgstr ""
    8993
     94#: include/class-mail2a-settings.php:112
     95msgid "Type and press comma..."
     96msgstr ""
     97
    9098#. Author of the plugin
    9199msgid "WPBrite"
  • mail2admins/trunk/languages/mail2admins.pot

    r3307370 r3332419  
    44"Project-Id-Version: Mail2Admins\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2025-04-27 10:10+0000\n"
     6"POT-Creation-Date: 2025-07-20 06:18+0000\n"
    77"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    88"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1414"Content-Transfer-Encoding: 8bit\n"
    1515"X-Generator: Loco https://localise.biz/\n"
    16 "X-Loco-Version: 2.7.2; wp-6.6.2\n"
     16"X-Loco-Version: 2.8.0; wp-6.8.1; php-8.1.29\n"
    1717"X-Domain: mail2admins"
    1818
    19 #: include/class-m2a-settings.php:38
     19#: include/class-mail2a-settings.php:39
    2020msgid ""
    2121"Automatically forwards Admin emails to multiple users with Administrator-"
     
    2929msgstr ""
    3030
    31 #: include/class-m2a-settings.php:121
     31#: include/class-mail2a-settings.php:116
    3232msgid ""
    3333"Emails will only be forwarded if their subject matches one of the subjects "
     
    3535msgstr ""
    3636
    37 #: include/class-m2a-settings.php:28
     37#: include/class-mail2a-settings.php:29
    3838msgid "Enable Mail2Admins"
    3939msgstr ""
    4040
    41 #: include/class-m2a-settings.php:30
     41#: include/class-mail2a-settings.php:31
    4242msgid "Enable Subject Filter"
    4343msgstr ""
    4444
    45 #: include/class-m2a-settings.php:32
     45#: include/class-mail2a-settings.php:33
    4646msgid "Forward if Subject Contains"
    4747msgstr ""
    4848
    49 #: include/class-m2a-admin.php:40
     49#: include/class-mail2a-admin.php:50
    5050msgid "Get"
    5151msgstr ""
    5252
    53 #: include/class-m2a-admin.php:40
     53#: include/class-mail2a-admin.php:50
    5454msgid "Get Support"
    5555msgstr ""
    5656
    57 #: include/class-m2a-admin.php:40
     57#: include/class-mail2a-admin.php:50
    5858msgid "Help"
    5959msgstr ""
    6060
    6161#. Author URI of the plugin
    62 msgid "https://WPBrite.com"
     62msgid "https://wpbrite.com"
    6363msgstr ""
    6464
    6565#. URI of the plugin
    66 msgid "https://WPBrite.com/"
     66msgid "https://wpbrite.com/"
    6767msgstr ""
    6868
     
    7171msgstr ""
    7272
    73 #: include/class-m2a-settings.php:29
     73#: include/class-mail2a-admin.php:77
     74msgid "Save Settings"
     75msgstr ""
     76
     77#: include/class-mail2a-settings.php:30
    7478msgid "Select Administrators"
    7579msgstr ""
    7680
    77 #: include/class-m2a-settings.php:74
     81#: include/class-mail2a-settings.php:74
    7882msgid "Send Test"
    7983msgstr ""
    8084
    81 #: include/class-m2a-settings.php:27
     85#: include/class-mail2a-settings.php:28
    8286msgid "Settings"
    8387msgstr ""
    8488
    85 #: include/class-m2a-settings.php:73
     89#: include/class-mail2a-settings.php:73
    8690msgid ""
    8791"To forward admin emails to multiple administrator role users, select their "
     
    8993msgstr ""
    9094
     95#: include/class-mail2a-settings.php:112
     96msgid "Type and press comma..."
     97msgstr ""
     98
    9199#. Author of the plugin
    92100msgid "WPBrite"
  • mail2admins/trunk/mail2admins.php

    r3310000 r3332419  
    55 * Plugin URI: https://wpbrite.com/
    66 * Description: Automatically forwards the WordPress Admin emails to multiple users with Administrator-level permissions
    7  * Version: 1.0.4
     7 * Version: 1.0.5
    88 * Author: WPBrite
    99 * Author URI: https://wpbrite.com
     
    2424
    2525// Define plugin constants
    26 define('MAIL2A_VERSION', '1.0.4');
     26define('MAIL2A_VERSION', '1.0.5');
    2727define('MAIL2A_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2828define('MAIL2A_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    5656            add_action('plugins_loaded', array( $this, 'init' ));
    5757            add_filter('wp_mail', array( $this, 'mail2a_add_admin_recipients' ));
     58            // wordpress localize for translation
    5859        }
    59 
    60        
    6160
    6261        /**
  • mail2admins/trunk/readme.txt

    r3310000 r3332419  
    11=== Mail2Admins ===
    22Contributors: WPBrite
    3 Tags: notification forwarder, forwarder, admin notifications.
     3Tags: Notifications forwarder, Email router, Admin notifications.
    44Requires at least: 6.0
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.5
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2525✅ Ideal for Notifications – Keep teams informed.
    2626
     27
     28= Translations
     29
     30Current supported languages include:
     31
     32Spanish, French, Italian, German, Portuguese Dutch, Czech, Russian, Vietnamese.
    2733
    2834== Frequently Asked Questions ==
     
    49551. Mail2Admins - Forward to administrator emails.
    50562. Mail2Admins - Subject base forwarding.
    51 
     573. Main2Admins - Menu Position
    5258
    5359== Changelog ==
     60
     61= 1.0.5 =
     62* Added - translations in Spanish (esponal), Italian, French, German, Dutch, Czech, Russian, Vietnamese, Portuguese
     63* Tweak - Added tooltips for better understanding
    5464
    5565= 1.0.4 =
Note: See TracChangeset for help on using the changeset viewer.