Publishing your plugin for hundreds of viewers with Alchemy and Elixir is as easy as a
few quick clicks. To start, choose the plugin (of your own of course) you would like to
publish
Error: You must activate plugins that you would like to publish';
} else {
echo '
Please go back and fix these errors.';
else
echo 'Success, and remind me to place a nicer fully detailed message here';
} else {
echo '
Publish a Plugin - Step ' . (int)$_GET['step'] . '
';
if($_GET['step'] == 2) {
echo 'Alchemy has automatically detected some information about your plugin. Please check that the information below is accurate. If it is incorrect, please update the plugin file and refresh this page. Click next to continue.';
echo '';
}
if($_GET['step'] == 3) {
echo '
Alchemy now needs some information on what to display when browsing plugins our site. You may update this later through the Manage Plugins admin page
';
}
if($_GET['step'] == 4) {
$plugin = alky_get_data('plugin', ABSPATH . 'wp-content/plugins/' .$_GET['plugin']);
if(strpos($_GET['plugin'], '/') !== FALSE) {
$directory = dirname(ABSPATH . 'wp-content/plugins/' . $_GET['plugin']);
$files = alky_scandir_deep($directory);
foreach($files as $file) {
if(is_file($file))
$filearr[str_replace(ABSPATH . 'wp-content/plugins/', '', $file)] = base64_encode(file_get_contents($file));
}
}
else {
$filearr[$_GET['plugin']] = base64_encode(file_get_contents(ABSPATH . 'wp-content/plugins/' . $_GET['plugin']));
}
$filearr = serialize($filearr);
$alkyout = array();
$alkyout['apikey'] = alky_get_option('apikey');
$alkyout['type'] = 'plugin';
$alkyout['name'] = $plugin['Name'];
$alkyout['slug'] = sanitize_title_with_dashes($plugin['Name']);
$alkyout['author'] = $plugin['Author'];
$alkyout['uri'] = $plugin['Plugin URI'];
$alkyout['authoruri'] = $plugin['Author URI'];
$alkyout['version'] = $plugin['Version'];
$alkyout['checksum'] = md5($filearr);
$alkyout['desc_short'] = $plugin['Description'];
$alkyout['desc_long'] = wp_filter_post_kses(stripslashes($_POST['content']));
$alkyout['filesize'] = strlen($filearr);
$alkyout['ipaddress'] = $_SERVER['REMOTE_ADDR'];
$alkyout['time'] = time();
$alkyout['file'] = str_replace(ABSPATH . 'wp-content/plugins/', '', $_GET['plugin']);
$xml = new MiniXMLDoc();
$xml->fromArray($alkyout);
$alkyxmlout = $xml->toString();
file_put_contents(ABSPATH . 'wp-content/alchemy/' . sanitize_title_with_dashes($plugin['Name']) . '-files.txt', $filearr);
file_put_contents(ABSPATH . 'wp-content/alchemy/' . sanitize_title_with_dashes($plugin['Name']) . '-metadata.txt', $alkyxmlout);
echo 'You\'re almost finished! Just verify the information below and hit next. If the information is incorrect,
you can go back and make whatever changes you need.
';
}
}
?>