Skip to content

Commit

Permalink
fix to wait that all the plugins are loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
glena committed May 14, 2015
1 parent c629ae1 commit 4bb46aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions WP_Auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ public static function init(){
WP_Auth0_ErrorLog::init();
WP_Auth0_Configure_JWTAUTH::init();

self::checkJWTAuth();
add_action('plugins_loaded', array( __CLASS__, 'checkJWTAuth' ));
}

public static function isJWTAuthEnabled() {
if (!function_exists('is_plugin_active')) {
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
return is_plugin_active('wp-jwt-auth/JWT_AUTH.php');
}

Expand All @@ -86,7 +89,7 @@ public static function isJWTConfigured() {

}

protected static function checkJWTAuth() {
public static function checkJWTAuth() {
if ( isset($_REQUEST['page']) && $_REQUEST['page'] == 'wpa0-jwt-auth' ) return;

if( self::isJWTAuthEnabled() && !self::isJWTConfigured() ) {
Expand Down

0 comments on commit 4bb46aa

Please sign in to comment.