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/Controllers/Scenarios/Performance.php +16 -17 10.0.1 → 11.1.0 View file →
@@ -13,9 +13,9 @@
13 13 use AcyMailing\Helpers\WorkflowHelper;
14 14
15 15 trait Performance
16 16 {
17 - public function performances()
17 + public function performances(): void
18 18 {
19 19 acym_setVar('layout', 'performances');
20 20 acym_setVar('step', 'performances');
21 21
@@ -39,9 +39,9 @@
39 39
40 40 parent::display($data);
41 41 }
42 42
43 - private function prepareScenarioPerformance(&$data)
43 + private function prepareScenarioPerformance(array &$data): void
44 44 {
45 45 if (empty($data['scenarioId'])) {
46 46 return;
47 47 }
@@ -49,9 +49,9 @@
49 49 $scenarioClass = new ScenarioClass();
50 50 $data['scenario'] = $scenarioClass->getOneById($data['scenarioId']);
51 51 }
52 52
53 - private function prepareStepsPerformance(&$data)
53 + private function prepareStepsPerformance(array &$data): void
54 54 {
55 55 $scenarioStepClass = new ScenarioStepClass();
56 56 $scenarioProcessClass = new ScenarioProcessClass();
57 57
@@ -84,9 +84,9 @@
84 84 $scenarioHelper = new ScenarioHelper();
85 85
86 86 foreach ($steps as $step) {
87 87 switch ($step->type) {
88 - case ScenarioClass::TYPE_CONDITION:
88 + case ScenarioClass::TYPE_CONDITION:
89 89 $name = ucfirst($conditionNames[$scenarioHelper->getConditionValue($step)]);
90 90 break;
91 91 case ScenarioClass::TYPE_ACTION:
92 92 $name = ucfirst($actionsNames[$scenarioHelper->getActionValue($step)]);
@@ -134,15 +134,14 @@
134 134 acym_trigger('onAcymDeclareTriggers', [&$triggers, &$defaultValues]);
135 135
136 136 $triggerNames = [];
137 137 foreach ($triggers['user'] as $key => $trigger) {
138 - $triggerNames[$key] = strtolower(strip_tags($trigger->name));
138 + $triggerNames[$key] = strtolower(acym_stripTags($trigger->name));
139 139 }
140 140
141 141 return $triggerNames;
142 142 }
143 143
144 -
145 144 private function getConditionNames(): array
146 145 {
147 146 $conditions = ['user' => [], 'classic' => []];
148 147 acym_trigger('onAcymDeclareConditions', [&$conditions]);
@@ -148,9 +147,9 @@
148 147 acym_trigger('onAcymDeclareConditions', [&$conditions]);
149 148
150 149 $conditionNames = [];
151 150 foreach ($conditions['user'] as $key => $condition) {
152 - $conditionNames[$key] = strtolower(strip_tags($condition->name));
151 + $conditionNames[$key] = strtolower(acym_stripTags($condition->name));
153 152 }
154 153
155 154 return $conditionNames;
156 155 }
@@ -161,9 +160,9 @@
161 160 acym_trigger('onAcymDeclareActionsScenario', [&$actions]);
162 161
163 162 $actionNames = [];
164 163 foreach ($actions as $key => $action) {
165 - $actionNames[$key] = strtolower(strip_tags($action->name));
164 + $actionNames[$key] = strtolower(acym_stripTags($action->name));
166 165 }
167 166
168 167 return $actionNames;
169 168 }
@@ -182,9 +181,9 @@
182 181 $stepId = acym_getVar('string', 'stepId', '');
183 182 $type = acym_getVar('string', 'type', '');
184 183
185 184 if (empty($scenarioId) || empty($type) || ($type !== 'trigger' && empty($stepId))) {
186 - acym_sendAjaxResponse(acym_translation('ACYM_ERROR_OCCURRED'), [], false);
185 + acym_sendAjaxResponse(acym_translation('ACYM_AN_ERROR_OCCURRED'), [], false);
187 186 }
188 187
189 188 $scenarioClass = new ScenarioClass();
190 189 $scenario = $scenarioClass->getOneById($scenarioId);
@@ -189,9 +188,9 @@
189 188 $scenarioClass = new ScenarioClass();
190 189 $scenario = $scenarioClass->getOneById($scenarioId);
191 190
192 191 if (empty($scenario)) {
193 - acym_sendAjaxResponse(acym_translation('ACYM_ERROR_OCCURRED'), [], false);
192 + acym_sendAjaxResponse(acym_translation('ACYM_AN_ERROR_OCCURRED'), [], false);
194 193 }
195 194
196 195 switch ($type) {
197 196 case 'trigger':
@@ -206,9 +205,9 @@
206 205 $html = [];
207 206 }
208 207
209 208 if (empty($html)) {
210 - acym_sendAjaxResponse(acym_translation('ACYM_ERROR_OCCURRED'), [], false);
209 + acym_sendAjaxResponse(acym_translation('ACYM_AN_ERROR_OCCURRED'), [], false);
211 210 }
212 211
213 212 acym_sendAjaxResponse('', ['content' => $html]);
214 213 }
@@ -230,9 +229,9 @@
230 229 ];
231 230
232 231 $matchingElements = $scenarioProcessClass->getMatchingElements($listingSettings);
233 232
234 - $pagination->setStatus($matchingElements['total'], $page, $listingSettings['elementsPerPage']);
233 + $pagination->setStatus((int)$matchingElements['total']->total, $page, $listingSettings['elementsPerPage']);
235 234
236 235 $data = [
237 236 'numberOfTrigger' => $scenarioProcessClass->getNumberOfTriggerByScenarioId($scenarioId),
238 237 'usersProcess' => $matchingElements['elements'],
@@ -264,9 +263,9 @@
264 263
265 264 $scenarioHistoryLineClass = new ScenarioHistoryLineClass();
266 265 $matchingElements = $scenarioHistoryLineClass->getMatchingElements($listingSettings);
267 266
268 - $pagination->setStatus($matchingElements['total'], $page, $listingSettings['elementsPerPage']);
267 + $pagination->setStatus((int)$matchingElements['total']->total, $page, $listingSettings['elementsPerPage']);
269 268
270 269 $data = [
271 270 'historyLines' => $matchingElements['elements'],
272 271 'pagination' => $pagination,
@@ -281,15 +280,15 @@
281 280
282 281 return ob_get_clean();
283 282 }
284 283
285 - public function getUserInfo()
284 + public function getUserInfo(): void
286 285 {
287 286 $userId = acym_getVar('int', 'userId', 0);
288 287 $processId = acym_getVar('int', 'processId', 0);
289 288
290 289 if (empty($userId) || empty($processId)) {
291 - acym_sendAjaxResponse(acym_translation('ACYM_ERROR_OCCURRED'), [], false);
290 + acym_sendAjaxResponse(acym_translation('ACYM_AN_ERROR_OCCURRED'), [], false);
292 291 }
293 292
294 293 $userClass = new UserClass();
295 294 $user = $userClass->getOneById($userId);
@@ -294,9 +293,9 @@
294 293 $userClass = new UserClass();
295 294 $user = $userClass->getOneById($userId);
296 295
297 296 if (empty($user)) {
298 - acym_sendAjaxResponse(acym_translation('ACYM_ERROR_OCCURRED'), [], false);
297 + acym_sendAjaxResponse(acym_translation('ACYM_AN_ERROR_OCCURRED'), [], false);
299 298 }
300 299
301 300 $scenarioProcessClass = new ScenarioProcessClass();
302 301 $process = $scenarioProcessClass->getOneById($processId);
@@ -301,9 +300,9 @@
301 300 $scenarioProcessClass = new ScenarioProcessClass();
302 301 $process = $scenarioProcessClass->getOneById($processId);
303 302
304 303 if (empty($process)) {
305 - acym_sendAjaxResponse(acym_translation('ACYM_ERROR_OCCURRED'), [], false);
304 + acym_sendAjaxResponse(acym_translation('ACYM_AN_ERROR_OCCURRED'), [], false);
306 305 }
307 306
308 307 $scenarioHistoryLineClass = new ScenarioHistoryLineClass();
309 308 $scenarioHistoryLines = $scenarioHistoryLineClass->getAllByProcessId($processId);