Title: trigger_error does not work when plugin active
Last modified: November 30, 2021

---

# trigger_error does not work when plugin active

 *  Resolved [jqz](https://wordpress.org/support/users/jqz/)
 * (@jqz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/trigger_error-does-not-work-when-plugin-active/)
 * When this plugin is active (and, for notices, `WP_DEBUG` set to `true`), `trigger_error`
   does not log anything in the expected location.
 * I see the reason is `\stcr\stcr_utils::__construct()` calls `set_error_handler()`
   to set its own error handler.
 * There does not seem to be any mechanism to prevent that from happening. Is there
   one? Also, with your overridden error handler, where do the messages actually
   get logged (I can’t find any log file)?
 * May I suggest the error handler be removed. It should not be down to individual
   plugins to control and change global error handling and reporting (for which 
   there are already well-defined mechanisms via `php.ini` and `WP_DEBUG`-related
   constants – with the exception of plugins specifically for that purpose).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftrigger_error-does-not-work-when-plugin-active%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [jqz](https://wordpress.org/support/users/jqz/)
 * (@jqz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/trigger_error-does-not-work-when-plugin-active/#post-15115759)
 * Just looked at the logging function, `stcr_utils::stcr_logger()` – it seems the
   actual logging is behind an option `subscribe_reloaded_enable_log_data`, the 
   default being off (and the log file is a `.txt` file in the root directory of
   the STCR plugin installation folder, so I have answered my own question).
 * What this means is that this plugin being active causes all PHP errors and notices
   to disappear into a black hole (unless the above option is manually changed from
   the default, wherever it is in the settings – I can’t find it on a quick glance
   through).
 * This is quite a significant bug. It means that minor errors anywhere on your 
   website will go unnoticed. Then they will become major errors as you find an 
   small innocuous upgrade or change breaks your site. Or there are some pages on
   your site that have errors and don’t load but you don’t immediately find out 
   about them because they are not being logged.
 *  Thread Starter [jqz](https://wordpress.org/support/users/jqz/)
 * (@jqz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/trigger_error-does-not-work-when-plugin-active/#post-15115775)
 * [https://github.com/stcr/subscribe-to-comments-reloaded/issues/675](https://github.com/stcr/subscribe-to-comments-reloaded/issues/675)
 *  Plugin Author [WPKube](https://wordpress.org/support/users/wpkube/)
 * (@wpkube)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/trigger_error-does-not-work-when-plugin-active/#post-15116924)
 * I’m sorry for the inconvenience.
 * Thank you for bringing it to our attention. We’ll release an update ASAP to get
   rid of that.
 * > It should not be down to individual plugins to control and change global error
   > handling and reporting
 * I fully agree with that, it should have been removed when we acquired the plugin.
 *  Thread Starter [jqz](https://wordpress.org/support/users/jqz/)
 * (@jqz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/trigger_error-does-not-work-when-plugin-active/#post-15119556)
 * > We’ll release an update ASAP to get rid of that.
 * Wow, I’m impressed by the fast turnaround – less than 24 hours to determine, 
   review and apply the fix, and then make a new release 🙂
    -  This reply was modified 4 years, 6 months ago by [jqz](https://wordpress.org/support/users/jqz/).
      Reason: HTML not MD!
    -  This reply was modified 4 years, 6 months ago by [jqz](https://wordpress.org/support/users/jqz/).
      Reason: grammar
    -  This reply was modified 4 years, 6 months ago by [jqz](https://wordpress.org/support/users/jqz/).
      Reason: punctuation
 *  Plugin Author [WPKube](https://wordpress.org/support/users/wpkube/)
 * (@wpkube)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/trigger_error-does-not-work-when-plugin-active/#post-15120626)
 * Thanks 🙂
 * And again, thanks for pointing out the issue.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘trigger_error does not work when plugin active’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/subscribe-to-comments-reloaded_f0f9fc.
   svg)
 * [Subscribe To Comments Reloaded](https://wordpress.org/plugins/subscribe-to-comments-reloaded/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/subscribe-to-comments-reloaded/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/subscribe-to-comments-reloaded/)
 * [Active Topics](https://wordpress.org/support/plugin/subscribe-to-comments-reloaded/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/subscribe-to-comments-reloaded/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/subscribe-to-comments-reloaded/reviews/)

## Tags

 * [error-handling](https://wordpress.org/support/topic-tag/error-handling/)
 * [E_NOTICE](https://wordpress.org/support/topic-tag/e_notice/)
 * [notice](https://wordpress.org/support/topic-tag/notice/)
 * [PHP Notice](https://wordpress.org/support/topic-tag/php-notice/)

 * 5 replies
 * 2 participants
 * Last reply from: [WPKube](https://wordpress.org/support/users/wpkube/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/trigger_error-does-not-work-when-plugin-active/#post-15120626)
 * Status: resolved