Closed jerclarke closed 11 years ago
@jeremyclarke I just tested it out by adding some deprecated functions to a plugin and it is blocking deprecated notices! It should handle warning and notices, but fatal errors will fatal (which is a good thing).
I TOTALLY agree about harassing devs and even helping by patching yourself; however, in the middle of some projects with some situations, it just cannot be done and you need to hide the error messages so that you can view your own errors. I had A LOT of inspiration for this, if you know what I mean.
I am closing this as I believe the "feature" is already built into it. If you see any issues, let me know.
Oh man, sorry about that! I think the issue I was having is covered in this part of the readme:
Note that the filter must be added before any offending code is run in order to redefine the error reporting function before it is first called. The means that in most cases, this code will need to run from a plugin and not a theme.
In my case I was running both Ostrichize and my hooks for it from mu-plugins, which seems like it should work, but the plugin was running the deprecated code completely unhooked (right in the php file). Am I right in thinking that such situations are just not handleable by Ostrichize? If so that's a real bummer, since plugins that cause notices and plugins that stupidly run code outside a hook are often written by the same devs ;)
Maybe add a note in the readme that some errors just can't be hidden by Ostrichize, no matter when you register your hooks?
Not hiding MU plugin notices is a bug. I actually did not test this before hastily releasing it. This line should handle it but clearly is not: https://github.com/tollmanz/ostrichcize/blob/master/ostrichcize.php#L87.
I am starting a new issue for this and will comment further there.
I haven't tested this extensively but as far as I can tell this plugin won't hide deprecated function/usage notices generated by the ostrichized plugins. To me blocking these as well as warnings/notices would make sense, as they are related (both are caused by plugin devs not keeping WP_DEBUG active).
Not sure if it's possible or easy, but figured it was worth a feature report :)
Thanks for building this plugin. While I'm a firm believer in harassing plugin developers to fix WP_DEBUG messages, it's nice to also have a silencer for those old plugins that still work but make too much noise.