Skip to content

Instantly share code, notes, and snippets.

@harai harai/demofile.php
Created Jun 14, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.