orpath, 'r' ); $file->seek( PHP_INT_MAX ); $last_line = $file->key(); $iterator = new LimitIterator( $file, $last_line > 3500 ? $last_line - 3500 : 0, $last_line ); $lines = iterator_to_array( $iterator ); $previous_line = null; foreach ( $lines as $line ) { // Parse the date $date = ''; try { $dateArr = []; preg_match( '~^\[(.*?)\]~', $line, $dateArr ); if ( isset( $dateArr[0] ) ) { $line = str_replace( $dateArr[0], '', $line ); $line = trim( $line ); $date = new DateTime( $dateArr[1] ); $date = get_date_from_gmt( $date->format('Y-m-d H:i:s'), 'Y-m-d H:i:s' ); } else { continue; } } catch ( Exception $e ) { continue; } // Parse the error $type = ''; if ( preg_match( '/PHP Fatal error/', $line ) ) { $line = trim( str_replace( 'PHP Fatal error:', '', $line ) ); $type = 'fatal'; } else if ( preg_match( '/PHP Warning/', $line ) ) { $line = trim( str_replace( 'PHP Warning:', '', $line ) ); $type = 'warning'; } else if ( preg_match( '/PHP Notice/', $line ) ) { $line = trim( str_replace( 'PHP Notice:', '', $line ) ); $type = 'notice'; } else if ( preg_match( '/PHP Parse error/', $line ) ) { $line = trim( str_replace( 'PHP Parse error:', '', $line ) ); $type = 'parse'; } else if ( preg_match( '/PHP Exception/', $line ) ) { $line = trim( str_replace( 'PHP Exception:', '', $line ) ); $type = 'exception'; } else { continue; } // Skip the error if is the same as before. if ( $line !== $previous_line ) { array_push( $output_lines, array( 'date' => $date, 'type' => $type, 'content' => $line ) ); $previous_line = $line; } } } catch ( OutOfBoundsException $e ) { error_log( $e->getMessage() ); return array(); } } return $output_lines; // else { // $output_lines = array_reverse( $output_lines ); // $html = ''; // $previous = ''; // foreach ( $output_lines as $line ) { // // Let's avoid similar errors, since it's not useful. We should also make this better // // and not only theck this depending on tie. // if ( preg_replace( '/\[.*\] PHP/', '', $previous ) !== preg_replace( '/\[.*\] PHP/', '', $line ) ) { // $html .= $line; // $previous = $line; // } // } // return $html; // } } static function timer_start( $timerName = 'default' ) { MeowCommon_Helpers::$startQueries[ $timerName ] = get_num_queries(); MeowCommon_Helpers::$startTimes[ $timerName ] = microtime( true ); } static function timer_elapsed( $timerName = 'default' ) { return microtime( true ) - MeowCommon_Helpers::$startTimes[ $timerName ]; } static function timer_log_elapsed( $timerName = 'default' ) { $elapsed = MeowCommon_Helpers::timer_elapsed( $timerName ); $queries = get_num_queries() - MeowCommon_Helpers::$startQueries[ $timerName ]; error_log( $timerName . ": " . $elapsed . "ms (" . $queries . " queries)" ); } } // Asked by WP Security Team to remove this. // if ( MeowCommon_Helpers::is_rest() ) { // ini_set( 'display_errors', 0 ); // } }
Fatal error: Uncaught Error: Class "MeowCommon_Helpers" not found in /htdocs/xn--ceinturedore-leb.com/wp-content/plugins/media-cleaner/classes/init.php:37 Stack trace: #0 /htdocs/xn--ceinturedore-leb.com/wp-content/plugins/media-cleaner/media-cleaner.php(26): require_once() #1 /htdocs/xn--ceinturedore-leb.com/wp-settings.php(522): include_once('/htdocs/xn--cei...') #2 /htdocs/xn--ceinturedore-leb.com/wp-config.php(101): require_once('/htdocs/xn--cei...') #3 /htdocs/xn--ceinturedore-leb.com/wp-load.php(50): require_once('/htdocs/xn--cei...') #4 /htdocs/xn--ceinturedore-leb.com/wp-blog-header.php(13): require_once('/htdocs/xn--cei...') #5 /htdocs/xn--ceinturedore-leb.com/index.php(17): require('/htdocs/xn--cei...') #6 {main} thrown in /htdocs/xn--ceinturedore-leb.com/wp-content/plugins/media-cleaner/classes/init.php on line 37