PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.1
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/Configuration/Queue.php +0 -79 10.11.1 → 11.1.1 View file →
@@ -1,79 +1,0 @@
1 -<?php
2 -
3 -namespace AcyMailing\Controllers\Configuration;
4 -
5 -trait Queue
6 -{
7 - public function deletereport(): void
8 - {
9 - $path = trim(html_entity_decode($this->config->get('cron_savepath')));
10 - if (!preg_match('#^[a-z0-9/_\-{}]*\.log$#i', $path)) {
11 - acym_enqueueMessage(acym_translation('ACYM_WRONG_LOG_NAME'), 'error');
12 -
13 - return;
14 - }
15 -
16 - $path = str_replace(['{year}', '{month}'], [date('Y'), date('m')], $this->config->get('cron_savepath'));
17 - $reportPath = acym_cleanPath(ACYM_ROOT.$path);
18 -
19 - if (is_file($reportPath)) {
20 - $result = acym_deleteFile($reportPath);
21 - if ($result) {
22 - acym_enqueueMessage(acym_translation('ACYM_SUCC_DELETE_LOG'), 'success');
23 - } else {
24 - acym_enqueueMessage(acym_translation('ACYM_ERROR_DELETE_LOG'), 'error');
25 - }
26 - } else {
27 - acym_enqueueMessage(acym_translation('ACYM_EXIST_LOG'), 'info');
28 - }
29 -
30 - $this->listing();
31 - }
32 -
33 - public function seereport(): void
34 - {
35 - acym_noCache();
36 -
37 - $path = trim(html_entity_decode($this->config->get('cron_savepath')));
38 - if (!preg_match('#^[a-z0-9/_\-{}]*\.log$#i', $path)) {
39 - acym_display(acym_translation('ACYM_WRONG_LOG_NAME'), 'error');
40 - }
41 -
42 - $path = str_replace(['{year}', '{month}'], [date('Y'), date('m')], $path);
43 - $reportPath = acym_cleanPath(ACYM_ROOT.$path);
44 -
45 - if (file_exists($reportPath) && !is_dir($reportPath)) {
46 - try {
47 - $lines = 5000;
48 - $f = fopen($reportPath, 'rb');
49 - fseek($f, -1, SEEK_END);
50 - if (fread($f, 1) != "\n") {
51 - $lines -= 1;
52 - }
53 -
54 - $report = '';
55 - while (ftell($f) > 0 && $lines >= 0) {
56 - $seek = min(ftell($f), 4096); // Figure out how far back we should jump
57 - fseek($f, -$seek, SEEK_CUR);
58 - $report = ($chunk = fread($f, $seek)).$report; // Get the line
59 - fseek($f, -mb_strlen($chunk, '8bit'), SEEK_CUR);
60 - $lines -= substr_count($chunk, "\n"); // Move to previous line
61 - }
62 -
63 - while ($lines++ < 0) {
64 - $report = substr($report, strpos($report, "\n") + 1);
65 - }
66 - fclose($f);
67 - } catch (\Exception $e) {
68 - $report = '';
69 - }
70 - }
71 -
72 - if (empty($report)) {
73 - $report = acym_translation('ACYM_EMPTY_LOG');
74 - }
75 -
76 - echo nl2br($report);
77 - exit;
78 - }
79 -}