Skip to content

Commit

Permalink
Merge pull request #7 from Ed-ITSolutions/0.1.5
Browse files Browse the repository at this point in the history
WIP 0.1.5
  • Loading branch information
Arcath authored Jul 17, 2018
2 parents e424fd5 + 070b531 commit ec7c430
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions lib/class.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public function viewPackagePage(){
public function newRelease(){
global $wpdb;

$this->log('New release attempted.');

$package = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}wup_packages WHERE `deployKey` = '{$_POST['deployKey']}'", 'ARRAY_A');

if(!isset($package)){
Expand Down Expand Up @@ -256,6 +258,17 @@ public function newRelease(){

$meta = WshWordPressPackageParser::parsePackage($_FILES['release']['tmp_name'], true);

$version = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}wup_versions WHERE `packageId` = '{$package['id']}' AND `version` = '{$meta['header']['Version']}' ORDER BY `id` DESC LIMIT 1", 'ARRAY_A');
if(isset($version)){
$this->log('Version ' . $meta['header']['Version'] . ' already exists');

echo(json_encode(array(
'error' => 'Version ' . $meta['header']['Version'] . ' already exists'
)));

return;
}

move_uploaded_file(
$_FILES['release']['tmp_name'],
wp_upload_dir()['basedir'] . '/wup-releases/' . $package['slug'] . '/' . $meta['header']['Version'] . '.zip'
Expand Down
2 changes: 1 addition & 1 deletion lib/tables/domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function prepare_items(){

//$this->process_bulk_action();

$per_page = $this->get_items_per_page('packages_per_page', 5);
$per_page = $this->get_items_per_page('packages_per_page', 20);
$current_page = $this->get_pagenum();
$total_items = self::record_count($this->packageId);

Expand Down
2 changes: 1 addition & 1 deletion lib/tables/packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function prepare_items() {

//$this->process_bulk_action();

$per_page = $this->get_items_per_page('packages_per_page', 5);
$per_page = $this->get_items_per_page('packages_per_page', 30);
$current_page = $this->get_pagenum();
$total_items = self::record_count();

Expand Down
2 changes: 1 addition & 1 deletion wp-update-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: WP Update Provider
* Description: Provides an update server for WordPress plugins & themes, and manages sites that are updating.
* Version: 0.1.4
* Version: 0.1.5
* Author: Ed-IT Solutions
* Author URI: http://www.ed-itsolutions.com
* Image: https://raw.githubusercontent.com/Ed-ITSolutions/wp-update-provider/master/docs/logo.png
Expand Down

0 comments on commit ec7c430

Please sign in to comment.