WPIntell

Source evidence

Fatal error with WordPress 6.5+

Debug Bar Localization · support · 2024-09-03T12:54:00+00:00

complaintsentiment
highseverity
0.85relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 26 rows with source links

23.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Diego Pereira unresolved
Hi there! First of all, thanks for creating this plugin! I use it a lot to debug translation issues. For some time now, the following error has started to happen. It seems related to WP 6.5+: Fatal error: Uncaught Error: Call to undefined method WP_Translations::get_header() in /Users/diegopereira/Local Sites/compsupp-7554/app/public/wp-content/plugins/debug-bar-localization/class-debug-bar-localization.php:463 Stack trace: #0 /Users/diegopereira/Local Sites/compsupp-7554/app/public/wp-content/plugins/debug-bar-localization/class-debug-bar-localization.php(385): Debug_Bar_Localization->render_last_updated('default') #1 /Users/diegopereira/Local Sites/compsupp-7554/app/public/wp-content/plugins/debug-bar-localization/class-debug-bar-localization.php(331): Debug_Bar_Localization->render_load_textdomain_table('core') #2 /Users/diegopereira/Local Sites/compsupp-7554/app/public/wp-content/plugins/debug-bar-localization/class-debug-bar-localization.php(181): Debug_Bar_Localization->render_load_textdomain_section() #3 /Users/diegopereira/Local Sites/compsupp-7554/app/public/wp-content/plugins/debug-bar/debug-bar.php(377): Debug_Bar_Localization->render() #4 /Users/diegopereira/Local Sites/compsupp-7554/app/public/wp- in /Users/diegopereira/Local Sites/compsupp-7554/app/public/wp-content/plugins/debug-bar-localization/class-debug-bar-localization.php on line 463 It could be fixed by replacing Debug_Bar_Localization::render_last_updated() with: protected function render_last_updated( $domain ) { // Verifica se o domínio de tradução está carregado if ( ! isset( $GLOBALS['l10n'][ $domain ] ) ) { echo '-'; return; } // Recupera as traduções para o domínio específico $translations = $GLOBALS['l10n'][ $domain ]; // Inicializa as variáveis para X-Generator e PO-Revision-Date $x_generator = false; $revision_date = false; // Verifica se os cabeçalhos estão definidos if ( isset( $translations->headers['X-Generator'] ) ) { $x_generator = $translations->headers['X-Generator']; } if ( isset( $translations->headers['PO-Revision-Date'] ) ) { $revision_date = $translations->headers['PO-Revision-Date']; } if ( false === $revision_date ) { echo '-'; return; } $generator = __( 'unknown', 'debug-bar-localization' ); if ( ! empty( $x_generator ) && is_string( $x_generator ) ) { if ( false !== strpos( $x_generator, 'GlotPress' ) ) { $generator = 'GlotPress'; } elseif ( false !== strpos( $x_generator, 'Poedit' ) ) { $generator = 'Poedit'; } else { $generator = $x_generator; } } echo wp_kses_post( sprintf( /* translators: 1: date, 2: translation program name. */ __( '%s via %s', 'debug-bar-localization' ), substr( $revision_date, 0, 10 ), '<em>' . $generator . '</em>' ) ); } I created a PR here: https://github.com/jrfnl/debug-bar-localization/pull/28

Comments

1 shown
Diego Pereira 2024-09-03T13:01:00+00:00

I created a PR here: https://github.com/jrfnl/debug-bar-localization/pull/28