PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.7.2
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.7.2
2.7.1 2.7.2 2.7.0 2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 All 141 releases
← All changes | includes/class-metasync-errorlogs.php +22 -14 2.7.1 → 2.7.2 View file →
@@ -49,9 +49,9 @@
49 49 $logFileHandle = explode("\n", $content);
50 50
51 51 foreach ($logFileHandle as $id => $currentLine) {
52 52 // Normal error log line starts with the date & time in []
53 - if ('[' === @$currentLine[0]) {
53 + if ('[' === ($currentLine[0] ?? '')) {
54 54 // if (10000 === \count($parsedLogs)) {
55 55 // return $parsedLogs;
56 56 // }
57 57
@@ -128,24 +128,32 @@
128 128 'stackTrace' => []
129 129 ];
130 130 } // Stack trace beginning line
131 131 else if ('Stack trace:' === $currentLine) {
132 + $parsedLogsLastKey = array_key_last($parsedLogs);
133 + if (null === $parsedLogsLastKey) {
134 + continue;
135 + }
136 +
132 137 $stackTraceLineNumber = 0;
133 -
134 - foreach ($logFileHandle as $line) {
135 - $currentLine = str_replace(PHP_EOL, '', $line);
136 -
137 - // If the current line is a stack trace line
138 - if ('#' === $currentLine[0]) {
139 - $parsedLogsLastKey = key($parsedLogs);
140 - $currentLine = str_replace('#' . $stackTraceLineNumber, '', $currentLine);
141 - $parsedLogs[$parsedLogsLastKey]['stackTrace'][] = trim($currentLine);
142 -
138 + for ($trace_index = $id + 1, $trace_count = count($logFileHandle); $trace_index < $trace_count; $trace_index++) {
139 + $trace_line = trim($logFileHandle[$trace_index]);
140 + if ('' === $trace_line) {
141 + continue;
142 + }
143 + if ('#' === $trace_line[0]) {
144 + $prefix = '#' . $stackTraceLineNumber;
145 + if (0 === strpos($trace_line, $prefix)) {
146 + $trace_line = substr($trace_line, strlen($prefix));
147 + }
148 + $parsedLogs[$parsedLogsLastKey]['stackTrace'][] = trim($trace_line);
143 149 $stackTraceLineNumber++;
144 - } // If the current line is the last stack trace ('thrown in...')
145 - else {
146 - break;
150 + continue;
147 151 }
152 + if (0 === strpos($trace_line, 'thrown in ')) {
153 + $parsedLogs[$parsedLogsLastKey]['stackTrace'][] = $trace_line;
154 + }
155 + break;
148 156 }
149 157 }
150 158 }
151 159