PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / trunk
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress vtrunk
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
acymailing / back / Helpers / Update / Patchv11.php

Patchv11.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress trunk, at back/Helpers/Update/Patchv11.php

67 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AcyMailing\Helpers\Update;
4
5 use AcyMailing\Classes\ConfigurationClass;
6
7 trait Patchv11
8 {
9 private function updateFor1102(): void
10 {
11 if ($this->isPreviousVersionAtLeast('11.0.2')) {
12 return;
13 }
14
15 $this->updateQuery('UPDATE #__acym_user_has_list SET `status` = 0 WHERE `status` = -1');
16 }
17
18 private function updateFor1105(): void
19 {
20 if ($this->isPreviousVersionAtLeast('11.0.5')) {
21 return;
22 }
23
24 $this->updateQuery(
25 'CREATE TABLE IF NOT EXISTS `#__acym_mail_stat_detail` (
26 `mail_id` INT NOT NULL,
27 `detail_type` VARCHAR(20) NOT NULL,
28 `detail_key` VARCHAR(100) NOT NULL,
29 `number` INT NOT NULL DEFAULT 0,
30 PRIMARY KEY (`mail_id`, `detail_type`, `detail_key`)
31 )'
32 );
33 }
34
35 private function updateFor1110(): void
36 {
37 if ($this->isPreviousVersionAtLeast('11.1.0')) {
38 return;
39 }
40
41 $this->updateQuery(
42 'UPDATE #__acym_configuration
43 SET `value` = 0
44 WHERE `name` = "favorite_template"
45 AND `value` != 0
46 AND `value` NOT IN (SELECT `id` FROM #__acym_mail)'
47 );
48 }
49
50 private function updateFor1111(ConfigurationClass $config): void
51 {
52 if ($this->isPreviousVersionAtLeast('11.1.1')) {
53 return;
54 }
55
56 $sendMethod = $config->get('mailer_method');
57 if ($sendMethod === 'acymailer') {
58 $config->saveConfig(
59 [
60 'embed_images' => 0,
61 'embed_files' => 0,
62 ]
63 );
64 }
65 }
66 }
67