public static function initialize() { self::$plugin_options = get_option('ncr_options'); self::$site_key = isset(self::$plugin_options['site_key']) ? self::$plugin_options['site_key'] : ''; self::$secret_key = isset(self::$plugin_options['secrete_key']) ? self::$plugin_options['secrete_key'] : ''; self::$theme = isset(self::$plugin_options['theme']) ? self::$plugin_options['theme'] : 'light'; self::$language = isset(self::$plugin_options['language']) ? self::$plugin_options['language'] : ''; self::$error_message = isset(self::$plugin_options['error_message']) ? self::$plugin_options['error_message'] : wp_kses(__('<strong>ERROR</strong>: Please retry CAPTCHA', 'ncr-catpcha'), array('strong' => array())); self::$script_handle = 'g-recaptcha'; self::$textdomain = 'ncr-captcha'; add_action('plugins_loaded', array(__CLASS__, 'load_plugin_textdomain')); // initialize if login is activated if (isset(self::$plugin_options['captcha_registration']) && self::$plugin_options['captcha_registration'] == 'yes' || isset(self::$plugin_options['captcha_login']) && self::$plugin_options['captcha_login'] == 'yes') { add_action('login_enqueue_scripts', array(__CLASS__, 'header_script')); add_action('login_enqueue_scripts', array(__CLASS__, 'default_wp_login_reg_css')); } // Add the "async" attribute to our registered script. add_filter('script_loader_tag', array(__CLASS__, 'add_async_attribute'), 10, 2); }