/** * Display a notice message with instructions to continue the setup of the * plugin, this includes the generation of the API key and other steps that need * to be done to fully activate this plugin. * * @return void */ public static function setup_notice() { if (current_user_can('manage_options') && SucuriScan::no_notices_here() === false && !SucuriScanAPI::get_plugin_key() && SucuriScanRequest::post(':plugin_api_key') === false && SucuriScanRequest::post(':recover_key') === false && !SucuriScanRequest::post(':manual_api_key')) { if (SucuriScanRequest::get(':dismiss_setup') !== false) { SucuriScanOption::update_option(':dismiss_setup', 'enabled'); } elseif (SucuriScanOption::is_enabled(':dismiss_setup')) { /* Do not display API key generation form. */ } else { echo SucuriScanTemplate::get_section('setup-notice'); echo SucuriScanTemplate::get_modal('setup-form', array('Visibility' => 'hidden', 'Title' => 'Sucuri API key generation', 'CssClass' => 'sucuriscan-setup-instructions')); } } }
/** * Check whether a user has the permissions to see a page from the plugin. * * @return void */ public static function check_permissions() { if (!function_exists('current_user_can') || !current_user_can('manage_options')) { $page = SucuriScanRequest::get('page', '_page'); wp_die(__('Access denied by <b>Sucuri</b> to see <code>' . $page . '</code>')); } }