Changeset 3388694
- Timestamp:
- 11/03/2025 08:53:56 AM (6 weeks ago)
- Location:
- siteground-email-marketing/trunk
- Files:
-
- 17 edited
-
README.md (modified) (2 diffs)
-
core/Forms/Forms.php (modified) (2 diffs)
-
core/Integrations/Elementor/Widget.php (modified) (3 diffs)
-
core/Integrations/ThirdParty/CF7.php (modified) (4 diffs)
-
core/Integrations/ThirdParty/GravityForms/GravityForms.php (modified) (1 diff)
-
core/Integrations/ThirdParty/NinjaForms/SGWPMAIL_Action.php (modified) (1 diff)
-
core/Integrations/ThirdParty/WPForms/SGWPMAIL_WPForms_Field.php (modified) (2 diffs)
-
core/Integrations/ThirdParty/WPForms/WPForms.php (modified) (2 diffs)
-
core/Pages/Page.php (modified) (1 diff)
-
core/Renderer/Renderer.php (modified) (4 diffs)
-
core/Rest/Controllers/v1/Pages/Forms.php (modified) (3 diffs)
-
core/Services/Cron/Cron.php (modified) (4 diffs)
-
core/Services/Mailer_Api/Mailer_Api.php (modified) (4 diffs)
-
sg-email-marketing.php (modified) (2 diffs)
-
templates/CF7_Checkbox_Markup.php (modified) (1 diff)
-
templates/CF7_Integration_Tab_Template.php (modified) (2 diffs)
-
templates/GF_Integration_Field_Settings.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
siteground-email-marketing/trunk/README.md
r3336425 r3388694 4 4 Requires PHP: 7.0 5 5 Tested up to: 6.8 6 Stable tag: 1.7. 16 Stable tag: 1.7.2 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 46 46 47 47 == Changelog == 48 = Version 1.7.2 = 49 Release Date: Nov 3rd, 2025 50 51 * Security Improvements 52 48 53 = Version 1.7.1 = 49 54 Release Date: Jul 30th, 2025 -
siteground-email-marketing/trunk/core/Forms/Forms.php
r3336425 r3388694 62 62 */ 63 63 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' ) ) { 65 65 wp_send_json_error(); 66 66 } 67 67 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 } 70 72 71 if ( empty( $data['form-id'] ) || ! empty( $data['spam-protection'] ) ) {73 if ( empty( $data['form-id'] ) || ! empty( $data['spam-protection'] ) ) { 72 74 wp_send_json_error(); 73 75 } … … 105 107 106 108 if ( intval( $field['required'] ) === 1 && empty( $field_value ) ) { 109 // translators: the label for the required form field. 107 110 $errors[ $field['sg-form-type'] ] = printf( esc_attr__( 'The field "%s" is required!', 'siteground-email-marketing' ), esc_attr( $field['label'] ) ); 108 111 continue; -
siteground-email-marketing/trunk/core/Integrations/Elementor/Widget.php
r3026310 r3388694 224 224 [ 225 225 'type' => Controls_Manager::RAW_HTML, 226 'raw' => __( '<strong>Colors</strong>', 'siteground-email-marketing' ),226 'raw' => '<strong>' . esc_html__( 'Colors', 'siteground-email-marketing' ) . '</strong>', 227 227 'separator' => 'after', 228 228 ] … … 334 334 [ 335 335 'type' => Controls_Manager::RAW_HTML, 336 'raw' => __( '<strong>Colors</strong>', 'siteground-email-marketing' ),336 'raw' => '<strong>' . __( 'Colors', 'siteground-email-marketing' ) . '</strong>', 337 337 'separator' => 'after', 338 338 ] … … 383 383 384 384 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'. 386 386 } 387 387 } -
siteground-email-marketing/trunk/core/Integrations/ThirdParty/CF7.php
r3194285 r3388694 147 147 } 148 148 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 155 155 } else { 156 156 delete_post_meta( $post_id, self::CF7_SELECTED_LABELS_META ); 157 157 } 158 158 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 161 161 } else { 162 162 delete_post_meta( $post_id, self::CF7_CHECKBOX_LABEL_META ); … … 170 170 */ 171 171 public function get_data() { 172 return array_merge( (array) $_GET, (array) $_POST ); 172 return array_merge( (array) $_GET, (array) $_POST ); // phpcs:ignore 173 173 } 174 174 … … 317 317 */ 318 318 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' ); 322 322 323 323 wp_enqueue_script( … … 347 347 */ 348 348 public function get_label_ids( $label_names ) { 349 349 350 $labels_list = Loader::get_instance()->mailer_api->get_labels(); 350 351 -
siteground-email-marketing/trunk/core/Integrations/ThirdParty/GravityForms/GravityForms.php
r3194285 r3388694 259 259 field.inputs = null; 260 260 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' ) ); ?>; 262 262 if( !field.sgwpmailConsentToggle) 263 263 field.sgwpmailConsentToggle = true; 264 264 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' ); ?>'; 266 266 jQuery( '.sg_email_marketing_field_preview_label').text(field.sgwpmailConsentText); 267 267 break; -
siteground-email-marketing/trunk/core/Integrations/ThirdParty/NinjaForms/SGWPMAIL_Action.php
r3075649 r3388694 102 102 */ 103 103 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 105 105 106 106 $form = \Ninja_Forms()->form( $form_id )->get(); -
siteground-email-marketing/trunk/core/Integrations/ThirdParty/WPForms/SGWPMAIL_WPForms_Field.php
r3091421 r3388694 204 204 public function field_preview( $field ) { 205 205 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' ) . 207 207 '</h4>'; 208 208 209 209 $checkbox_text = isset( $field['sg_email_marketing_checkbox_text'] ) ? $field['sg_email_marketing_checkbox_text'] : ''; 210 210 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 ) ); 213 212 } 214 213 … … 229 228 $field_id = $field['properties']['inputs']['primary']['id']; 230 229 $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'] ) ); 233 231 } 234 232 -
siteground-email-marketing/trunk/core/Integrations/ThirdParty/WPForms/WPForms.php
r3194285 r3388694 78 78 */ 79 79 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' ); 83 83 84 84 wp_enqueue_script( … … 105 105 */ 106 106 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 109 109 } 110 110 } -
siteground-email-marketing/trunk/core/Pages/Page.php
r3011980 r3388694 52 52 // Hide all error in our page. 53 53 if ( 54 isset( $_GET['page'] ) && 54 isset( $_GET['page'] ) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 55 55 ( $this->page_id === $_GET['page'] ) // phpcs:ignore 56 56 ) { -
siteground-email-marketing/trunk/core/Renderer/Renderer.php
r3336425 r3388694 153 153 */ 154 154 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 156 162 $fields = json_decode( $form->post_content ); 157 163 $attr['hash'] = bin2hex( random_bytes( 18 ) ); … … 159 165 $orientation = isset( $attr['formOrientation'] ) ? 'sg-marketing-form-container-' . $attr['formOrientation'] : 'sg-marketing-form-container-column'; 160 166 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'] . '">'; 162 168 $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 ) . '">'; 166 172 167 173 // Check if $fields->title is set and is an array. … … 205 211 $html .= '<div class="sg-input-container">'; 206 212 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 ); 208 214 $html .= ( $required ? ' <span class="sg-marketing-form-required-label" aria-hidden="true">*</span>' : '' ); 209 215 $html .= '</label>'; … … 229 235 230 236 $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 ); 233 239 234 240 if ( ! empty( $fields->consent->consent_checkbox ) ) { -
siteground-email-marketing/trunk/core/Rest/Controllers/v1/Pages/Forms.php
r3329603 r3388694 23 23 24 24 /** 25 * The Database placeholder. 26 */ 27 public $wpdb; 28 29 /** 25 30 * The Constructor. 26 31 * … … 31 36 $this->namespace = $this->rest_namespace; 32 37 $this->rest_base = 'forms'; 38 39 global $wpdb; 40 $this->wpdb = $wpdb; 33 41 } 34 42 … … 85 93 */ 86 94 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 ), 94 101 ARRAY_A 95 102 ); -
siteground-email-marketing/trunk/core/Services/Cron/Cron.php
r3091421 r3388694 34 34 35 35 /** 36 * The Database placeholder. 37 */ 38 public $wpdb; 39 40 /** 36 41 * The constructor. 37 42 * … … 42 47 public function __construct( $background_process ) { 43 48 $this->background_process = $background_process; 49 50 global $wpdb; 51 $this->wpdb = $wpdb; 44 52 } 45 53 … … 85 93 */ 86 94 private function get_data() { 87 global $wpdb;88 95 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 ) 103 115 ); 116 104 117 foreach( $results as $index => $result ) { 105 118 if ( is_array( $result->meta_value ) ) { … … 128 141 global $wpdb; 129 142 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 ); 133 163 } 134 164 } -
siteground-email-marketing/trunk/core/Services/Mailer_Api/Mailer_Api.php
r3329603 r3388694 26 26 27 27 /** 28 * Call the mailer api.28 * Call the mailer API. 29 29 * 30 30 * @since 1.0.0 … … 36 36 * @throws \Exception An exception if something went wrong. 37 37 * 38 * @return array The response from the mailer api.38 * @return array The response from the mailer API. 39 39 */ 40 40 private function call( $route, $data = array(), $method = 'GET' ) { 41 41 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 ); 43 43 } 44 44 45 45 // 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'] ); 48 48 49 49 $headers = array( … … 213 213 214 214 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 ); 216 216 } 217 217 } … … 239 239 240 240 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 ); 242 242 } 243 243 -
siteground-email-marketing/trunk/sg-email-marketing.php
r3336425 r3388694 11 11 * Plugin URI: https://siteground.com 12 12 * 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. 113 * Version: 1.7.2 14 14 * Author: SiteGround 15 15 * Author URI: https://www.siteground.com … … 33 33 // Define version constant. 34 34 if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) { 35 define( __NAMESPACE__ . '\VERSION', '1.7. 1' );35 define( __NAMESPACE__ . '\VERSION', '1.7.2' ); 36 36 } 37 37 -
siteground-email-marketing/trunk/templates/CF7_Checkbox_Markup.php
r3075649 r3388694 3 3 <input type="checkbox" name="<?php echo esc_attr( $this->checkbox_name ); ?>" value="1" /> 4 4 <label for="<?php echo esc_attr( $this->checkbox_name ); ?>"> 5 <?php echo $label; ?>5 <?php echo esc_html( $label ); ?> 6 6 </label> 7 7 </span> -
siteground-email-marketing/trunk/templates/CF7_Integration_Tab_Template.php
r3075649 r3388694 1 1 <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> 3 3 <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"/> 6 6 <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' ); ?> 8 8 </label> 9 9 </span> 10 10 <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"/> 13 13 <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' ); ?> 15 15 </label> 16 16 </span> 17 17 <span class="sgwpmail-cf7-checkbox-label-input"> 18 18 <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' ); ?> 20 20 </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 ); ?>"/> 22 22 </span> 23 23 <span class=sgwpmail-cf7-labels-dropdown> 24 24 <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' ); ?> 26 26 </label> 27 27 <select multiple id="sgwpmail-cf7-labels" name="sgwpmail-cf7-labels[]"> … … 29 29 foreach ( $labels_list['data'] as $label ) { 30 30 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>'; 32 32 continue; 33 33 } 34 echo '<option value="' . $label['name'] . '">' . $label['name']. '</option>';34 echo '<option value="' . esc_attr( $label['name'] ) . '">' . esc_html( $label['name'] ) . '</option>'; 35 35 } 36 36 ?> 37 37 </select> 38 38 <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' ); ?> 40 40 </span> 41 41 </span> -
siteground-email-marketing/trunk/templates/GF_Integration_Field_Settings.php
r3076798 r3388694 15 15 <span class=sgwpmail-groups-dropdown> 16 16 <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' ); ?> 18 18 <?php \gform_tooltip( 'sgwpmail_groups' ); ?> 19 19 </label> … … 22 22 foreach ( $labels_list as $label ) { 23 23 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>'; 25 25 continue; 26 26 } 27 echo '<option value="' . $label . '">' . $label. '</option>';27 echo '<option value="' . esc_attr( $label ) . '">' . esc_html( $label ) . '</option>'; 28 28 } 29 29 ?> … … 32 32 </li> 33 33 <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> 35 35 <input type="checkbox" id="field_sgwpmail_consent_toggle" onclick="sgwpmail_change_consent_checkbox(this);" /> 36 36 <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" ); ?> 38 38 <?php \gform_tooltip( 'sgwpmail_manage_consent' ); ?> 39 39 </label> … … 46 46 <li class="sgwpmail_consent_text field_setting"> 47 47 <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" ); ?> 49 49 <?php \gform_tooltip( 'sgwpmail_consent_label' ); ?> 50 50 </label>
Note: See TracChangeset
for help on using the changeset viewer.