src/HookListener/QueryErrorsListener.php
public function update( array $args ) {

		$wp = $args ? reset( $args ) : NULL;

		if ( ! $wp instanceof \WP ) {
			return new NullLog();
		}

		$error = [];
		isset( $wp->query_vars[ 'error' ] ) and $error[] = $wp->query_vars[ 'error' ];
		is_404() and $error[] = '404 Page not found';

		if ( empty( $error ) ) {
			return new NullLog();
		}

		$url     = filter_var( add_query_arg( [] ), FILTER_SANITIZE_URL );
		$message = "Error on frontend request for url {$url}.";
		$context = [
			'error'        => $error,
			'query_vars'   => $wp->query_vars,
			'matched_rule' => $wp->matched_rule,
		];

		return new Debug( $message, Channels::HTTP, $context );
	}
public function update( array $args ) {

		$wp = $args ? reset( $args ) : NULL;

		if ( ! $wp instanceof \WP ) {
			return new NullLog();
		}

		$error = [];
		isset( $wp->query_vars[ 'error' ] ) and $error[] = $wp->query_vars[ 'error' ];
		is_404() and $error[] = '404 Page not found';

		if ( empty( $error ) ) {
			return new NullLog();
		}

		$url     = filter_var( add_query_arg( [] ), FILTER_SANITIZE_URL );
		$message = "Error on frontend request for url {$url}.";
		$context = [
			'error'        => $error,
			'query_vars'   => $wp->query_vars,
			'matched_rule' => $wp->matched_rule,
		];

		return new Debug( $message, Channels::HTTP, $context );
	}
public function update ( array $ args ) { $ wp = $ args ? reset ( $ args ) : NULL ; if ( ! $ wp instanceof \ WP ) { return new NullLog ( ) ; } $ error = [ ] ; isset ( $ wp -> query_vars [ 'error' ] ) and $ error [ ] = $ wp -> query_vars [ 'error' ] ; is_404 ( ) and $ error [ ] = '404 Page not found' ; if ( empty ( $ error ) ) { return new NullLog ( ) ; } $ url = filter_var ( add_query_arg ( [ ] ) , FILTER_SANITIZE_URL ) ; $ message = "Error on frontend request for url {$url}." ; $ context = [ 'error' => $ error , 'query_vars' => $ wp -> query_vars , 'matched_rule' => $ wp -> matched_rule , ] ; return new Debug ( $ message , Channels :: HTTP , $ context ) ; }
Checks frontend request for any errors and log them.

@param $args

@return LogDataInterface

@wp-hook wp
Checks frontend request for any errors and log them .