PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | includes/class-updraft-php-logger.php +21 -22 3.2.3 → 4.7.0 View file →
@@ -2,9 +2,8 @@
2 2
3 3 if (!defined('ABSPATH')) die('No direct access allowed');
4 4
5 5 if (class_exists('Updraft_PHP_Logger')) return;
6 -if (!class_exists('Updraft_Abstract_Logger')) require_once('class-updraft-abstract-logger.php');
7 6
8 7 /**
9 8 * Class Updraft_PHP_Logger
10 9 */
@@ -18,9 +17,9 @@
18 17
19 18 /**
20 19 * Returns logger description
21 20 *
22 - * @return string|void
21 + * @return string
23 22 */
24 23 public function get_description() {
25 24 return __('Log events into the PHP error log', 'wp-optimize');
26 25 }
@@ -29,11 +28,11 @@
29 28 * Emergency message
30 29 *
31 30 * @param string $message
32 31 * @param array $context
33 - * @return null|void
32 + * @return void
34 33 */
35 - public function emergency($message, array $context = array()) {
34 + public function emergency($message, $context = array()) {
36 35 $this->log($message, Updraft_Log_Levels::EMERGENCY, $context);
37 36 }
38 37
39 38 /**
@@ -40,11 +39,11 @@
40 39 * Alert message
41 40 *
42 41 * @param string $message
43 42 * @param array $context
44 - * @return null|void
43 + * @return void
45 44 */
46 - public function alert($message, array $context = array()) {
45 + public function alert($message, $context = array()) {
47 46 $this->log($message, Updraft_Log_Levels::ALERT, $context);
48 47 }
49 48
50 49 /**
@@ -51,11 +50,11 @@
51 50 * Critical message
52 51 *
53 52 * @param string $message
54 53 * @param array $context
55 - * @return null|void
54 + * @return void
56 55 */
57 - public function critical($message, array $context = array()) {
56 + public function critical($message, $context = array()) {
58 57 $this->log($message, Updraft_Log_Levels::CRITICAL, $context);
59 58 }
60 59
61 60 /**
@@ -62,11 +61,11 @@
62 61 * Error message
63 62 *
64 63 * @param string $message
65 64 * @param array $context
66 - * @return null|void
65 + * @return void
67 66 */
68 - public function error($message, array $context = array()) {
67 + public function error($message, $context = array()) {
69 68 $this->log($message, Updraft_Log_Levels::ERROR, $context);
70 69 }
71 70
72 71 /**
@@ -73,11 +72,11 @@
73 72 * Warning message
74 73 *
75 74 * @param string $message
76 75 * @param array $context
77 - * @return null|void
76 + * @return void
78 77 */
79 - public function warning($message, array $context = array()) {
78 + public function warning($message, $context = array()) {
80 79 $this->log($message, Updraft_Log_Levels::WARNING, $context);
81 80 }
82 81
83 82 /**
@@ -84,11 +83,11 @@
84 83 * Notice message
85 84 *
86 85 * @param string $message
87 86 * @param array $context
88 - * @return null|void
87 + * @return void
89 88 */
90 - public function notice($message, array $context = array()) {
89 + public function notice($message, $context = array()) {
91 90 $this->log($message, Updraft_Log_Levels::NOTICE, $context);
92 91 }
93 92
94 93 /**
@@ -95,11 +94,11 @@
95 94 * Info message
96 95 *
97 96 * @param string $message
98 97 * @param array $context
99 - * @return null|void
98 + * @return void
100 99 */
101 - public function info($message, array $context = array()) {
100 + public function info($message, $context = array()) {
102 101 $this->log($message, Updraft_Log_Levels::INFO, $context);
103 102 }
104 103
105 104 /**
@@ -106,11 +105,11 @@
106 105 * Debug message
107 106 *
108 107 * @param string $message
109 108 * @param array $context
110 - * @return null|void
109 + * @return void
111 110 */
112 - public function debug($message, array $context = array()) {
111 + public function debug($message, $context = array()) {
113 112 $this->log($message, Updraft_Log_Levels::DEBUG, $context);
114 113 }
115 114
116 115 /**
@@ -118,14 +117,14 @@
118 117 *
119 118 * @param string $message
120 119 * @param mixed $level
121 120 * @param array $context
122 - * @return null|void
121 + * @return void
123 122 */
124 - public function log($message, $level, array $context = array()) {
123 + public function log($message, $level, $context = array()) {
125 124
126 - if (!$this->is_enabled()) return false;
125 + if (!$this->is_enabled()) return;
127 126
128 127 $message = '['.Updraft_Log_Levels::to_text($level).'] : '.$this->interpolate($message, $context);
129 - error_log($message);
128 + error_log($message); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Using for debugging purpose
130 129 }
131 130 }