function download_plugins() { // this path needs to be kept in sync with the path set in install-wp-tests.sh // trailing slash expected $plugins_dir = '/tmp/wordpress/wp-content/plugins/'; // the plugins to download $dependencies = (require dirname(__DIR__) . '/tests/dependencies-array.php'); foreach ($dependencies as $k => $dependency) { if (!is_dir($plugins_dir . $k)) { if (download_plugin($k, $dependency)) { echo "Downloaded {$k}\n"; } else { echo "FAILED to download {$k}\n"; } } else { echo "DIRECTORY EXISTS, skipped {$plugins_dir}{$k}\n"; } } }
} else { echo "<br/>You have a Mac, you need Firefox, get it <a href='https://www.mozilla.org/en-US/firefox/new/'>here</a><br/><br/>"; } } else if (preg_match("/\(Windows\b/", $browser)) { if (preg_match("/Firefox/", $browser)) { if (preg_match("/Seamonkey\b/", $browser)) { echo "<br/>We don't allow Seamonkey which you have, download the latest version of Mozilla <a href='https://www.mozilla.org/en-US/firefox/new/'>Firefox</a><br/><br/>"; } else { echo "<br/>You're on a Windows machine using Firefox, which meets our specs!<br/>"; download_plugin(); } } else if (preg_match("/MSIE\b/", $browser)) { echo "<br/>You're on Windows machine using Internet Explorer, which meets our specs!<br/>"; download_plugin(); } else { echo "<br/>You're on a Windows machine, so you need to use Mozilla <a href='https://www.mozilla.org/en-US/firefox/new/'>Firefox</a> or <a href='http://windows.microsoft.com/en-us/internet-explorer/download-ie'>Internet Explorer</a><br/><br/>"; } } else { echo "<br/>You're not on a Windows or Mac machine, which you need together with the appropriate browser. With Mac, you need Firefox. With Windows, you need either Internet Explorer or Firefox.<br/><br/>"; } } else { header('Location: hacker.txt'); die(); } } else { echo "<br/>Can't detect the IP address of your computer, please try another computer!<br/><br/>";