/**
  * Validates submitted setting values before they get saved to the database.
  *
  * @since    1.0
  * @param array $settings
  * @return array
  */
 public function sanitize($settings)
 {
     $new_settings = null;
     if (isset($settings['referrer_spam_list']) && $settings['referrer_spam_list'] != '') {
         $list = $settings['referrer_spam_list'];
         if (!is_array($list)) {
             $list = array_unique(array_map('trim', preg_split("/[\n,]+/", str_replace("\r", "", $list))));
         }
         $new_settings = array('referrer_spam_list' => $list);
     }
     self::$settings = $new_settings;
     WPBRS_Controller_Blocker::filter_referrers_htaccess();
     return $new_settings;
 }
 /**
  * Constructor
  *
  * @since    1.0
  */
 protected function __construct()
 {
     self::$hook_suffix = 'tools_page_' . WP_Block_Referrer_Spam::PLUGIN_ID;
     $this->register_hook_callbacks();
     $this->model = WPBRS_Model_Settings::get_instance();
 }
 /**
  * Fired when user uninstalls the plugin, called in unisntall.php file
  *
  * @since    1.0
  */
 public static function uninstall_plugin()
 {
     require_once dirname(plugin_dir_path(__FILE__)) . '/includes/class-wp-block-referrer-spam.php';
     require_once dirname(plugin_dir_path(__FILE__)) . '/models/wpbrs-model.php';
     require_once dirname(plugin_dir_path(__FILE__)) . '/models/wpbrs-model-settings.php';
     WPBRS_Model_Settings::delete_settings();
 }
 /**
  * Constructor
  *
  * @since    1.0
  */
 protected function __construct()
 {
     $this->register_hook_callbacks();
     $this->model = WPBRS_Model_Settings::get_instance();
 }