littlebizzy / slickstack

Lightning-fast WordPress on Nginx
https://slickstack.io
GNU General Public License v3.0
638 stars 112 forks source link

"Undefined variable" errors from mu-plugins (uninitialized variable) #59

Closed Bronislawsky closed 2 years ago

Bronislawsky commented 4 years ago
No big deal, I could have opened an issue on all mu-plugins concerned but I didn't feet it was necessary 

in several mu-plugins, 
in /helpers/updater.php    public function httpRequestArgs($args, $url)

when it reaches

// Modifications
 if ($modified)

in some cases it hasn't been set to true, so I guess just $modified = false at the beginning of the function would do
I just mention it because it feels up my PHP error log widget

Thanks
corzel commented 4 years ago

Hi,

This is very annoying, especially when I'm fixing something and enable wp_debug_display, I have to search inside all that code to find the error I need to fix. I used the your solution ($modified = false) and works fine, but it´s gone with every update.

In my case a see this: Notice: Undefined variable: modified in /var/www/html/wp-content/mu-plugins/clear-caches/helpers/updater.php on line 136 Notice: Undefined variable: modified in /var/www/html/wp-content/mu-plugins/dashboard-cleanup/helpers/updater.php on line 136 Notice: Undefined variable: modified in /var/www/html/wp-content/mu-plugins/disable-gutenberg/helpers/updater.php on line 136 Notice: Undefined variable: modified in /var/www/html/wp-content/mu-plugins/force-https/helpers/updater.php on line 136 Notice: Undefined variable: modified in /var/www/html/wp-content/mu-plugins/maintenance-mode/helpers/updater.php on line 136 Regards.

jessuppi commented 2 years ago

Thanks @backamblock for your patches to those plugins!

Also we discovered from Discord chats that apparently WP_DEBUG was enabled in production via wp-config.php bug which was causing so many annoying low-level notices and warnings in the error log... oops!

Anyway that is now fixed up and hardcoded.

P.S. some of our MU plugins will hopefully be updated soon with simpler code and/or removed from SlickStack.