/** * Make this class a singleton * * Use this instead of __construct() * * @param string $plugin_file_path * @param string $version * * @return WP_Scanner */ public static function get_instance($plugin_file_path, $version) { if (!isset(self::$instance) && !self::$instance instanceof WP_Scanner) { self::$instance = new WP_Scanner(); // Initialize the class self::$instance->init($plugin_file_path, $version); } return self::$instance; }
/** * Admin notices */ public function admin_notices() { if ($this->wp_scanner->settings->is_secret_set()) { return; } if (!current_user_can('manage_options')) { return; } $screen = get_current_screen(); if ($screen->id === 'settings_page_wp-scanner') { return; } $link = sprintf('<a href="%s">%s</a>', admin_url('options-general.php?page=wp-scanner'), __('API keys', 'wp-scanner')); $message = sprintf(__('Enter your %s to get started.', 'wp-scanner'), $link); $this->wp_scanner->render_view('notice', compact('message')); }
/** * WP Scanner * * @return WP_Scanner */ function wp_scanner() { require_once dirname(__FILE__) . '/classes/class-wp-scanner.php'; $version = '1.0.2'; return WP_Scanner::get_instance(__FILE__, $version); }
/** * Render status field */ public function render_status_field() { $this->wp_scanner->render_view('status-field'); }