5
07/11/2024 8:02 am
Início do tópico
Olá, tenho um site WordPress e como é antigo (muito antigo!) como posso esconder os erros de PHP?
Por exemplo, eis alguns dos erros:
- Os submenus não estão a aparecer devido a uma classe Walker.
- Os estilos desapareceram! Em vez de mostrar Areal como tipo de letra, é apresentado Times New Roman.
Eis os erros que estou a receber (a propósito - não consigo aceder ao painel de controlo administrativo por causa deles!)
Warning: Declaration of New_Walker_Category::start_el(&$output, $category, $depth, $args) should be compatible with Walker_Category::start_el(&$output, $category, $depth = 0, $args = Array, $id = 0) in /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/theme-functions.php on line 119 Warning: Declaration of DropDown_Nav_Menu::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = NULL) in /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/plugins/dropdown-menus.php on line 119 Warning: Declaration of DropDown_Nav_Menu::end_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::end_lvl(&$output, $depth = 0, $args = NULL) in /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/plugins/dropdown-menus.php on line 130 Warning: Declaration of DropDown_Nav_Menu::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = NULL, $id = 0) in /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/plugins/dropdown-menus.php on line 144 Warning: Declaration of DropDown_Nav_Menu::end_el(&$output, $item, $depth) should be compatible with Walker_Nav_Menu::end_el(&$output, $item, $depth = 0, $args = NULL) in /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/plugins/dropdown-menus.php on line 181 Warning: Declaration of TGM_Bulk_Installer_Skin::before() should be compatible with Bulk_Upgrader_Skin::before($title = '') in /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/class-tgm-plugin-activation.php on line 1977 Warning: Declaration of TGM_Bulk_Installer_Skin::after() should be compatible with Bulk_Upgrader_Skin::after($title = '') in /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/class-tgm-plugin-activation.php on line 1999 Warning: Cannot modify header information - headers already sent by (output started at /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/theme-functions.php:0) in /home/vipozico/old.mychinesenow.com/wp-content/plugins/seo-cleaner/includes/class-seo-cleaner.php on line 244 Warning: Cannot modify header information - headers already sent by (output started at /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/theme-functions.php:0) in /home/vipozico/old.mychinesenow.com/wp-includes/pluggable.php on line 1329 Warning: Cannot modify header information - headers already sent by (output started at /home/vipozico/old.mychinesenow.com/wp-content/themes/nollie/functions/theme-functions.php:0) in /home/vipozico/old.mychinesenow.com/wp-includes/pluggable.php on line 1332
Sei que no wp-config.php na raiz do sítio existe uma linha de código:
define('WP_DEBUG', false);
mas como é que o posso editar?
Obrigado!
3 Respostas
4
07/11/2024 8:05 am
Para esconder totalmente os erros de PHP em wp-config.php é necessário substituir:
define('WP_DEBUG', false);
com:
ini_set('display_errors','Off'); ini_set('error_reporting', E_ALL ); define('WP_DEBUG', false); define('WP_DEBUG_DISPLAY', false);
3
07/11/2024 8:06 am
Pode também depurar os erros no seu sistema WordPress;
Para o efeito, pode adicionar esta linha de código em wp-config.php:
Substituir:
define('WP_DEBUG', false);
COM (pode também ler os comentários no código):
define('WP_DEBUG', true); //Enable Debug logging to the /wp-content/debug.log file define('WP_DEBUG_LOG', true); //false == Showing errors ONLY in /wp-content/debug.log file NOT in the site define('WP_DEBUG_DISPLAY', true);
2
07/11/2024 8:07 am
Pode ver este vídeo útil sobre a depuração de sítios WordPress:
Ou pode utilizar alguns plug-ins de depuração do WP.
Saúde