Closed afragen closed 9 years ago
Not sure if https://github.com/afragen/wp-update-php/commit/9c96b509e38456aa94e549cc66cfde07423ba276 is how you want to explain how to use this but it seems to be simpler to exit if conditional is false than wrap entire plugin instantiation code in this conditional. This would work in all cases.
@coenjacobs did I do too much here?
Yes. :smile: Please make separate pull requests for each of these issues. You can do so by committing them on a separate branch and file a pull request for each of them.
Just going through your changes one by one:
set
method for something like this.Anyway, I really appreciate your contributions and I hope you understand why I'm closing this pull request now. I'm only accepting 2. at this point as I explained above.
Final note: I left out the require_once
call in the README change (cherry-picked commit) as that will be different for each setup as well. I might invest some time in explaining the differences, but at this point the README assumes that the library is loaded via Composer at which point you can utilise the autoloader. I'm not saying that this is the holy grail, but I'd like to at least keep the little documentation we currently have in one line.
I'll start over and make much smaller PRs, but injecting __FILE__
in some method is likely the easiest way to cleanly grab the name of the plugin, unless you want to pass the name directly.
Many will likely want to use this class as I do, to inform users that a particular plugin requires a version of PHP that they do not have and therefore the plugin will not be loaded. It is then necessary that the user know which plugin(s) are throwing this warning.
in some method is likely the easiest way to cleanly grab the name of the plugin, unless you want to pass the name directly.
I'm not opposed to that. I think we only need the name really.
It does simplify the coding and decrease the overhead a small amount. I was originally going for more universality.
Do you want a whole new method for injecting this? I could hook that into the does_it_meet_required_version
?
plugin name and automatically add plugin name to notice.