Skip to content

Instantly share code, notes, and snippets.

@harai
Created June 14, 2019 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harai/ba9e42f538c6b7ce55bac24493449c66 to your computer and use it in GitHub Desktop.
Save harai/ba9e42f538c6b7ce55bac24493449c66 to your computer and use it in GitHub Desktop.
demofile
<?php
$url = 'https://downloads.wordpress.org/plugin/woocommerce.3.6.4.zip';
$tmpname = tempnam("/tmp", "kawarimi");
file_put_contents($tmpname, fopen($url, 'r'));
$zip = new ZipArchive;
$res = $zip->open($tmpname);
$zip->extractTo('./wp-content/plugins');
$zip->close();
exec('wp plugin activate woocommerce');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment