sprintf( "%s - %s (%s) [%s]\n%s", $this->message, $this->throwable->getMessage(), $this->throwable->getCode(), get_class( $this->throwable ), $this->throwable->getTraceAsString() ) ); } } /** * Sets the required headers. * * This will only adapt the headers if they haven't yet been sent. */ private function set_headers() { if ( ! headers_sent() ) { // Define the content type for the error page. header( 'Content-Type: text/html; charset=utf-8' ); // Mark the page as a server failure so it won't get indexed. status_header( $this->response_code ); // Let the browser know this result shouldn't get cached. nocache_headers(); } } /** * Get the HTML output for the error page. * * @param string $styles CSS styles to use. * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'. * @return string HTML output. */ private function get_html( $styles, $text_direction ) { $no_robots = get_option( 'blog_public' ) ? "\n" : "\n"; return << {$no_robots} {$this->render_title()} {$styles}

{$this->render_title()}

{$this->render_message()} {$this->render_source()} {$this->render_support_link()} {$this->render_throwable()} {$this->render_back_link()} HTML; } /** * Render title. * * @return string HTML-escaped title. */ private function render_title() { return esc_html( $this->title ); } /** * Render message. * * @return string KSES-sanitized message. */ private function render_message() { return '

' . wp_kses_post( $this->message ) . '

'; } /** * Render support link. * * @return string */ private function render_support_link() { return '

' . wp_kses( sprintf( /* translators: %s is the AMP support forum URL. */ __( 'If you get stuck, you may want to share any details in a new topic on the plugin\'s support forum.', 'amp' ), esc_url( __( 'https://wordpress.org/support/plugin/amp/', 'amp' ) ) ), [ 'a' => [ 'href' => true, 'target' => true, 'rel' => true, ], ] ) . '

