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/Plugins/Available.php +10 -2 10.1.4 → 11.1.0 View file →
@@ -16,8 +16,10 @@
16 16 $data['types'] = $this->types;
17 17 $data['level'] = $this->level;
18 18 $data['workflowHelper'] = new WorkflowHelper();
19 19
20 + acym_addScript(true, 'window.acymailingAvailableAddons = '.json_encode(ACYM_AVAILABLE_PLUGINS).';');
21 +
20 22 parent::display($data);
21 23 }
22 24
23 25 public function download(bool $ajax = true, string $pluginFromUpdate = ''): string
@@ -24,8 +26,9 @@
24 26 {
25 27 $plugin = [];
26 28
27 29 if (empty($pluginFromUpdate)) {
30 + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token');
28 31 $this->isLatestAcyMailingVersion();
29 32 $plugin = acym_getVar('array', 'plugin');
30 33 } else {
31 34 $plugins = acym_fileGetContent(ACYM_UPDATEME_API_URL.'public/addons');
@@ -46,10 +49,14 @@
46 49 }
47 50 }
48 51
49 52 $pluginClass = new PluginClass();
50 - $pluginClass->downloadAddon($plugin['file_name'], $ajax);
53 + $errorMessage = $pluginClass->downloadAddon($plugin['file_name'], $ajax);
54 + if (!empty($errorMessage)) {
55 + return $errorMessage;
56 + }
51 57
58 + // We update the plugin info in DB
52 59 $pluginToSave = new \stdClass();
53 60 $pluginToSave->title = $plugin['name'];
54 61 $pluginToSave->folder_name = $plugin['file_name'];
55 62 $pluginToSave->version = $plugin['version'];
@@ -73,12 +80,13 @@
73 80 }
74 81
75 82 public function getAllPluginsAjax(): void
76 83 {
84 + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token');
77 85 acym_sendAjaxResponse('', $this->getAllPlugins());
78 86 }
79 87
80 - public function getAllPlugins(): array
88 + private function getAllPlugins(): array
81 89 {
82 90 $pluginClass = new PluginClass();
83 91 $plugins = $pluginClass->getMatchingElements(['ordering' => 'title']);
84 92