Пример #1
0
 /**
  * Check themes.
  */
 protected function check_installed_themes()
 {
     $themes = array_filter(wp_get_themes(), [$this, 'theme_filter']);
     foreach ($themes as $name => $object) {
         $response = $this->client->themes($object->stylesheet);
         $vulnerabilities = $response->vulnerabilities_by_version($object->version);
         if (empty($vulnerabilities)) {
             continue;
         }
         $this->vulnerabilities = array_merge($this->vulnerabilities, $vulnerabilities);
     }
 }
Пример #2
0
 /**
  * Check a theme for vulnerabilities.
  *
  * ## OPTIONS
  *
  * <slug>
  * : The theme slug to check.
  *
  * [<version>]
  * : The theme version to check.
  * ---
  * default: null
  * ---
  *
  * @subcommand check-theme
  *
  * @param array $args Positional args.
  */
 public function check_theme($args)
 {
     $theme = $args[0];
     $version = isset($args[1]) ? $args[1] : null;
     $client = new Client();
     $response = $client->themes($theme);
     $vulnerabilities = $response->vulnerabilities_by_version($version);
     $formatter = new Text();
     $formatter->display_results($vulnerabilities);
 }