bemailr / wp-requirements

Check server and site conditions before activating your WordPress plugin or theme
http://bemailr.github.io/wp-requirements/
GNU General Public License v3.0
7 stars 1 forks source link

Simplified usage #20

Closed tivnet closed 8 years ago

tivnet commented 8 years ago

A static method that receives the same parameters as the constructor, creates the object, does all processing and exits, returning bool of the validation.

slaFFik commented 8 years ago

How is that different from this?

$requirement = new WP_Requirement();
$requirement->valid()

Not sure, why does anyone need a one line WP_Requirement::init()->valid() instead of 2 lines. That just adds 1 more point of failure to the class with no benefit.

tivnet commented 8 years ago

Something like:

if ( ! WP_Requirements::met( __FILE__ ) ) {
    return;
}