ollyollyolly/wp-better-errors
Composer 安装命令:
composer require ollyollyolly/wp-better-errors
包简介
Better error handling for Wordpress projects
README 文档
README
Wordpress error handling using WP_DEBUG is a little unsophisticated. Setting it to true will set error_reporting to
E_ALL and setting it to false will set it to a specific list. Unfortunately due to the order in which things
load in Wordpress it is not possible to persist changes to error_reporting in wp-config.php. This can often cause
issues on staging environments, where we want to display some errors, but disable errors level such as
E_DEPERCATED or E_STRICT.
Enter better-errors, an mu-plugin which sits between Wordpress setting error_reporting and related settings and
Wordpress loading plugins (the main culprits of deprecation errors).
Better errors listens to the WP_ENV constant to decide what to do. It has some recommended defaults for
development, staging and production environments. These can be overridden by setting further constants:
WP_ERROR_REPORTINGwill be passed toerror_reporting(...)WP_DISPLAY_ERRORSwill be passed toini_set('display_errors', ...)WP_LOG_ERRORSwill be passed toini_set('log_errors', ...)WP_ERROR_LOGwill be passed toini_set('error_log', ...)
Setting these constants using environmental values will allow you to fine-tune settings per-environment.
WP_ERROR_REPORTING takes a bitmask value. If setting as an environmental value the following tool may be useful:
https://maximivanov.github.io/php-error-reporting-calculator/
统计信息
- 总下载量: 1.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2020-10-22