定制 ollyollyolly/wp-better-errors 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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_REPORTING will be passed to error_reporting(...)
  • WP_DISPLAY_ERRORS will be passed to ini_set('display_errors', ...)
  • WP_LOG_ERRORS will be passed to ini_set('log_errors', ...)
  • WP_ERROR_LOG will be passed to ini_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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2020-10-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固