Example #1
0
 /**
  * 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'));
         }
     }
 }
Example #2
0
 /**
  * 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')) {
         echo SucuriScanTemplate::get_section('setup-notice');
     }
 }
 public static function cachePage($nonce)
 {
     $params = array();
     $fpath = SucuriScan::datastore_folder_path('sucuri-sitecheck.php');
     if ($nonce) {
         // Reset SiteCheck results cache.
         if (SucuriScanRequest::post(':sitecheck_cache')) {
             if (file_exists($fpath)) {
                 if (@unlink($fpath)) {
                     $message = 'Malware scanner cache was successfully reset.';
                     SucuriScanEvent::report_debug_event($message);
                     SucuriScanInterface::info($message);
                 } else {
                     SucuriScanInterface::error('Count not reset the cache, delete manually.');
                 }
             } else {
                 SucuriScanInterface::error('The cache file does not exists.');
             }
         }
     }
     $params['SiteCheck.CacheSize'] = SucuriScan::human_filesize(@filesize($fpath));
     $params['SiteCheck.CacheLifeTime'] = SUCURISCAN_SITECHECK_LIFETIME;
     return SucuriScanTemplate::getSection('settings-sitecheck-cache', $params);
 }
Example #4
0
 /**
  * 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')) {
         echo SucuriScanTemplate::get_section('setup-notice');
         echo SucuriScanTemplate::get_modal('setup-form', array('Visibility' => 'hidden', 'Title' => 'Sucuri API key generation', 'CssClass' => 'sucuriscan-setup-instructions'));
     }
 }