• 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 end
    2. There was no made record in the error.log file
    3. There is no setting I could turn it off
    4. 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

    (@robfrtlz)

    Hi @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 Jaro

    (@pixtweaks)

    Hi, thanks for the reply.
    save this code into /wp-content/mu-plugins/trigger-error.php
    Every 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!

    <?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.