| @@ -23,33 +23,34 @@ | ||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function onAcymGetSendingMethodsHtmlSetting(&$data) |
| 26 | 26 | { |
| 27 | - ob_start(); | |
| 28 | 27 | ?> |
| 29 | - <div class="send_settings grid-x cell large-6 xlarge-5 xxlarge-4 margin-auto" id="<?php echo self::SENDING_METHOD_ID; ?>_settings"> | |
| 28 | + <div class="send_settings grid-x cell large-6 xlarge-5 xxlarge-4 margin-auto" id="<?php echo esc_attr(self::SENDING_METHOD_ID); ?>_settings"> | |
| 30 | 29 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 31 | - <label for="smtp_host" class="cell"><?php echo acym_translation('ACYM_SMTP_SERVER'); ?></label> | |
| 32 | - <input id="smtp_host" class="cell" type="text" name="config[smtp_host]" value="<?php echo acym_escape($this->config->get('smtp_host')); ?>"> | |
| 30 | + <label for="smtp_host" class="cell"><?php echo esc_html(acym_translation('ACYM_SMTP_SERVER')); ?></label> | |
| 31 | + <input id="smtp_host" class="cell" type="text" name="config[smtp_host]" value="<?php echo esc_attr($this->config->get('smtp_host')); ?>"> | |
| 33 | 32 | </div> |
| 34 | 33 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 35 | - <label for="smtp_port" class="cell"><?php echo acym_translation('ACYM_SMTP_PORT').acym_info('ACYM_SMTP_PORT_DESC'); ?></label> | |
| 34 | + <label for="smtp_port" class="cell"><?php echo esc_html(acym_translation('ACYM_SMTP_PORT')); | |
| 35 | + acym_info(['textShownInTooltip' => 'ACYM_SMTP_PORT_DESC']); ?></label> | |
| 36 | 36 | <input |
| 37 | 37 | id="smtp_port" |
| 38 | 38 | class="cell medium-6" |
| 39 | 39 | type="number" |
| 40 | - name="config[smtp_port]" value="<?php echo acym_escape($this->config->get('smtp_port')); ?>" | |
| 40 | + name="config[smtp_port]" value="<?php echo esc_attr($this->config->get('smtp_port')); ?>" | |
| 41 | 41 | placeholder="465, 587, 2525, 25"> |
| 42 | 42 | </div> |
| 43 | 43 | <div id="available_ports" class="cell acym__sending__methods__one__settings"> |
| 44 | - <a href="#" id="available_ports_check"><?php echo acym_translation('ACYM_SMTP_AVAILABLE_PORTS'); ?></a> | |
| 45 | - <?php echo $this->getCopySettingsButton($data, self::SENDING_METHOD_ID, 'wp_mail_smtp'); ?> | |
| 44 | + <?php echo esc_html(acym_translation('ACYM_SMTP_AVAILABLE_PORTS')); ?> | |
| 45 | + <?php $this->getCopySettingsButton($data, self::SENDING_METHOD_ID, 'wp_mail_smtp'); ?> | |
| 46 | 46 | </div> |
| 47 | 47 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 48 | - <label for="smtp_secured" class="cell"><?php echo acym_translation('ACYM_SMTP_SECURE').acym_info('ACYM_SMTP_SECURE_DESC'); ?></label> | |
| 48 | + <label for="smtp_secured" class="cell"><?php echo esc_html(acym_translation('ACYM_SMTP_SECURE')); | |
| 49 | + acym_info(['textShownInTooltip' => 'ACYM_SMTP_SECURE_DESC']); ?></label> | |
| 49 | 50 | <div class="cell medium-6"> |
| 50 | 51 | <?php |
| 51 | - echo acym_select( | |
| 52 | + acym_select( | |
| 52 | 53 | [ |
| 53 | 54 | '' => '- - -', |
| 54 | 55 | 'ssl' => 'SSL', |
| 55 | 56 | 'tls' => 'TLS', |
| @@ -61,9 +62,11 @@ | ||
| 61 | 62 | 'acym-data-infinite' => '', |
| 62 | 63 | ], |
| 63 | 64 | '', |
| 64 | 65 | '', |
| 65 | - 'smtp_secured' | |
| 66 | + 'smtp_secured', | |
| 67 | + false, | |
| 68 | + true | |
| 66 | 69 | ); |
| 67 | 70 | ?> |
| 68 | 71 | </div> |
| 69 | 72 | </div> |
| @@ -68,33 +71,36 @@ | ||
| 68 | 71 | </div> |
| 69 | 72 | </div> |
| 70 | 73 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 71 | 74 | <?php |
| 72 | - echo acym_switch( | |
| 73 | - 'config[smtp_keepalive]', | |
| 74 | - $this->config->get('smtp_keepalive'), | |
| 75 | - acym_translation('ACYM_SMTP_ALIVE').acym_info('ACYM_SMTP_ALIVE_DESC'), | |
| 76 | - [], | |
| 77 | - 'medium-5 small-9' | |
| 78 | - ); | |
| 75 | + acym_switch([ | |
| 76 | + 'name' => 'config[smtp_keepalive]', | |
| 77 | + 'value' => $this->config->get('smtp_keepalive'), | |
| 78 | + 'label' => acym_translation('ACYM_SMTP_ALIVE'), | |
| 79 | + 'tip' => ['textShownInTooltip' => 'ACYM_SMTP_ALIVE_DESC'], | |
| 80 | + 'labelClass' => 'medium-5 small-9', | |
| 81 | + ]); | |
| 79 | 82 | ?> |
| 80 | 83 | </div> |
| 81 | 84 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 82 | 85 | <?php |
| 83 | - echo acym_switch( | |
| 84 | - 'config[smtp_auth]', | |
| 85 | - $this->config->get('smtp_auth', 1), | |
| 86 | - acym_translation('ACYM_SMTP_AUTHENTICATION').acym_info('ACYM_SMTP_AUTHENTICATION_DESC'), | |
| 87 | - [], | |
| 88 | - 'medium-5 small-9' | |
| 89 | - ); | |
| 86 | + acym_switch([ | |
| 87 | + 'name' => 'config[smtp_auth]', | |
| 88 | + 'value' => $this->config->get('smtp_auth', 1), | |
| 89 | + 'label' => acym_translation('ACYM_SMTP_AUTHENTICATION'), | |
| 90 | + 'tip' => ['textShownInTooltip' => 'ACYM_SMTP_AUTHENTICATION_DESC'], | |
| 91 | + 'labelClass' => 'medium-5 small-9', | |
| 92 | + ]); | |
| 90 | 93 | ?> |
| 91 | 94 | </div> |
| 92 | 95 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 93 | - <label for="smtp_method" class="cell"><?php echo acym_translation('ACYM_AUTHENTICATION_METHOD').acym_info('ACYM_AUTHENTICATION_METHOD_DESC'); ?></label> | |
| 96 | + <label for="smtp_method" class="cell"> | |
| 97 | + <?php echo esc_html(acym_translation('ACYM_AUTHENTICATION_METHOD')); | |
| 98 | + acym_info(['textShownInTooltip' => 'ACYM_AUTHENTICATION_METHOD_DESC']); ?> | |
| 99 | + </label> | |
| 94 | 100 | <div class="cell medium-6"> |
| 95 | 101 | <?php |
| 96 | - echo acym_select( | |
| 102 | + acym_select( | |
| 97 | 103 | [ |
| 98 | 104 | '' => acym_translation('ACYM_AUTOMATIC'), |
| 99 | 105 | 'CRAM-MD5' => 'CRAM-MD5', |
| 100 | 106 | 'LOGIN' => 'LOGIN', |
| @@ -107,34 +113,39 @@ | ||
| 107 | 113 | 'acym-data-infinite' => '', |
| 108 | 114 | ], |
| 109 | 115 | '', |
| 110 | 116 | '', |
| 111 | - 'smtp_method' | |
| 117 | + 'smtp_method', | |
| 118 | + false, | |
| 119 | + true | |
| 112 | 120 | ); |
| 113 | 121 | ?> |
| 114 | 122 | </div> |
| 115 | 123 | </div> |
| 116 | 124 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 117 | - <label for="smtp_username" class="cell"><?php echo acym_translation('ACYM_SMTP_USERNAME').acym_info('ACYM_SMTP_USERNAME_DESC'); ?></label> | |
| 125 | + <label for="smtp_username" class="cell"><?php echo esc_html(acym_translation('ACYM_SMTP_USERNAME')); | |
| 126 | + acym_info(['textShownInTooltip' => 'ACYM_SMTP_USERNAME_DESC']); ?></label> | |
| 118 | 127 | <input id="smtp_username" |
| 119 | - class="cell" | |
| 120 | - type="text" | |
| 121 | - name="config[smtp_username]" | |
| 122 | - value="<?php echo acym_escape($this->config->get('smtp_username')); ?>"> | |
| 128 | + class="cell" | |
| 129 | + type="text" | |
| 130 | + name="config[smtp_username]" | |
| 131 | + value="<?php echo esc_attr($this->config->get('smtp_username')); ?>"> | |
| 123 | 132 | </div> |
| 124 | 133 | <div class="acym__default_auth_sending_params cell"> |
| 125 | 134 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings" id="oauthParams"> |
| 126 | - <label for="smtp_password" class="cell"><?php echo acym_translation('ACYM_SMTP_PASSWORD').acym_info('ACYM_SMTP_PASSWORD_DESC'); ?></label> | |
| 135 | + <label for="smtp_password" class="cell"> | |
| 136 | + <?php echo esc_html(acym_translation('ACYM_SMTP_PASSWORD')); | |
| 137 | + acym_info(['textShownInTooltip' => 'ACYM_SMTP_PASSWORD_DESC']); ?> | |
| 138 | + </label> | |
| 127 | 139 | <input id="smtp_password" |
| 128 | - class="cell" | |
| 129 | - type="text" | |
| 130 | - name="config[smtp_password]" | |
| 131 | - value="<?php echo str_repeat('*', strlen($this->config->get('smtp_password'))); ?>"> | |
| 140 | + class="cell" | |
| 141 | + type="text" | |
| 142 | + name="config[smtp_password]" | |
| 143 | + value="<?php echo esc_attr(str_repeat('*', strlen($this->config->get('smtp_password')))); ?>"> | |
| 132 | 144 | </div> |
| 133 | 145 | </div> |
| 134 | 146 | </div> |
| 135 | 147 | <?php |
| 136 | - $data['sendingMethodsHtmlSettings'][self::SENDING_METHOD_ID] = ob_get_clean(); | |
| 137 | 148 | } |
| 138 | 149 | |
| 139 | 150 | public function onAcymGetSettingsSendingMethodFromPlugin(&$data, $plugin, $method) |
| 140 | 151 | { |