Plugin Directory

Changeset 3388694


Ignore:
Timestamp:
11/03/2025 08:53:56 AM (6 weeks ago)
Author:
ignatggeorgiev
Message:

Bump to 1.7.2

Location:
siteground-email-marketing/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • siteground-email-marketing/trunk/README.md

    r3336425 r3388694  
    44Requires PHP: 7.0
    55Tested up to: 6.8
    6 Stable tag: 1.7.1
     6Stable tag: 1.7.2
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4646
    4747== Changelog ==
     48= Version 1.7.2 =
     49Release Date: Nov 3rd, 2025
     50
     51* Security Improvements
     52
    4853= Version 1.7.1 =
    4954Release Date: Jul 30th, 2025
  • siteground-email-marketing/trunk/core/Forms/Forms.php

    r3336425 r3388694  
    6262     */
    6363    public function handle_form_submission() {
    64         if ( ! wp_verify_nonce( sanitize_key( $_POST['wpnonce'] ), 'sg-email-marketing-form' ) ) {
     64        if ( ! isset( $_POST['wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['wpnonce'] ), 'sg-email-marketing-form' ) ) {
    6565            wp_send_json_error();
    6666        }
    6767
    68         // Parse the URL-encoded string into an associative array
    69         parse_str( html_entity_decode( $_POST['form_data'] ), $data );
     68        if ( isset( $_POST['form_data'] ) ) {
     69            // Parse the URL-encoded string into an associative array
     70            parse_str( html_entity_decode( wp_unslash( $_POST['form_data'] ) ), $data );
     71        }
    7072
    71         if ( empty( $data['form-id'] ) || ! empty( $data['spam-protection'] )  ) {
     73        if ( empty( $data['form-id'] ) || ! empty( $data['spam-protection'] ) ) {
    7274            wp_send_json_error();
    7375        }
     
    105107
    106108            if ( intval( $field['required'] ) === 1 && empty( $field_value ) ) {
     109                // translators: the label for the required form field.
    107110                $errors[ $field['sg-form-type'] ] = printf( esc_attr__( 'The field "%s" is required!', 'siteground-email-marketing' ), esc_attr( $field['label'] ) );
    108111                continue;
  • siteground-email-marketing/trunk/core/Integrations/Elementor/Widget.php

    r3026310 r3388694  
    224224            [
    225225                'type'            => Controls_Manager::RAW_HTML,
    226                 'raw'             => __( '<strong>Colors</strong>', 'siteground-email-marketing' ),
     226                'raw'             => '<strong>' . esc_html__( 'Colors', 'siteground-email-marketing' ) . '</strong>',
    227227                'separator'       => 'after',
    228228            ]
     
    334334            [
    335335                'type'            => Controls_Manager::RAW_HTML,
    336                 'raw'             => __( '<strong>Colors</strong>', 'siteground-email-marketing' ),
     336                'raw'             => '<strong>' . __( 'Colors', 'siteground-email-marketing' ) . '</strong>',
    337337                'separator'       => 'after',
    338338            ]
     
    383383
    384384        if ( $settings['formId'] ) {
    385             echo Renderer::get_instance()->render( esc_attr( $settings['formId'] ), $settings );
     385            echo Renderer::get_instance()->render( esc_attr( $settings['formId'] ), $settings ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, found 'Renderer'.
    386386        }
    387387    }
  • siteground-email-marketing/trunk/core/Integrations/ThirdParty/CF7.php

    r3194285 r3388694  
    147147        }
    148148
    149         $post_id = esc_attr( $_POST['post_ID'] );
    150         update_post_meta( $post_id, self::CF7_TOGGLE_META, isset( $_POST['sgwpmail-cf7-enable'] ) );
    151         update_post_meta( $post_id, self::CF7_CHECKBOX_META, isset( $_POST['sgwpmail-cf7-checkbox-toggle'] ) );
    152 
    153         if ( isset ( $_POST['sgwpmail-cf7-labels'] ) ) {
    154             update_post_meta( $post_id, self::CF7_SELECTED_LABELS_META, $_POST['sgwpmail-cf7-labels'] );
     149        $post_id = esc_attr( sanitize_text_field( wp_unslash( $_POST['post_ID'] ) ) ); // phpcs:ignore
     150        update_post_meta( $post_id, self::CF7_TOGGLE_META, isset( $_POST['sgwpmail-cf7-enable'] ) ); // phpcs:ignore
     151        update_post_meta( $post_id, self::CF7_CHECKBOX_META, isset( $_POST['sgwpmail-cf7-checkbox-toggle'] ) ); // phpcs:ignore
     152
     153        if ( isset( $_POST['sgwpmail-cf7-labels'] ) ) {  // phpcs:ignore WordPress.Security.NonceVerification.Missing
     154            update_post_meta( $post_id, self::CF7_SELECTED_LABELS_META, $_POST['sgwpmail-cf7-labels'] ); // phpcs:ignore
    155155        } else {
    156156            delete_post_meta( $post_id, self::CF7_SELECTED_LABELS_META );
    157157        }
    158158
    159         if ( isset( $_POST['sgwpmail-cf7-checkbox-label'] ) ) {
    160             update_post_meta( $post_id, self::CF7_CHECKBOX_LABEL_META, esc_attr( $_POST['sgwpmail-cf7-checkbox-label'] ) );
     159        if ( isset( $_POST['sgwpmail-cf7-checkbox-label'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
     160            update_post_meta( $post_id, self::CF7_CHECKBOX_LABEL_META, esc_attr( $_POST['sgwpmail-cf7-checkbox-label'] ) ); // phpcs:ignore
    161161        } else {
    162162            delete_post_meta( $post_id, self::CF7_CHECKBOX_LABEL_META );
     
    170170     */
    171171    public function get_data() {
    172         return array_merge( (array) $_GET, (array) $_POST );
     172        return array_merge( (array) $_GET, (array) $_POST ); // phpcs:ignore
    173173    }
    174174
     
    317317     */
    318318    public function enqueue_styles_scripts() {
    319         wp_enqueue_script( 'selectize.js', 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/js/selectize.min.js', array( 'jquery' ) );
    320         wp_enqueue_style( 'selectize.js', 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/css/selectize.default.min.css' );
    321         wp_enqueue_style( 'googleFonts', '//fonts.googleapis.com/css2?family=Roboto&display=swap', array(), null );
     319        wp_enqueue_script( 'selectize.js', 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/js/selectize.min.js', array( 'jquery' ), '0.15.2', true );
     320        wp_enqueue_style( 'selectize.js', 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/css/selectize.default.min.css', array(), '0.15.2', 'all' );
     321        wp_enqueue_style( 'googleFonts', '//fonts.googleapis.com/css2?family=Roboto&display=swap', array(), '1.0.0', 'all' );
    322322
    323323        wp_enqueue_script(
     
    347347     */
    348348    public function get_label_ids( $label_names ) {
     349
    349350        $labels_list = Loader::get_instance()->mailer_api->get_labels();
    350351
  • siteground-email-marketing/trunk/core/Integrations/ThirdParty/GravityForms/GravityForms.php

    r3194285 r3388694  
    259259            field.inputs = null;
    260260            if (!field.label)
    261                 field.label = <?php echo json_encode( esc_html__( 'Newsletter subscription', 'siteground-email-marketing' ) ); ?>;
     261                field.label = <?php echo wp_json_encode( esc_html__( 'Newsletter subscription', 'siteground-email-marketing' ) ); ?>;
    262262            if( !field.sgwpmailConsentToggle)
    263263                field.sgwpmailConsentToggle = true;
    264264            if( !field.sgwpmailConsentText)
    265                 field.sgwpmailConsentText = '<?php _e( 'Subscribe to our Newsletter', 'siteground-email-marketing' ); ?>';
     265                field.sgwpmailConsentText = '<?php esc_html_e( 'Subscribe to our Newsletter', 'siteground-email-marketing' ); ?>';
    266266                jQuery( '.sg_email_marketing_field_preview_label').text(field.sgwpmailConsentText);
    267267            break;
  • siteground-email-marketing/trunk/core/Integrations/ThirdParty/NinjaForms/SGWPMAIL_Action.php

    r3075649 r3388694  
    102102     */
    103103    public function get_groups_html( $action ) {
    104         $form_id = isset( $_GET['form_id'] ) ? wp_unslash( $_GET['form_id'] ) : 0;
     104        $form_id = isset( $_GET['form_id'] ) ? sanitize_text_field( wp_unslash( $_GET['form_id'] ) ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    105105
    106106        $form = \Ninja_Forms()->form( $form_id )->get();
  • siteground-email-marketing/trunk/core/Integrations/ThirdParty/WPForms/SGWPMAIL_WPForms_Field.php

    r3091421 r3388694  
    204204    public function field_preview( $field ) {
    205205        echo '<h4 class="sg-email-marketing-checkbox-disabled"><i class="fa fa-eye-slash"></i> ' .
    206             __( 'Consent checkbox is NOT ADDED. We recommend adding a consent checkbox if the main purpose of the form is not subscription. To include a consent checkbox, simply click on this alert and activate the Consent Checkbox option from the settings menu.<br>Note: This message is for administrative purposes and will not be visible to users.', 'siteground-email-marketing' ) .
     206            esc_html__( 'Consent checkbox is NOT ADDED. We recommend adding a consent checkbox if the main purpose of the form is not subscription. To include a consent checkbox, simply click on this alert and activate the Consent Checkbox option from the settings menu.<br>Note: This message is for administrative purposes and will not be visible to users.', 'siteground-email-marketing' ) .
    207207            '</h4>';
    208208
    209209        $checkbox_text = isset( $field['sg_email_marketing_checkbox_text'] ) ? $field['sg_email_marketing_checkbox_text'] : '';
    210210
    211         printf( '<div class="sg-email-marketing-checkbox-enabled"><input type="checkbox" disabled><span class="sg_email_marketing_field_preview_label">%s</span></div>', $checkbox_text );
    212 
     211        printf( '<div class="sg-email-marketing-checkbox-enabled"><input type="checkbox" disabled><span class="sg_email_marketing_field_preview_label">%s</span></div>', esc_html( $checkbox_text ) );
    213212    }
    214213
     
    229228        $field_id   = $field['properties']['inputs']['primary']['id'];
    230229        $field_name = $field['properties']['inputs']['primary']['attr']['name'];
    231         printf( '<input id="%s" value="1" name="%s" type="checkbox"><label for="%s" class="sg_email_marketing_field_preview_label">%s</span>', $field_id, $field_name, $field_id, $field['sg_email_marketing_checkbox_text'] );
    232 
     230        printf( '<input id="%s" value="1" name="%s" type="checkbox"><label for="%s" class="sg_email_marketing_field_preview_label">%s</span>', esc_attr( $field_id ), esc_attr( $field_name ), esc_attr( $field_id ), esc_html( $field['sg_email_marketing_checkbox_text'] ) );
    233231    }
    234232
  • siteground-email-marketing/trunk/core/Integrations/ThirdParty/WPForms/WPForms.php

    r3194285 r3388694  
    7878     */
    7979    public function enqueue_styles_scripts() {
    80         wp_enqueue_script( 'selectize.js', 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/js/selectize.min.js', array( 'jquery' ) );
    81         wp_enqueue_style( 'selectize.js', 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/css/selectize.default.min.css' );
    82         wp_enqueue_style( 'googleFonts', '//fonts.googleapis.com/css2?family=Roboto&display=swap', array(), null );
     80        wp_enqueue_script( 'selectize.js', 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/js/selectize.min.js', array( 'jquery' ), '0.15.2', true );
     81        wp_enqueue_style( 'selectize.js', 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/css/selectize.default.min.css', array(), '0.15.2', 'all' );
     82        wp_enqueue_style( 'googleFonts', '//fonts.googleapis.com/css2?family=Roboto&display=swap', array(), '1.0.0', 'all' );
    8383
    8484        wp_enqueue_script(
     
    105105     */
    106106    public function save_form() {
    107         if ( isset( $_POST['form_id'] ) && isset( $_POST['sg_email_marketing_groups'] ) ) {
    108             update_post_meta( esc_attr( $_POST['form_id'] ), 'sg_email_marketing_groups', json_decode( stripslashes( $_POST['sg_email_marketing_groups'] ) ) );
     107        if ( isset( $_POST['form_id'] ) && isset( $_POST['sg_email_marketing_groups'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
     108            update_post_meta( esc_attr( $_POST['form_id'] ), 'sg_email_marketing_groups', json_decode( stripslashes( $_POST['sg_email_marketing_groups'] ) ) ); // phpcs:ignore
    109109        }
    110110    }
  • siteground-email-marketing/trunk/core/Pages/Page.php

    r3011980 r3388694  
    5252        // Hide all error in our page.
    5353        if (
    54             isset( $_GET['page'] ) &&
     54            isset( $_GET['page'] ) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    5555            ( $this->page_id === $_GET['page'] ) // phpcs:ignore
    5656        ) {
  • siteground-email-marketing/trunk/core/Renderer/Renderer.php

    r3336425 r3388694  
    153153     */
    154154    public function render( $form_id, $attr ) {
    155         $form         = get_post( $form_id );
     155        $form_id = (int) $form_id;
     156        $form = get_post( $form_id );
     157        // Check if the form id belongs to the 'sg_form' post type.
     158        if ( 'sg_form' !== $form->post_type ) {
     159            return;
     160        }
     161
    156162        $fields       = json_decode( $form->post_content );
    157163        $attr['hash'] = bin2hex( random_bytes( 18 ) );
     
    159165        $orientation  = isset( $attr['formOrientation'] ) ? 'sg-marketing-form-container-' . $attr['formOrientation'] : 'sg-marketing-form-container-column';
    160166
    161         $html .= '<form class="sg-marketing-form sg-email-marketing-form-' . $form_id . '-' . $attr['hash'] . '">';
     167        $html .= '<form class="sg-marketing-form sg-email-marketing-form-' . esc_attr( $form_id ) . '-' . $attr['hash'] . '">';
    162168        $html .= \wp_nonce_field( 'sg-email-marketing-form', '_wpnonce', true, false );
    163         $html .= '<div class="sg-email-marketing-form-' . $form_id . '-' . $attr['hash'] . ' sg-marketing-form-submit_message sg-marketing-form-submit_message--hidden sg-marketing-form-submit_message--success">' . $fields->settings->success_message . '</div>';
    164         $html .= '<div class="sg-email-marketing-form-' . $form_id . '-' . $attr['hash'] . ' sg-marketing-form-submit_message sg-marketing-form-submit_message--hidden sg-marketing-form-submit_message--error">' . __( 'There was an issue submitting the form!', 'siteground-email-marketing' ) . '</div>';
    165         $html .= '<fieldset id="sg-email-marketing-' . esc_attr( $form_id ) . '" class="sg-marketing-form-container sg-email-marketing-form-' . $form_id . '-' . $attr['hash'] . ' ' . esc_attr( $orientation ) . '">';
     169        $html .= '<div class="sg-email-marketing-form-' . esc_attr( $form_id ) . '-' . $attr['hash'] . ' sg-marketing-form-submit_message sg-marketing-form-submit_message--hidden sg-marketing-form-submit_message--success">' . esc_html( $fields->settings->success_message ) . '</div>';
     170        $html .= '<div class="sg-email-marketing-form-' . esc_attr( $form_id ) . '-' . $attr['hash'] . ' sg-marketing-form-submit_message sg-marketing-form-submit_message--hidden sg-marketing-form-submit_message--error">' . __( 'There was an issue submitting the form!', 'siteground-email-marketing' ) . '</div>';
     171        $html .= '<fieldset id="sg-email-marketing-' . esc_attr( $form_id ) . '" class="sg-marketing-form-container sg-email-marketing-form-' . esc_attr( $form_id ) . '-' . $attr['hash'] . ' ' . esc_attr( $orientation ) . '">';
    166172
    167173        // Check if $fields->title is set and is an array.
     
    205211                    $html .= '<div class="sg-input-container">';
    206212                    if ( ! empty( $field->label ) ) {
    207                         $html .= '<label for="input-' . esc_attr( $field->id ) . $attr['hash'] . '"> ' . $field->label;
     213                        $html .= '<label for="input-' . esc_attr( $field->id ) . $attr['hash'] . '"> ' . esc_html( $field->label );
    208214                            $html .= ( $required ? ' <span class="sg-marketing-form-required-label" aria-hidden="true">*</span>' : '' );
    209215                        $html .= '</label>';
     
    229235
    230236            $link = ! empty( $fields->consent->consent_link ) ?
    231                 '<a ' . $new_tab . ' href="' . $fields->consent->consent_link . '">' . $fields->consent->consent_text . '</a>' :
    232                 $fields->consent->consent_text;
     237                '<a ' . $new_tab . ' href="' . esc_url( $fields->consent->consent_link ) . '">' . esc_html( $fields->consent->consent_text ) . '</a>' :
     238                esc_html( $fields->consent->consent_text );
    233239
    234240            if ( ! empty( $fields->consent->consent_checkbox ) ) {
  • siteground-email-marketing/trunk/core/Rest/Controllers/v1/Pages/Forms.php

    r3329603 r3388694  
    2323
    2424    /**
     25     * The Database placeholder.
     26     */
     27    public $wpdb;
     28
     29    /**
    2530     * The Constructor.
    2631     *
     
    3136        $this->namespace = $this->rest_namespace;
    3237        $this->rest_base = 'forms';
     38
     39        global $wpdb;
     40        $this->wpdb = $wpdb;
    3341    }
    3442
     
    8593     */
    8694    public function form_title_exists( $title, $id ) {
    87         global $wpdb;
    88 
    89         $posts = $wpdb->get_results(
    90             $wpdb->prepare(
    91                 "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type = 'sg_form' AND post_status = 'publish' LIMIT 1",
    92                 $title,
    93             ),
     95
     96        $posts = $this->wpdb->get_results(
     97                    $this->wpdb->prepare( // phpcs:ignore
     98                        'SELECT ID FROM ' . esc_sql( $this->wpdb->posts ) . " WHERE post_title = %s AND post_type = 'sg_form' AND post_status = 'publish' LIMIT 1",
     99                        esc_sql( $title ),
     100                    ),
    94101            ARRAY_A
    95102        );
  • siteground-email-marketing/trunk/core/Services/Cron/Cron.php

    r3091421 r3388694  
    3434
    3535    /**
     36     * The Database placeholder.
     37     */
     38    public $wpdb;
     39
     40    /**
    3641     * The constructor.
    3742     *
     
    4247    public function __construct( $background_process ) {
    4348        $this->background_process = $background_process;
     49
     50        global $wpdb;
     51        $this->wpdb = $wpdb;
    4452    }
    4553
     
    8593     */
    8694    private function get_data() {
    87         global $wpdb;
    8895
    89         $results = $wpdb->get_results(
    90             "
    91             SELECT `meta_value`
    92                 FROM $wpdb->postmeta
    93             WHERE `meta_key` = 'sg_email_marketing_user_data'
    94             UNION ALL
    95             SELECT `meta_value`
    96                 FROM $wpdb->usermeta
    97             WHERE `meta_key` = 'sg_email_marketing_user_data'
    98             UNION ALL
    99             SELECT `meta_value`
    100                 FROM $wpdb->commentmeta
    101             WHERE `meta_key` = 'sg_email_marketing_user_data'
    102             "
     96        $results = $this->wpdb->get_results(
     97                        $this->wpdb->prepare( //phpcs:ignore
     98                            '
     99                            SELECT `meta_value`
     100                                FROM ' . esc_sql( $this->wpdb->postmeta ) . '
     101                            WHERE `meta_key` = %s
     102                            UNION ALL
     103                            SELECT `meta_value`
     104                                FROM ' . esc_sql( $this->wpdb->usermeta ) . '
     105                            WHERE `meta_key` = %s
     106                            UNION ALL
     107                            SELECT `meta_value`
     108                                FROM ' . esc_sql( $this->wpdb->commentmeta ) . '
     109                            WHERE `meta_key` = %s
     110                            ',
     111                            'sg_email_marketing_user_data',
     112                            'sg_email_marketing_user_data',
     113                            'sg_email_marketing_user_data'
     114                        )
    103115        );
     116
    104117        foreach( $results as $index => $result ) {
    105118            if ( is_array( $result->meta_value ) ) {
     
    128141        global $wpdb;
    129142
    130         $results = $wpdb->get_results( "DELETE FROM $wpdb->postmeta WHERE `meta_key` = 'sg_email_marketing_user_data';" );
    131         $results = $wpdb->get_results( "DELETE FROM $wpdb->usermeta WHERE `meta_key` = 'sg_email_marketing_user_data';" );
    132         $results = $wpdb->get_results( "DELETE FROM $wpdb->commentmeta WHERE `meta_key` = 'sg_email_marketing_user_data';" );
     143        $results = $wpdb->get_results(
     144                    $wpdb->prepare(  //phpcs:ignore
     145                        'DELETE FROM ' . esc_sql( $wpdb->postmeta ) . ' WHERE `meta_key` = %s;',
     146                        'sg_email_marketing_user_data'
     147                    )
     148        );
     149
     150        $results = $wpdb->get_results(
     151                    $wpdb->prepare(  //phpcs:ignore
     152                        'DELETE FROM ' . esc_sql( $wpdb->usermeta ) . ' WHERE `meta_key` = %s;',
     153                        'sg_email_marketing_user_data'
     154                    )
     155        );
     156
     157        $results = $wpdb->get_results(
     158                    $wpdb->prepare(  //phpcs:ignore
     159                        'DELETE FROM ' . esc_sql( $wpdb->commentmeta ) . ' WHERE `meta_key` = %s;',
     160                        'sg_email_marketing_user_data'
     161                    )
     162        );
    133163    }
    134164}
  • siteground-email-marketing/trunk/core/Services/Mailer_Api/Mailer_Api.php

    r3329603 r3388694  
    2626
    2727    /**
    28      * Call the mailer api.
     28     * Call the mailer API.
    2929     *
    3030     * @since  1.0.0
     
    3636     * @throws \Exception An exception if something went wrong.
    3737     *
    38      * @return array         The response from the mailer api.
     38     * @return array         The response from the mailer API.
    3939     */
    4040    private function call( $route, $data = array(), $method = 'GET' ) {
    4141        if ( empty( $this->token ) ) {
    42             throw new \Exception( __( 'Missing api token.', 'siteground-email-marketing' ), 400 );
     42            throw new \Exception( esc_html__( 'Missing api token.', 'siteground-email-marketing' ), 400 );
    4343        }
    4444
    4545        // Load .env and retrieve constants.
    46         $api_url  = ! isset( $_ENV['SG_EM_API_URL'] ) ? self::API_URL : $_ENV['SG_EM_API_URL'];
    47         $api_host = ! isset( $_ENV['SG_EM_API_HOST'] ) ? '' : $_ENV['SG_EM_API_HOST'];
     46        $api_url  = ! isset( $_ENV['SG_EM_API_URL'] ) ? self::API_URL : esc_url_raw( $_ENV['SG_EM_API_URL'] );
     47        $api_host = ! isset( $_ENV['SG_EM_API_HOST'] ) ? '' : sanitize_text_field( $_ENV['SG_EM_API_HOST'] );
    4848
    4949        $headers = array(
     
    213213
    214214            if ( 401 === $status_code ) {
    215                 throw new \Exception( __( 'Please provide a valid token', 'siteground-email-marketing' ), 403 );
     215                throw new \Exception( esc_html__( 'Please provide a valid token', 'siteground-email-marketing' ), 403 );
    216216            }
    217217        }
     
    239239
    240240        if ( is_wp_error( $response ) ) {
    241             throw new \Exception( __( 'WordPress cannot process the request.', 'siteground-email-marketing' ), 400 );
     241            throw new \Exception( esc_html__( 'WordPress cannot process the request.', 'siteground-email-marketing' ), 400 );
    242242        }
    243243
  • siteground-email-marketing/trunk/sg-email-marketing.php

    r3336425 r3388694  
    1111 * Plugin URI:        https://siteground.com
    1212 * Description:       Use this plugin to link your WordPress site with the SiteGround Email Marketing service and seamlessly grow your mailing list!
    13  * Version:           1.7.1
     13 * Version:           1.7.2
    1414 * Author:            SiteGround
    1515 * Author URI:        https://www.siteground.com
     
    3333// Define version constant.
    3434if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
    35     define( __NAMESPACE__ . '\VERSION', '1.7.1' );
     35    define( __NAMESPACE__ . '\VERSION', '1.7.2' );
    3636}
    3737
  • siteground-email-marketing/trunk/templates/CF7_Checkbox_Markup.php

    r3075649 r3388694  
    33    <input type="checkbox" name="<?php echo esc_attr( $this->checkbox_name ); ?>" value="1" />
    44    <label for="<?php echo esc_attr( $this->checkbox_name ); ?>">
    5         <?php echo $label; ?>
     5        <?php echo esc_html( $label ); ?>
    66    </label>
    77</span>
  • siteground-email-marketing/trunk/templates/CF7_Integration_Tab_Template.php

    r3075649 r3388694  
    11<div class="sgwpmail-cf7-integration">
    2     <h3 class="sgwpmail-cf7-page-heading"> <?php _e( 'SiteGround Email Marketing', 'siteground-email-marketing' ); ?> </h3>
     2    <h3 class="sgwpmail-cf7-page-heading"> <?php esc_html_e( 'SiteGround Email Marketing', 'siteground-email-marketing' ); ?> </h3>
    33    <span class="sgwpmail-cf7-enable-checkbox">
    4         <h4 class="sgwpmail-cf7-page-label"> <?php _e( 'Enable SG Email Marketing', 'siteground-email-marketing' ) ?> </h4>
    5         <input type="checkbox" <?php echo $is_integration_enabled; ?> id="sgwpmail-cf7-enable" name="sgwpmail-cf7-enable"/>
     4        <h4 class="sgwpmail-cf7-page-label"> <?php esc_html_e( 'Enable SG Email Marketing', 'siteground-email-marketing' ); ?> </h4>
     5        <input type="checkbox" <?php echo esc_attr( $is_integration_enabled ); ?> id="sgwpmail-cf7-enable" name="sgwpmail-cf7-enable"/>
    66        <label for="sgwpmail-cf7-enable">
    7             <?php _e( 'Enable people filling this form to be added as subscribers to SiteGround Email Marketing', 'siteground-email-marketing' ); ?>
     7            <?php esc_html_e( 'Enable people filling this form to be added as subscribers to SiteGround Email Marketing', 'siteground-email-marketing' ); ?>
    88        </label>
    99    </span>
    1010    <span class="sgwpmail-cf7-checkbox-toggle">
    11         <h4 class="sgwpmail-cf7-page-label"> <?php _e( 'Manage Consent', 'siteground-email-marketing' ); ?></h4>
    12         <input type="checkbox" <?php echo $is_checkbox_enabled; ?> id="sgwpmail-cf7-checkbox-toggle" name="sgwpmail-cf7-checkbox-toggle"/>
     11        <h4 class="sgwpmail-cf7-page-label"> <?php esc_html_e( 'Manage Consent', 'siteground-email-marketing' ); ?></h4>
     12        <input type="checkbox" <?php echo esc_attr( $is_checkbox_enabled ); ?> id="sgwpmail-cf7-checkbox-toggle" name="sgwpmail-cf7-checkbox-toggle"/>
    1313        <label for="sgwpmail-cf7-checkbox-toggle">
    14             <?php _e( 'Display consent checkbox. (Recommended if subscription is not the main purpose of the form)', 'siteground-email-marketing' ); ?>
     14            <?php esc_html_e( 'Display consent checkbox. (Recommended if subscription is not the main purpose of the form)', 'siteground-email-marketing' ); ?>
    1515        </label>
    1616    </span>
    1717    <span class="sgwpmail-cf7-checkbox-label-input">
    1818        <label class="sgwpmail-cf7-page-label" for="sgwpmail-cf7-checbkox-label">
    19             <?php _e( 'Consent checkbox text.', 'siteground-email-marketing' ); ?>
     19            <?php esc_html_e( 'Consent checkbox text.', 'siteground-email-marketing' ); ?>
    2020        </label>
    21         <input id="sgwpmail-cf7-checkbox-label" name="sgwpmail-cf7-checkbox-label" value="<?php echo $checkbox_label; ?>"/>
     21        <input id="sgwpmail-cf7-checkbox-label" name="sgwpmail-cf7-checkbox-label" value="<?php echo esc_attr( $checkbox_label ); ?>"/>
    2222    </span>
    2323    <span class=sgwpmail-cf7-labels-dropdown>
    2424        <label class="sgwpmail-cf7-page-label" for="sgwpmail-cf7-labels">
    25             <?php _e( 'Groups', 'siteground-email-marketing' ); ?>
     25            <?php esc_html_e( 'Groups', 'siteground-email-marketing' ); ?>
    2626        </label>
    2727        <select multiple id="sgwpmail-cf7-labels" name="sgwpmail-cf7-labels[]">
     
    2929                foreach ( $labels_list['data'] as $label ) {
    3030                    if ( 'array' === gettype( $saved_labels ) && \in_array( $label['name'], $saved_labels ) ) {
    31                         echo '<option selected value="' . $label['name'] . '">' . $label['name'] . '</option>';
     31                        echo '<option selected value="' . esc_attr( $label['name'] ) . '">' . esc_html( $label['name'] ) . '</option>';
    3232                        continue;
    3333                    }
    34                     echo '<option value="' . $label['name'] . '">' . $label['name'] . '</option>';
     34                    echo '<option value="' . esc_attr( $label['name'] ) . '">' . esc_html( $label['name'] ) . '</option>';
    3535                }
    3636            ?>
    3737        </select>
    3838        <span class="sgwpmail-description">
    39             <?php _e( 'People subscribing through this form will be added to the selected groups', 'siteground-email-marketing' ); ?>
     39            <?php esc_html_e( 'People subscribing through this form will be added to the selected groups', 'siteground-email-marketing' ); ?>
    4040        </span>
    4141    </span>
  • siteground-email-marketing/trunk/templates/GF_Integration_Field_Settings.php

    r3076798 r3388694  
    1515        <span class=sgwpmail-groups-dropdown>
    1616            <label class="sgwpmail-page-label" for="sgwpmail-gf-groups">
    17                 <?php _e( 'Groups', 'siteground-email-marketing' ); ?>
     17                <?php esc_html_e( 'Groups', 'siteground-email-marketing' ); ?>
    1818                <?php \gform_tooltip( 'sgwpmail_groups' ); ?>
    1919            </label>
     
    2222                foreach ( $labels_list as $label ) {
    2323                    if ( 'array' === gettype( $saved_labels ) && \in_array( $label, $saved_labels ) ) {
    24                         echo '<option selected value="' . $label . '">' . $label . '</option>';
     24                        echo '<option selected value="' . esc_attr( $label ) . '">' . esc_html( $label ) . '</option>';
    2525                        continue;
    2626                    }
    27                     echo '<option value="' . $label . '">' . $label . '</option>';
     27                    echo '<option value="' . esc_attr( $label ) . '">' . esc_html( $label ) . '</option>';
    2828                }
    2929                ?>
     
    3232    </li>
    3333    <li class="sgwpmail_consent_toggle field_setting">
    34         <label> <?php _e( 'Manage Consent', 'siteground-email-marketing' ); ?> </label>
     34        <label> <?php esc_html_e( 'Manage Consent', 'siteground-email-marketing' ); ?> </label>
    3535        <input type="checkbox" id="field_sgwpmail_consent_toggle" onclick="sgwpmail_change_consent_checkbox(this);" />
    3636        <label for="field_sgwpmail_consent_toggle" style="display:inline;">
    37             <?php _e( "Display consent checkbox", "siteground-email-marketing" ); ?>
     37            <?php esc_html_e( "Display consent checkbox", "siteground-email-marketing" ); ?>
    3838            <?php \gform_tooltip( 'sgwpmail_manage_consent' ); ?>
    3939        </label>
     
    4646    <li class="sgwpmail_consent_text field_setting">
    4747        <label for="field_sgwpmail_consent_text">
    48             <?php _e("Consent Checkbox Text", "siteground-email-marketing"); ?>
     48            <?php esc_html_e( "Consent Checkbox Text", "siteground-email-marketing" ); ?>
    4949            <?php \gform_tooltip( 'sgwpmail_consent_label' ); ?>
    5050        </label>
Note: See TracChangeset for help on using the changeset viewer.