Bonjour, j'ai un site WordPress et comme il est vieux (très vieux !) comment puis-je cacher les erreurs PHP ?
Voici quelques exemples d'erreurs:
- Les sous-menus ne s'affichent pas à cause d'une classe de Walker.
- Les styles ont disparu ! Au lieu d'afficher Areal comme police, c'est Times New Roman qui s'affiche.
Voici les erreurs que j'obtiens (je ne peux pas entrer dans le tableau de bord de l'administrateur à cause de ces erreurs) :
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
Je sais que dans la wp-config.php à la racine du site, il y a une ligne de code :
define('WP_DEBUG', false);
mais comment puis-je l'éditer ?
Merci de votre attention !
Pour masquer totalement les erreurs PHP dans wp-config.php que vous devez remplacer :
define('WP_DEBUG', false);
avec:
ini_set('display_errors','Off'); ini_set('error_reporting', E_ALL ); define('WP_DEBUG', false); define('WP_DEBUG_DISPLAY', false);
Vous pouvez également déboguer les erreurs dans votre système WordPress ;
Pour ce faire, vous pouvez ajouter ces lignes de code dans le fichier wp-config.php:
Remplacer:
define('WP_DEBUG', false);
AVEC (vous pouvez également lire les commentaires dans le code) :
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);
Vous pouvez regarder cette vidéo utile sur le débogage des sites WordPress :
Vous pouvez également utiliser des plugins WP de débogage.
Santé