'; } /** * Render the source of the throwable. * * @return string File source data. */ private function render_source() { if ( null === $this->throwable ) { return ''; } $source = $this->likely_culprit_detector->analyze_throwable( $this->throwable ); if ( ! empty( $source['type'] ) && ! empty( $source['name'] ) ) { $name_markup = "{$source['name']}"; switch ( $source['type'] ) { case 'plugin': /* translators: placeholder is the slug of the plugin */ $message = sprintf( __( 'It appears the plugin with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; case 'mu-plugin': /* translators: placeholder is the slug of the must-use plugin */ $message = sprintf( __( 'It appears the must-use plugin with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; case 'theme': /* translators: placeholder is the slug of the theme */ $message = sprintf( __( 'It appears the theme with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; default: return ''; } return wp_kses( "

{$message}

", array_fill_keys( [ 'p', 'strong', 'code' ], [] ) ); } return ''; } /** * Render the throwable of the error page. * * The exception/error details are only rendered if both WP_DEBUG and WP_DEBUG_DISPLAY are true. * * @return string HTML describing the exception/error that was thrown. */ private function render_throwable() { if ( null === $this->throwable ) { return ''; } if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG || ! defined( 'WP_DEBUG_DISPLAY' ) || ! WP_DEBUG_DISPLAY ) { return wpautop( wp_kses_post( __( 'The exact details of the error are hidden for security reasons. To learn more about this error, enable the WordPress debugging display (by setting both WP_DEBUG and WP_DEBUG_DISPLAY to true), or look into the PHP error log. Learn more about Debugging in WordPress.', 'amp' ) ) ); } $contents = implode( "\n", [ sprintf( '%s (%s) [%s]', esc_html( $this->throwable->getMessage() ), esc_html( $this->throwable->getCode() ), esc_html( get_class( $this->throwable ) ) ), sprintf( '%s:%d', esc_html( $this->throwable->getFile() ), esc_html( $this->throwable->getLine() ) ), '', sprintf( '%s', esc_html( $this->throwable->getTraceAsString() ) ), ] ); return "
{$contents}
"; } /** * Render back link. * * @return string Back link. */ private function render_back_link() { if ( empty( $this->link_text ) || empty( $this->link_url ) ) { return ''; } return sprintf( '

%s

', esc_url( $this->link_url ), esc_html( $this->link_text ) ); } /** * Get the CSS styles to use for the error page. * * @see _default_wp_die_handler() Where styles are adapted from. * * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'. * @return string CSS styles to use. */ private function get_styles( $text_direction ) { $rtl_font_tweak = 'rtl' === $text_direction ? 'body { font-family: Tahoma, Arial; }' : ''; return << html { background: #f1f1f1; } body { background: #fff; color: #444; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; margin: 2em auto; padding: 1em 2em; max-width: 700px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); } h1 { border-bottom: 1px solid #dadada; clear: both; color: #666; font-size: 24px; margin: 30px 0 0 0; padding: 0; padding-bottom: 7px; } hr { margin: 20px 0; border: none; border-top: 1px solid #dadada; } #error-page { margin-top: 50px; } #error-page p, #error-page .wp-die-message { font-size: 14px; line-height: 1.5; margin: 25px 0 20px; } #error-page .throwable, code { font-family: Consolas, Monaco, monospace; overflow-x: auto; } ul li { margin-bottom: 10px; font-size: 14px ; } a { color: #0073aa; } a:hover, a:active { color: #006799; } a:focus { color: #124964; -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); outline: none; } .button { background: #f7f7f7; border: 1px solid #ccc; color: #555; display: inline-block; text-decoration: none; font-size: 13px; line-height: 2; height: 28px; margin: 0; padding: 0 10px 1px; cursor: pointer; -webkit-border-radius: 3px; -webkit-appearance: none; border-radius: 3px; white-space: nowrap; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-shadow: 0 1px 0 #ccc; box-shadow: 0 1px 0 #ccc; vertical-align: top; } .button.button-large { height: 30px; line-height: 2.15384615; padding: 0 12px 2px; } .button:hover, .button:focus { background: #fafafa; border-color: #999; color: #23282d; } .button:focus { border-color: #5b9dd9; -webkit-box-shadow: 0 0 3px rgba(0, 115, 170, 0.8); box-shadow: 0 0 3px rgba(0, 115, 170, 0.8); outline: none; } .button:active { background: #eee; border-color: #999; -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); } {$rtl_font_tweak} STYLES; } } sprintf( "%s - %s (%s) [%s]\n%s", $this->message, $this->throwable->getMessage(), $this->throwable->getCode(), get_class( $this->throwable ), $this->throwable->getTraceAsString() ) ); } } /** * Sets the required headers. * * This will only adapt the headers if they haven't yet been sent. */ private function set_headers() { if ( ! headers_sent() ) { // Define the content type for the error page. header( 'Content-Type: text/html; charset=utf-8' ); // Mark the page as a server failure so it won't get indexed. status_header( $this->response_code ); // Let the browser know this result shouldn't get cached. nocache_headers(); } } /** * Get the HTML output for the error page. * * @param string $styles CSS styles to use. * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'. * @return string HTML output. */ private function get_html( $styles, $text_direction ) { $no_robots = get_option( 'blog_public' ) ? "\n" : "\n"; return << {$no_robots} {$this->render_title()} {$styles}

{$this->render_title()}

{$this->render_message()} {$this->render_source()} {$this->render_support_link()} {$this->render_throwable()} {$this->render_back_link()} HTML; } /** * Render title. * * @return string HTML-escaped title. */ private function render_title() { return esc_html( $this->title ); } /** * Render message. * * @return string KSES-sanitized message. */ private function render_message() { return '

' . wp_kses_post( $this->message ) . '

'; } /** * Render support link. * * @return string */ private function render_support_link() { return '

' . wp_kses( sprintf( /* translators: %s is the AMP support forum URL. */ __( 'If you get stuck, you may want to share any details in a new topic on the plugin\'s support forum.', 'amp' ), esc_url( __( 'https://wordpress.org/support/plugin/amp/', 'amp' ) ) ), [ 'a' => [ 'href' => true, 'target' => true, 'rel' => true, ], ] ) . '

'; } /** * Render the source of the throwable. * * @return string File source data. */ private function render_source() { if ( null === $this->throwable ) { return ''; } $source = $this->likely_culprit_detector->analyze_throwable( $this->throwable ); if ( ! empty( $source['type'] ) && ! empty( $source['name'] ) ) { $name_markup = "{$source['name']}"; switch ( $source['type'] ) { case 'plugin': /* translators: placeholder is the slug of the plugin */ $message = sprintf( __( 'It appears the plugin with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; case 'mu-plugin': /* translators: placeholder is the slug of the must-use plugin */ $message = sprintf( __( 'It appears the must-use plugin with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; case 'theme': /* translators: placeholder is the slug of the theme */ $message = sprintf( __( 'It appears the theme with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; default: return ''; } return wp_kses( "

{$message}

", array_fill_keys( [ 'p', 'strong', 'code' ], [] ) ); } return ''; } /** * Render the throwable of the error page. * * The exception/error details are only rendered if both WP_DEBUG and WP_DEBUG_DISPLAY are true. * * @return string HTML describing the exception/error that was thrown. */ private function render_throwable() { if ( null === $this->throwable ) { return ''; } if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG || ! defined( 'WP_DEBUG_DISPLAY' ) || ! WP_DEBUG_DISPLAY ) { return wpautop( wp_kses_post( __( 'The exact details of the error are hidden for security reasons. To learn more about this error, enable the WordPress debugging display (by setting both WP_DEBUG and WP_DEBUG_DISPLAY to true), or look into the PHP error log. Learn more about Debugging in WordPress.', 'amp' ) ) ); } $contents = implode( "\n", [ sprintf( '%s (%s) [%s]', esc_html( $this->throwable->getMessage() ), esc_html( $this->throwable->getCode() ), esc_html( get_class( $this->throwable ) ) ), sprintf( '%s:%d', esc_html( $this->throwable->getFile() ), esc_html( $this->throwable->getLine() ) ), '', sprintf( '%s', esc_html( $this->throwable->getTraceAsString() ) ), ] ); return "
{$contents}
"; } /** * Render back link. * * @return string Back link. */ private function render_back_link() { if ( empty( $this->link_text ) || empty( $this->link_url ) ) { return ''; } return sprintf( '

%s

', esc_url( $this->link_url ), esc_html( $this->link_text ) ); } /** * Get the CSS styles to use for the error page. * * @see _default_wp_die_handler() Where styles are adapted from. * * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'. * @return string CSS styles to use. */ private function get_styles( $text_direction ) { $rtl_font_tweak = 'rtl' === $text_direction ? 'body { font-family: Tahoma, Arial; }' : ''; return << html { background: #f1f1f1; } body { background: #fff; color: #444; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; margin: 2em auto; padding: 1em 2em; max-width: 700px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); } h1 { border-bottom: 1px solid #dadada; clear: both; color: #666; font-size: 24px; margin: 30px 0 0 0; padding: 0; padding-bottom: 7px; } hr { margin: 20px 0; border: none; border-top: 1px solid #dadada; } #error-page { margin-top: 50px; } #error-page p, #error-page .wp-die-message { font-size: 14px; line-height: 1.5; margin: 25px 0 20px; } #error-page .throwable, code { font-family: Consolas, Monaco, monospace; overflow-x: auto; } ul li { margin-bottom: 10px; font-size: 14px ; } a { color: #0073aa; } a:hover, a:active { color: #006799; } a:focus { color: #124964; -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); outline: none; } .button { background: #f7f7f7; border: 1px solid #ccc; color: #555; display: inline-block; text-decoration: none; font-size: 13px; line-height: 2; height: 28px; margin: 0; padding: 0 10px 1px; cursor: pointer; -webkit-border-radius: 3px; -webkit-appearance: none; border-radius: 3px; white-space: nowrap; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-shadow: 0 1px 0 #ccc; box-shadow: 0 1px 0 #ccc; vertical-align: top; } .button.button-large { height: 30px; line-height: 2.15384615; padding: 0 12px 2px; } .button:hover, .button:focus { background: #fafafa; border-color: #999; color: #23282d; } .button:focus { border-color: #5b9dd9; -webkit-box-shadow: 0 0 3px rgba(0, 115, 170, 0.8); box-shadow: 0 0 3px rgba(0, 115, 170, 0.8); outline: none; } .button:active { background: #eee; border-color: #999; -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); } {$rtl_font_tweak} STYLES; } } sprintf( "%s - %s (%s) [%s]\n%s", $this->message, $this->throwable->getMessage(), $this->throwable->getCode(), get_class( $this->throwable ), $this->throwable->getTraceAsString() ) ); } } /** * Sets the required headers. * * This will only adapt the headers if they haven't yet been sent. */ private function set_headers() { if ( ! headers_sent() ) { // Define the content type for the error page. header( 'Content-Type: text/html; charset=utf-8' ); // Mark the page as a server failure so it won't get indexed. status_header( $this->response_code ); // Let the browser know this result shouldn't get cached. nocache_headers(); } } /** * Get the HTML output for the error page. * * @param string $styles CSS styles to use. * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'. * @return string HTML output. */ private function get_html( $styles, $text_direction ) { $no_robots = get_option( 'blog_public' ) ? "\n" : "\n"; return << {$no_robots} {$this->render_title()} {$styles}

{$this->render_title()}

{$this->render_message()} {$this->render_source()} {$this->render_support_link()} {$this->render_throwable()} {$this->render_back_link()} HTML; } /** * Render title. * * @return string HTML-escaped title. */ private function render_title() { return esc_html( $this->title ); } /** * Render message. * * @return string KSES-sanitized message. */ private function render_message() { return '

' . wp_kses_post( $this->message ) . '

'; } /** * Render support link. * * @return string */ private function render_support_link() { return '

' . wp_kses( sprintf( /* translators: %s is the AMP support forum URL. */ __( 'If you get stuck, you may want to share any details in a new topic on the plugin\'s support forum.', 'amp' ), esc_url( __( 'https://wordpress.org/support/plugin/amp/', 'amp' ) ) ), [ 'a' => [ 'href' => true, 'target' => true, 'rel' => true, ], ] ) . '

'; } /** * Render the source of the throwable. * * @return string File source data. */ private function render_source() { if ( null === $this->throwable ) { return ''; } $source = $this->likely_culprit_detector->analyze_throwable( $this->throwable ); if ( ! empty( $source['type'] ) && ! empty( $source['name'] ) ) { $name_markup = "{$source['name']}"; switch ( $source['type'] ) { case 'plugin': /* translators: placeholder is the slug of the plugin */ $message = sprintf( __( 'It appears the plugin with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; case 'mu-plugin': /* translators: placeholder is the slug of the must-use plugin */ $message = sprintf( __( 'It appears the must-use plugin with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; case 'theme': /* translators: placeholder is the slug of the theme */ $message = sprintf( __( 'It appears the theme with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; default: return ''; } return wp_kses( "

{$message}

", array_fill_keys( [ 'p', 'strong', 'code' ], [] ) ); } return ''; } /** * Render the throwable of the error page. * * The exception/error details are only rendered if both WP_DEBUG and WP_DEBUG_DISPLAY are true. * * @return string HTML describing the exception/error that was thrown. */ private function render_throwable() { if ( null === $this->throwable ) { return ''; } if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG || ! defined( 'WP_DEBUG_DISPLAY' ) || ! WP_DEBUG_DISPLAY ) { return wpautop( wp_kses_post( __( 'The exact details of the error are hidden for security reasons. To learn more about this error, enable the WordPress debugging display (by setting both WP_DEBUG and WP_DEBUG_DISPLAY to true), or look into the PHP error log. Learn more about Debugging in WordPress.', 'amp' ) ) ); } $contents = implode( "\n", [ sprintf( '%s (%s) [%s]', esc_html( $this->throwable->getMessage() ), esc_html( $this->throwable->getCode() ), esc_html( get_class( $this->throwable ) ) ), sprintf( '%s:%d', esc_html( $this->throwable->getFile() ), esc_html( $this->throwable->getLine() ) ), '', sprintf( '%s', esc_html( $this->throwable->getTraceAsString() ) ), ] ); return "
{$contents}
"; } /** * Render back link. * * @return string Back link. */ private function render_back_link() { if ( empty( $this->link_text ) || empty( $this->link_url ) ) { return ''; } return sprintf( '

%s

', esc_url( $this->link_url ), esc_html( $this->link_text ) ); } /** * Get the CSS styles to use for the error page. * * @see _default_wp_die_handler() Where styles are adapted from. * * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'. * @return string CSS styles to use. */ private function get_styles( $text_direction ) { $rtl_font_tweak = 'rtl' === $text_direction ? 'body { font-family: Tahoma, Arial; }' : ''; return << html { background: #f1f1f1; } body { background: #fff; color: #444; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; margin: 2em auto; padding: 1em 2em; max-width: 700px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); } h1 { border-bottom: 1px solid #dadada; clear: both; color: #666; font-size: 24px; margin: 30px 0 0 0; padding: 0; padding-bottom: 7px; } hr { margin: 20px 0; border: none; border-top: 1px solid #dadada; } #error-page { margin-top: 50px; } #error-page p, #error-page .wp-die-message { font-size: 14px; line-height: 1.5; margin: 25px 0 20px; } #error-page .throwable, code { font-family: Consolas, Monaco, monospace; overflow-x: auto; } ul li { margin-bottom: 10px; font-size: 14px ; } a { color: #0073aa; } a:hover, a:active { color: #006799; } a:focus { color: #124964; -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); outline: none; } .button { background: #f7f7f7; border: 1px solid #ccc; color: #555; display: inline-block; text-decoration: none; font-size: 13px; line-height: 2; height: 28px; margin: 0; padding: 0 10px 1px; cursor: pointer; -webkit-border-radius: 3px; -webkit-appearance: none; border-radius: 3px; white-space: nowrap; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-shadow: 0 1px 0 #ccc; box-shadow: 0 1px 0 #ccc; vertical-align: top; } .button.button-large { height: 30px; line-height: 2.15384615; padding: 0 12px 2px; } .button:hover, .button:focus { background: #fafafa; border-color: #999; color: #23282d; } .button:focus { border-color: #5b9dd9; -webkit-box-shadow: 0 0 3px rgba(0, 115, 170, 0.8); box-shadow: 0 0 3px rgba(0, 115, 170, 0.8); outline: none; } .button:active { background: #eee; border-color: #999; -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); } {$rtl_font_tweak} STYLES; } } sprintf( "%s - %s (%s) [%s]\n%s", $this->message, $this->throwable->getMessage(), $this->throwable->getCode(), get_class( $this->throwable ), $this->throwable->getTraceAsString() ) ); } } /** * Sets the required headers. * * This will only adapt the headers if they haven't yet been sent. */ private function set_headers() { if ( ! headers_sent() ) { // Define the content type for the error page. header( 'Content-Type: text/html; charset=utf-8' ); // Mark the page as a server failure so it won't get indexed. status_header( $this->response_code ); // Let the browser know this result shouldn't get cached. nocache_headers(); } } /** * Get the HTML output for the error page. * * @param string $styles CSS styles to use. * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'. * @return string HTML output. */ private function get_html( $styles, $text_direction ) { $no_robots = get_option( 'blog_public' ) ? "\n" : "\n"; return << {$no_robots} {$this->render_title()} {$styles}

{$this->render_title()}

{$this->render_message()} {$this->render_source()} {$this->render_support_link()} {$this->render_throwable()} {$this->render_back_link()} HTML; } /** * Render title. * * @return string HTML-escaped title. */ private function render_title() { return esc_html( $this->title ); } /** * Render message. * * @return string KSES-sanitized message. */ private function render_message() { return '

' . wp_kses_post( $this->message ) . '

'; } /** * Render support link. * * @return string */ private function render_support_link() { return '

' . wp_kses( sprintf( /* translators: %s is the AMP support forum URL. */ __( 'If you get stuck, you may want to share any details in a new topic on the plugin\'s support forum.', 'amp' ), esc_url( __( 'https://wordpress.org/support/plugin/amp/', 'amp' ) ) ), [ 'a' => [ 'href' => true, 'target' => true, 'rel' => true, ], ] ) . '

'; } /** * Render the source of the throwable. * * @return string File source data. */ private function render_source() { if ( null === $this->throwable ) { return ''; } $source = $this->likely_culprit_detector->analyze_throwable( $this->throwable ); if ( ! empty( $source['type'] ) && ! empty( $source['name'] ) ) { $name_markup = "{$source['name']}"; switch ( $source['type'] ) { case 'plugin': /* translators: placeholder is the slug of the plugin */ $message = sprintf( __( 'It appears the plugin with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; case 'mu-plugin': /* translators: placeholder is the slug of the must-use plugin */ $message = sprintf( __( 'It appears the must-use plugin with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; case 'theme': /* translators: placeholder is the slug of the theme */ $message = sprintf( __( 'It appears the theme with slug %s is responsible; please contact the author.', 'amp' ), $name_markup ); break; default: return ''; } return wp_kses( "

{$message}

", array_fill_keys( [ 'p', 'strong', 'code' ], [] ) ); } return ''; } /** * Render the throwable of the error page. * * The exception/error details are only rendered if both WP_DEBUG and WP_DEBUG_DISPLAY are true. * * @return string HTML describing the exception/error that was thrown. */ private function render_throwable() { if ( null === $this->throwable ) { return ''; } if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG || ! defined( 'WP_DEBUG_DISPLAY' ) || ! WP_DEBUG_DISPLAY ) { return wpautop( wp_kses_post( __( 'The exact details of the error are hidden for security reasons. To learn more about this error, enable the WordPress debugging display (by setting both WP_DEBUG and WP_DEBUG_DISPLAY to true), or look into the PHP error log. Learn more about Debugging in WordPress.', 'amp' ) ) ); } $contents = implode( "\n", [ sprintf( '%s (%s) [%s]', esc_html( $this->throwable->getMessage() ), esc_html( $this->throwable->getCode() ), esc_html( get_class( $this->throwable ) ) ), sprintf( '%s:%d', esc_html( $this->throwable->getFile() ), esc_html( $this->throwable->getLine() ) ), '', sprintf( '%s', esc_html( $this->throwable->getTraceAsString() ) ), ] ); return "
{$contents}
"; } /** * Render back link. * * @return string Back link. */ private function render_back_link() { if ( empty( $this->link_text ) || empty( $this->link_url ) ) { return ''; } return sprintf( '

%s

', esc_url( $this->link_url ), esc_html( $this->link_text ) ); } /** * Get the CSS styles to use for the error page. * * @see _default_wp_die_handler() Where styles are adapted from. * * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'. * @return string CSS styles to use. */ private function get_styles( $text_direction ) { $rtl_font_tweak = 'rtl' === $text_direction ? 'body { font-family: Tahoma, Arial; }' : ''; return << html { background: #f1f1f1; } body { background: #fff; color: #444; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; margin: 2em auto; padding: 1em 2em; max-width: 700px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); } h1 { border-bottom: 1px solid #dadada; clear: both; color: #666; font-size: 24px; margin: 30px 0 0 0; padding: 0; padding-bottom: 7px; } hr { margin: 20px 0; border: none; border-top: 1px solid #dadada; } #error-page { margin-top: 50px; } #error-page p, #error-page .wp-die-message { font-size: 14px; line-height: 1.5; margin: 25px 0 20px; } #error-page .throwable, code { font-family: Consolas, Monaco, monospace; overflow-x: auto; } ul li { margin-bottom: 10px; font-size: 14px ; } a { color: #0073aa; } a:hover, a:active { color: #006799; } a:focus { color: #124964; -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); outline: none; } .button { background: #f7f7f7; border: 1px solid #ccc; color: #555; display: inline-block; text-decoration: none; font-size: 13px; line-height: 2; height: 28px; margin: 0; padding: 0 10px 1px; cursor: pointer; -webkit-border-radius: 3px; -webkit-appearance: none; border-radius: 3px; white-space: nowrap; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-shadow: 0 1px 0 #ccc; box-shadow: 0 1px 0 #ccc; vertical-align: top; } .button.button-large { height: 30px; line-height: 2.15384615; padding: 0 12px 2px; } .button:hover, .button:focus { background: #fafafa; border-color: #999; color: #23282d; } .button:focus { border-color: #5b9dd9; -webkit-box-shadow: 0 0 3px rgba(0, 115, 170, 0.8); box-shadow: 0 0 3px rgba(0, 115, 170, 0.8); outline: none; } .button:active { background: #eee; border-color: #999; -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); } {$rtl_font_tweak} STYLES; } } OTRAF Archives - Infos Culture du Faso
ven 6 décembre 2024

Suivez-nous sur les réseaux sociaux

spot_img
AccueilTagsOTRAF

Tag: OTRAF

Aucun article à afficher

- Advertisement -spot_img

Latest Articles

Vous ne pouvez pas copier le contenu de cette page