Title: This plugin is doing PHP error handling a wrong way
Last modified: March 1, 2024

---

# This plugin is doing PHP error handling a wrong way

 *  [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * (@pixtweaks)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/this-plugin-is-doing-php-error-handling-a-wrong-way/)
 * Hi,
   I’ve noticed that when I on purpose wrote into PHP file a code that triggers
   a simple runtime error, the changes I saved have been undone. There are quite
   a few problems with it.1. There was no displayed error on the front end2. There
   was no made record in the error.log file3. There is no setting I could turn it
   off4. There is no mention anywhere that this plugin is handling PHP errors in
   its own way and doesn’t care about any other setup that might be in place in 
   the system.Can you please fix it? Write to the error log and allow to disable
   all error handling, please.
 * Thank you!

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

 *  Plugin Support [Robert Fortaleza](https://wordpress.org/support/users/robfrtlz/)
 * (@robfrtlz)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/this-plugin-is-doing-php-error-handling-a-wrong-way/#post-17562554)
 * Hi [@pixtweaks](https://wordpress.org/support/users/pixtweaks/),
 * Thanks for bringing this to our attention, and apologies for the delayed response.
 * I would be happy to assist with this problem. For me to efficiently do so, would
   you please provide steps on how I can reproduce the reported behavior from my
   end?
 *  Thread Starter [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * (@pixtweaks)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/this-plugin-is-doing-php-error-handling-a-wrong-way/#post-17562634)
 * Hi, thanks for the reply.
   save this code into /wp-content/mu-plugins/trigger-
   error.phpEvery time you make request in admin area it should write into error.
   log that is created within the same folder error warning like this:`[09-Apr-2024
   13:13:55 UTC] PHP Warning:  Undefined variable $abc in D:\laragon\www\test-one\
   wp-content\mu-plugins\trigger-error.php on line 20`If your plugin is on, this
   won’t be written, turn it off and will be written.Your developers need to search
   for PHP error handling functions and disable it, or add settings where it can
   be activated. And I can’t emphasis more that it SHOULD be activated by user’s
   choice, not by default plugin settings. You can’t mess up such an important part
   of development and maintenance. Thank you!
 *     ```wp-block-code
       <?php
   
       ini_set("log_errors", true ); 
   
       if( !file_exists(__DIR__.'/error.log') ){
   
           if(file_put_contents( __DIR__.'/error.log', '' )) {
   
               die( 'not writable folder '.__DIR__ );
   
           }
       }
   
       ini_set('error_log', __DIR__.'/error.log');
   
   
   
       add_action( 'admin_footer', function(){
   
           echo $abc;
   
       });
       ```
   

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

The topic ‘This plugin is doing PHP error handling a wrong way’ is closed to new
replies.

 * ![](https://ps.w.org/wpide/assets/icon-256x256.png?rev=2769504)
 * [WPIDE - File Manager & Code Editor](https://wordpress.org/plugins/wpide/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpide/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpide/)
 * [Active Topics](https://wordpress.org/support/plugin/wpide/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpide/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpide/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/this-plugin-is-doing-php-error-handling-a-wrong-way/#post-17562634)
 * Status: not resolved