PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/dynamics/sendinblue/credentials.php +51 -25 10.2.2 → 11.1.0 View file →
@@ -3,8 +3,15 @@
3 3 use AcyMailing\Types\DelayType;
4 4
5 5 class SendinblueCredentials extends SendinblueClass
6 6 {
7 + /**
8 + * @param array $credentials
9 + * @param string $sendingMethod
10 + * @param array $sendingMethodListParams this parameter is only used for the plugin sending method list
11 + *
12 + * @return void
13 + */
7 14 public function onAcymGetCredentialsSendingMethod(array &$credentials, string $sendingMethod, array $sendingMethodListParams = [])
8 15 {
9 16 if ($sendingMethod != plgAcymSendinblue::SENDING_METHOD_ID) return;
10 17
@@ -51,30 +58,36 @@
51 58 acym_removeDashboardNotification('sendinblue_validation');
52 59 }
53 60
54 61 $delayType = new DelayType();
62 + ob_start();
63 + $delayType->display(
64 + 'config['.plgAcymSendinblue::SENDING_METHOD_ID.'_clean_frequency]',
65 + $this->config->get(plgAcymSendinblue::SENDING_METHOD_ID.'_clean_frequency', 604800),
66 + DelayType::TYPE_WEEKS_MONTHS
67 + );
68 + $delay = ob_get_clean();
55 69 $config = empty($data['tab']) ? $this->config : $data['tab']->config;
56 70 $defaultApiKey = $config->get(plgAcymSendinblue::SENDING_METHOD_ID.'_api_key');
57 - ob_start();
58 71 ?>
59 - <div class="send_settings cell grid-x acym_vcenter" id="<?php echo plgAcymSendinblue::SENDING_METHOD_ID; ?>_settings">
72 + <div class="send_settings cell grid-x acym_vcenter" id="<?php echo esc_attr(plgAcymSendinblue::SENDING_METHOD_ID); ?>_settings">
60 73 <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings">
61 - <label class="cell shrink margin-right-1" for="<?php echo plgAcymSendinblue::SENDING_METHOD_ID; ?>_settings_api-key">
62 - <?php echo acym_translationSprintf('ACYM_SENDING_METHOD_API_KEY', plgAcymSendinblue::SENDING_METHOD_NAME); ?>
74 + <label class="cell shrink margin-right-1" for="<?php echo esc_attr(plgAcymSendinblue::SENDING_METHOD_ID); ?>_settings_api-key">
75 + <?php echo esc_html(acym_translationSprintf('ACYM_SENDING_METHOD_API_KEY', plgAcymSendinblue::SENDING_METHOD_NAME)); ?>
63 76 </label>
64 - <?php echo $this->getLinks('https://get.brevo.com/hbvmwg6onvve'); ?>
77 + <?php $this->getLinks('https://get.brevo.com/hbvmwg6onvve'); ?>
65 78 <input type="text"
66 - id="<?php echo plgAcymSendinblue::SENDING_METHOD_ID; ?>_settings_api-key"
67 - value="<?php echo empty($defaultApiKey) ? $this->config->get(plgAcymSendinblue::SENDING_METHOD_ID.'_api_key') : $defaultApiKey; ?>"
68 - name="config[<?php echo plgAcymSendinblue::SENDING_METHOD_ID; ?>_api_key]"
69 - class="cell margin-right-1 acym__configuration__mail__settings__text">
70 - <?php echo $this->getTestCredentialsSendingMethodButton(plgAcymSendinblue::SENDING_METHOD_ID); ?>
71 - <?php echo $this->getCopySettingsButton($data, plgAcymSendinblue::SENDING_METHOD_ID, 'wp_mail_smtp'); ?>
79 + id="<?php echo esc_attr(plgAcymSendinblue::SENDING_METHOD_ID); ?>_settings_api-key"
80 + value="<?php echo esc_attr(empty($defaultApiKey) ? $this->config->get(plgAcymSendinblue::SENDING_METHOD_ID.'_api_key') : $defaultApiKey); ?>"
81 + name="config[<?php echo esc_attr(plgAcymSendinblue::SENDING_METHOD_ID); ?>_api_key]"
82 + class="cell margin-next-1 acym__configuration__mail__settings__text">
83 + <?php $this->getTestCredentialsSendingMethodButton(plgAcymSendinblue::SENDING_METHOD_ID); ?>
84 + <?php $this->getCopySettingsButton($data, plgAcymSendinblue::SENDING_METHOD_ID, 'wp_mail_smtp'); ?>
72 85 <div class="cell grid-x margin-top-1 acym__sending__methods__synch">
73 86 <button type="button"
74 - sending-method-id="<?php echo plgAcymSendinblue::SENDING_METHOD_ID; ?>"
75 - class="acym__configuration__sending__synch__users cell shrink button button-secondary">
76 - <?php echo acym_translation('ACYM_SYNCHRO_EXISTING_USERS'); ?>
87 + sending-method-id="<?php echo esc_attr(plgAcymSendinblue::SENDING_METHOD_ID); ?>"
88 + class="acym__configuration__sending__synch__users cell shrink button button-secondary">
89 + <?php echo esc_html(acym_translation('ACYM_SYNCHRO_EXISTING_USERS')); ?>
77 90 </button>
78 91 <span class="acym__configuration__sending__method-icon cell shrink margin-left-1 acym_vcenter"></span>
79 92 <span class="acym__configuration__sending__method-synch__message cell shrink margin-left-1 acym_vcenter"></span>
80 93 </div>
@@ -80,13 +93,13 @@
80 93 </div>
81 94 <?php if (!$this->plugin->isLogFileEmpty()) { ?>
82 95 <div class="cell grid-x margin-top-1 acym__sending__methods__log">
83 96 <?php
84 - echo acym_modal(
97 + acym_modal(
85 98 acym_translation('ACYM_REPORT_SEE'),
86 99 '',
87 100 null,
88 - '',
101 + [],
89 102 [
90 103 'class' => 'button',
91 104 'data-ajax' => 'true',
92 105 'data-iframe' => '&ctrl=configuration&task=seeLogs&filename='.$this->plugin->logFilename,
@@ -95,22 +108,35 @@
95 108 ?>
96 109 </div>
97 110 <?php } ?>
98 111 <div class="cell grid-x margin-top-1 acym_vcenter acym__sending__methods__clean__data">
99 - <?php echo acym_translationSprintf(
100 - 'ACYM_CLEAN_DATA_ON_X_X',
101 - plgAcymSendinblue::SENDING_METHOD_NAME,
102 - $delayType->display(
103 - 'config['.plgAcymSendinblue::SENDING_METHOD_ID.'_clean_frequency]',
104 - $this->config->get(plgAcymSendinblue::SENDING_METHOD_ID.'_clean_frequency', 604800), // one week
105 - 4
106 - )
112 + <?php echo wp_kses(
113 + acym_translationSprintf('ACYM_CLEAN_DATA_ON_X_X', plgAcymSendinblue::SENDING_METHOD_NAME, $delay),
114 + [
115 + 'input' => [
116 + 'class' => true,
117 + 'type' => true,
118 + 'id' => true,
119 + 'value' => true,
120 + 'onchange' => true,
121 + 'min' => true,
122 + ],
123 + 'select' => [
124 + 'name' => true,
125 + 'id' => true,
126 + 'class' => true,
127 + 'onchange' => true,
128 + ],
129 + 'option' => [
130 + 'value' => true,
131 + 'selected' => true,
132 + ],
133 + ]
107 134 ); ?>
108 135 </div>
109 136 </div>
110 137 </div>
111 138 <?php
112 - $data['sendingMethodsHtmlSettings'][plgAcymSendinblue::SENDING_METHOD_ID] = ob_get_clean();
113 139 }
114 140
115 141 public function testCredentialSendingMethod($sendingMethod, $credentials)
116 142 {