all(); $incidents = new IncidentRepository(); Menu::header( __( 'PHP Errors', 'aftercare' ) ); if ( ! Options::get( 'error_watch' ) ) { echo '

'; printf( /* translators: %s: settings page URL */ wp_kses_post( __( 'Error watch is turned off, so new fatal errors are not recorded. Turn it on in Aftercare Settings.', 'aftercare' ) ), esc_url( admin_url( 'admin.php?page=aftercare-settings' ) ) ); echo '

'; } if ( empty( $errors ) ) { echo '

' . esc_html__( 'No PHP fatal errors recorded. When a request dies of a fatal error, it appears here grouped by file and line, with the plugin or theme it most likely came from.', 'aftercare' ) . '

'; Menu::footer(); return; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; foreach ( $errors as $error ) { $location = (string) $error['location']; $open = $incidents->find_open( $location, 'ERROR', IncidentRepository::SOURCE_ERROR ); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo '
' . esc_html__( 'Last seen', 'aftercare' ) . '' . esc_html__( 'Error', 'aftercare' ) . '' . esc_html__( 'Likely source', 'aftercare' ) . '' . esc_html__( 'Occurrences', 'aftercare' ) . '' . esc_html__( 'First seen', 'aftercare' ) . '
' . esc_html( human_time_diff( strtotime( $error['last_seen'] . ' UTC' ) ) . ' ' . __( 'ago', 'aftercare' ) ) . '' . esc_html( $location ) . '
' . esc_html( (string) $error['message'] ) . '
' . esc_html( ErrorRepository::culprit_label( (string) $error['culprit'] ) ) . '' . esc_html( Util::format_metric( 'ERROR', (float) $error['occurrences'] ) ) . '' . esc_html( (string) $error['first_seen'] ) . ' UTC'; if ( $open ) { echo '' . esc_html__( 'Open incident', 'aftercare' ) . ''; } echo '
'; echo '

' . esc_html__( 'Only fatal errors are recorded: warnings and notices are left to the PHP error log. Messages are cut to their first line, without server paths.', 'aftercare' ) . '

'; Menu::footer(); } }