-
-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'install-zipfile' into develop
Fixes #713 Fixes #712 Related cedaro/satispress#76
- Loading branch information
Showing
8 changed files
with
114 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
* Plugin Name: GitHub Updater | ||
* Plugin URI: https://github.com/afragen/github-updater | ||
* Description: A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs. It also allows for remote installation of plugins or themes into WordPress. | ||
* Version: 8.2.1.9 | ||
* Version: 8.2.1.10 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
afragen
Author
Owner
|
||
* Author: Andy Fragen | ||
* License: GNU General Public License v2 | ||
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
/** | ||
* GitHub Updater | ||
* | ||
* @author Andy Fragen | ||
* @license GPL-2.0+ | ||
* @link https://github.com/afragen/github-updater | ||
* @package github-updater | ||
*/ | ||
|
||
namespace Fragen\GitHub_Updater\API; | ||
|
||
/* | ||
* Exit if called directly. | ||
*/ | ||
if ( ! defined( 'WPINC' ) ) { | ||
die; | ||
} | ||
|
||
/** | ||
* Class Zipfile_API | ||
* | ||
* Remote install from a Zipfile. | ||
* | ||
* @author Andy Fragen | ||
*/ | ||
class Zipfile_API { | ||
|
||
/** | ||
* Add remote install settings fields. | ||
* | ||
* @param $type | ||
*/ | ||
public function add_install_settings_fields( $type ) { | ||
add_settings_field( | ||
'zipfile_slug', | ||
esc_html__( 'Zipfile Slug', 'github-updater' ), | ||
[ $this, 'zipfile_slug' ], | ||
'github_updater_install_' . $type, | ||
$type | ||
); | ||
} | ||
|
||
/** | ||
* Set repo slug for remote install. | ||
*/ | ||
public function zipfile_slug() { | ||
?> | ||
<label for="zipfile_slug"> | ||
<input class="zipfile_setting" type="text" style="width:50%;" name="zipfile_slug" value="" placeholder="my-repo-slug"> | ||
<br> | ||
<span class="description"> | ||
<?php esc_html_e( 'Enter plugin or theme slug.', 'github-updater' ); ?> | ||
</span> | ||
</label> | ||
<?php | ||
} | ||
|
||
/** | ||
* Add remote install feature, create endpoint. | ||
* | ||
* @param $headers | ||
* @param $install | ||
* | ||
* @return mixed $install | ||
*/ | ||
public function remote_install( $headers, $install ) { | ||
$install['download_link'] = ! empty( $headers['uri'] ) ? $headers['uri'] : $headers['original']; | ||
$install['github_updater_install_repo'] = $install['zipfile_slug']; | ||
|
||
return $install; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This seems like a new feature, and yet it only has a smaller-than-minor version bump?