private function makeSureThereAreNoMissingRequirements($metadata)
 {
     $requires = (array) $metadata->require;
     $dependency = new PluginDependency();
     $missingDependencies = $dependency->getMissingDependencies($requires);
     if (!empty($missingDependencies)) {
         $message = '';
         foreach ($missingDependencies as $dep) {
             $params = array(ucfirst($dep['requirement']), $dep['actualVersion'], $dep['requiredVersion']);
             $message .= Piwik::translate('CorePluginsAdmin_MissingRequirementsNotice', $params);
         }
         throw new PluginInstallerException($message);
     }
 }
 /**
  * @param $plugin
  */
 private function addMissingRequirements($plugin)
 {
     $plugin['missingRequirements'] = array();
     if (empty($plugin['versions']) || !is_array($plugin['versions'])) {
         return $plugin;
     }
     $latestVersion = $plugin['versions'][count($plugin['versions']) - 1];
     if (empty($latestVersion['requires'])) {
         return $plugin;
     }
     $requires = $latestVersion['requires'];
     $dependency = new PluginDependency();
     $plugin['missingRequirements'] = $dependency->getMissingDependencies($requires);
     return $plugin;
 }