-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal Error on activation #35
Comments
Was travelling, just seeing this! Thank you for reporting! I am a bit confused on how this happens, because The snippet you suspect is a reason looks unrelated because Is the source code available for me to take a look? |
@Rarst You are correct, I misread that. I've never used plugin_loaded before so no idea. Its a simple plugin so this is the entirity of it:
|
Ah, I get what happens now. This plugin overwrites global That is way too generic name to mess with in global scope and I would strongly advise to change it to something prefixed/unique. I am not sure there is a practical way to prevent this in core, but I will foolproof this a bit on Laps side. |
Lol, so simple, yea I can change that in a few seconds. WTH is the global $plugin var used for that would make any since haha. Seems like bad design on WP cores part lol. If you already tested changing that to another var name and it works I guess you can consider this closed then 💯 |
That said pretty sure I copy/pasted that plugin template from somewhere, so you may see this again for others who used it lol. |
Well, core relies on global vars extensively, that is why best practice for plugins is to prefix the heck out of everything in global scope. I still intend to adjust this in Laps, because otherwise I will just get this explode into someone's face repeatedly, if infrequently... |
@Rarst lol fixed my plugin, appears its more common than we thought. This plugin also does it, modified it on our install and sent an email to them. https://wordpress.org/plugins/smartlook-visitor-screen-recording/ |
In this case the EDD_Clean_Unused_Discounts class init calls which is totally valid.
add_action( 'plugins_loaded', array( $this, 'init' ) );
The text was updated successfully, but these errors were encountered: