Version Description
Download this release
Release Info
| Developer | willmot |
| Plugin | |
| Version | 2.0.1 |
| Comparing to | |
| See all releases | |
Code changes from version 2.0 to 2.0.1
- plugin.php +0 -120
- readme.txt +1 -1
- wpr.admin.php +0 -56
- wpr.api.php +0 -305
- wprp.plugin.php +1 -1
plugin.php
DELETED
|
@@ -1,120 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/*
|
| 4 |
-
Plugin Name: WP Remote
|
| 5 |
-
Description: Extends the functionality of <a href="http://www.wpremote.com">WP Remote</a>.
|
| 6 |
-
Version: 2.0 Bleeding
|
| 7 |
-
Author: Human Made Limited
|
| 8 |
-
Author URI: http://hmn.md/
|
| 9 |
-
*/
|
| 10 |
-
|
| 11 |
-
/* Copyright 2011 Human Made Limited (email : hello@humanmade.co.uk)
|
| 12 |
-
|
| 13 |
-
This program is free software; you can redistribute it and/or modify
|
| 14 |
-
it under the terms of the GNU General Public License as published by
|
| 15 |
-
the Free Software Foundation; either version 2 of the License, or
|
| 16 |
-
(at your option) any later version.
|
| 17 |
-
|
| 18 |
-
This program is distributed in the hope that it will be useful,
|
| 19 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 20 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 21 |
-
GNU General Public License for more details.
|
| 22 |
-
|
| 23 |
-
You should have received a copy of the GNU General Public License
|
| 24 |
-
along with this program; if not, write to the Free Software
|
| 25 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| 26 |
-
*/
|
| 27 |
-
|
| 28 |
-
define( 'WPR_PLUGIN_SLUG', 'wpremote' );
|
| 29 |
-
define( 'WPR_PLUGIN_PATH', WP_PLUGIN_DIR . '/' . WPR_PLUGIN_SLUG );
|
| 30 |
-
define( 'WPR_PLUGIN_URL', WP_PLUGIN_URL . '/' . WPR_PLUGIN_SLUG );
|
| 31 |
-
|
| 32 |
-
// Load the admin
|
| 33 |
-
require_once( WPR_PLUGIN_PATH . '/wpr.admin.php' );
|
| 34 |
-
|
| 35 |
-
// Don't include when doing a core update
|
| 36 |
-
if ( empty( $_GET['action'] ) || $_GET['action'] != 'do-core-upgrade' ) :
|
| 37 |
-
|
| 38 |
-
require_once ( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
| 39 |
-
|
| 40 |
-
class WPR_Plugin_Upgrader_Skin extends Plugin_Installer_Skin {
|
| 41 |
-
|
| 42 |
-
var $feedback;
|
| 43 |
-
var $error;
|
| 44 |
-
|
| 45 |
-
function error( $error ) {
|
| 46 |
-
$this->error = $error;
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
function feedback( $feedback ) {
|
| 50 |
-
$this->feedback = $feedback;
|
| 51 |
-
}
|
| 52 |
-
|
| 53 |
-
function before() {
|
| 54 |
-
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
-
function after() {
|
| 58 |
-
|
| 59 |
-
}
|
| 60 |
-
|
| 61 |
-
function header() {
|
| 62 |
-
|
| 63 |
-
}
|
| 64 |
-
|
| 65 |
-
function footer() {
|
| 66 |
-
|
| 67 |
-
}
|
| 68 |
-
|
| 69 |
-
}
|
| 70 |
-
|
| 71 |
-
class WPR_Theme_Upgrader_Skin extends Theme_Installer_Skin {
|
| 72 |
-
|
| 73 |
-
var $feedback;
|
| 74 |
-
var $error;
|
| 75 |
-
|
| 76 |
-
function error( $error ) {
|
| 77 |
-
$this->error = $error;
|
| 78 |
-
}
|
| 79 |
-
|
| 80 |
-
function feedback( $feedback ) {
|
| 81 |
-
$this->feedback = $feedback;
|
| 82 |
-
}
|
| 83 |
-
|
| 84 |
-
function before() {
|
| 85 |
-
|
| 86 |
-
}
|
| 87 |
-
|
| 88 |
-
function after() {
|
| 89 |
-
|
| 90 |
-
}
|
| 91 |
-
|
| 92 |
-
function header() {
|
| 93 |
-
|
| 94 |
-
}
|
| 95 |
-
|
| 96 |
-
function footer() {
|
| 97 |
-
|
| 98 |
-
}
|
| 99 |
-
|
| 100 |
-
}
|
| 101 |
-
|
| 102 |
-
endif;
|
| 103 |
-
|
| 104 |
-
/**
|
| 105 |
-
* Catch the API calls and load the API
|
| 106 |
-
*
|
| 107 |
-
* @access public
|
| 108 |
-
* @return null
|
| 109 |
-
*/
|
| 110 |
-
function wpr_catch_api_call() {
|
| 111 |
-
|
| 112 |
-
if ( empty( $_GET['wpr_api_key'] ) || ! urldecode( $_GET['wpr_api_key'] ) || ! isset( $_GET['actions'] ) )
|
| 113 |
-
return;
|
| 114 |
-
|
| 115 |
-
require_once( WPR_PLUGIN_PATH . '/wpr.api.php' );
|
| 116 |
-
|
| 117 |
-
exit;
|
| 118 |
-
|
| 119 |
-
}
|
| 120 |
-
add_action( 'init', 'wpr_catch_api_call', 1 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
|
@@ -3,7 +3,7 @@ Contributors: humanmade, joehoyle, mattheu, tcrsavage, willmot
|
|
| 3 |
Tags: wpremote, remote administration, multiple wordpress
|
| 4 |
Requires at least: 3.1
|
| 5 |
Tested up to: 3.3.1
|
| 6 |
-
Stable tag: 2.0
|
| 7 |
|
| 8 |
WP Remote is a free web app that enables you to easily manage all of your WordPress powered sites from one place.
|
| 9 |
|
| 3 |
Tags: wpremote, remote administration, multiple wordpress
|
| 4 |
Requires at least: 3.1
|
| 5 |
Tested up to: 3.3.1
|
| 6 |
+
Stable tag: 2.0.1
|
| 7 |
|
| 8 |
WP Remote is a free web app that enables you to easily manage all of your WordPress powered sites from one place.
|
| 9 |
|
wpr.admin.php
DELETED
|
@@ -1,56 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
// @todo this should all be better
|
| 4 |
-
|
| 5 |
-
function wpr_setup_admin() {
|
| 6 |
-
|
| 7 |
-
//register the options page
|
| 8 |
-
wpr_register_settings();
|
| 9 |
-
add_options_page('WP Remote Settings', 'WP Remote', 'manage_options', 'wp-remote-options', 'wpr_options_page');
|
| 10 |
-
|
| 11 |
-
}
|
| 12 |
-
add_action('admin_menu', 'wpr_setup_admin');
|
| 13 |
-
|
| 14 |
-
function wpr_register_settings() {
|
| 15 |
-
|
| 16 |
-
register_setting( 'wpr-settings', 'wpr_api_key' );
|
| 17 |
-
}
|
| 18 |
-
|
| 19 |
-
function wpr_options_page() {
|
| 20 |
-
|
| 21 |
-
?>
|
| 22 |
-
|
| 23 |
-
<div class="wrap">
|
| 24 |
-
<h2>WP Remote Settings</h2>
|
| 25 |
-
|
| 26 |
-
<form method="post" action="options.php">
|
| 27 |
-
<table class="form-table">
|
| 28 |
-
|
| 29 |
-
<tr valign="top">
|
| 30 |
-
<th scope="row"><strong>API Key</strong></th>
|
| 31 |
-
<td>
|
| 32 |
-
<input type="text" name="wpr_api_key" class="regular-text" value="<?php echo get_option('wpr_api_key', ''); ?>" /><br />
|
| 33 |
-
<span class="description">If you don't want to use XML-RPC authentication, you can enter your WP Remote API Key</span>
|
| 34 |
-
</td>
|
| 35 |
-
</tr>
|
| 36 |
-
|
| 37 |
-
</table>
|
| 38 |
-
|
| 39 |
-
<input type="hidden" name="action" value="update" />
|
| 40 |
-
|
| 41 |
-
<p class="submit">
|
| 42 |
-
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
| 43 |
-
</p>
|
| 44 |
-
|
| 45 |
-
<?php
|
| 46 |
-
settings_fields( 'wpr-settings' );
|
| 47 |
-
|
| 48 |
-
// Output any sections defined for page sl-settings
|
| 49 |
-
do_settings_sections('wpr-settings');
|
| 50 |
-
?>
|
| 51 |
-
</form>
|
| 52 |
-
|
| 53 |
-
</div>
|
| 54 |
-
<?php
|
| 55 |
-
|
| 56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wpr.api.php
DELETED
|
@@ -1,305 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
// Check the API Key
|
| 4 |
-
if( ! isset( $_GET['wpr_api_key'] ) || urldecode( $_GET['wpr_api_key'] ) !== get_option( 'wpr_api_key' ) || ! isset( $_GET['actions'] ) ) {
|
| 5 |
-
echo json_encode( 'bad-api-key' );
|
| 6 |
-
exit;
|
| 7 |
-
}
|
| 8 |
-
|
| 9 |
-
$actions = explode( ',', $_GET['actions'] );
|
| 10 |
-
$actions = array_flip( $actions );
|
| 11 |
-
|
| 12 |
-
// log in as admin
|
| 13 |
-
wp_set_current_user( 1 );
|
| 14 |
-
|
| 15 |
-
foreach( $actions as $action => $value ) {
|
| 16 |
-
|
| 17 |
-
switch( $action ) {
|
| 18 |
-
|
| 19 |
-
// TODO should be dynamic
|
| 20 |
-
case 'get_plugin_version' :
|
| 21 |
-
|
| 22 |
-
$actions[$action] = '1.1';
|
| 23 |
-
|
| 24 |
-
break;
|
| 25 |
-
|
| 26 |
-
case 'get_wp_version' :
|
| 27 |
-
|
| 28 |
-
global $wp_version;
|
| 29 |
-
|
| 30 |
-
$actions[$action] = (string) $wp_version;
|
| 31 |
-
|
| 32 |
-
break;
|
| 33 |
-
|
| 34 |
-
case 'get_plugins' :
|
| 35 |
-
|
| 36 |
-
$actions[$action] = _wpr_supports_plugin_upgrade() ? _wpr_get_plugins() : 'not-implemented';
|
| 37 |
-
|
| 38 |
-
break;
|
| 39 |
-
|
| 40 |
-
case 'upgrade_plugin' :
|
| 41 |
-
|
| 42 |
-
$actions[$action] = _wpr_upgrade_plugin( (string) $_GET['plugin'] );
|
| 43 |
-
|
| 44 |
-
break;
|
| 45 |
-
|
| 46 |
-
case 'get_themes' :
|
| 47 |
-
|
| 48 |
-
$actions[$action] = _wpr_supports_theme_upgrade() ? _wpr_get_themes() : 'not-implemented';
|
| 49 |
-
|
| 50 |
-
break;
|
| 51 |
-
|
| 52 |
-
case 'upgrade_theme' :
|
| 53 |
-
|
| 54 |
-
$actions[$action] = _wpr_upgrade_theme( (string) $_GET['theme'] );
|
| 55 |
-
|
| 56 |
-
break;
|
| 57 |
-
|
| 58 |
-
default :
|
| 59 |
-
|
| 60 |
-
$actions[$action] = 'not-implemented';
|
| 61 |
-
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
-
}
|
| 65 |
-
|
| 66 |
-
echo json_encode( $actions );
|
| 67 |
-
exit;
|
| 68 |
-
|
| 69 |
-
/**
|
| 70 |
-
* Return an array of installed plugins
|
| 71 |
-
*
|
| 72 |
-
* @return array
|
| 73 |
-
*/
|
| 74 |
-
function _wpr_get_plugins() {
|
| 75 |
-
|
| 76 |
-
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
| 77 |
-
|
| 78 |
-
// Get all plugins
|
| 79 |
-
$plugins = get_plugins();
|
| 80 |
-
|
| 81 |
-
// Get the list of active plugins
|
| 82 |
-
$active = get_option( 'active_plugins', array() );
|
| 83 |
-
|
| 84 |
-
// Force a plugin update check
|
| 85 |
-
wp_update_plugins();
|
| 86 |
-
|
| 87 |
-
// Different versions of wp store the updates in different places
|
| 88 |
-
// TODO can we depreciate
|
| 89 |
-
if( function_exists( 'get_site_transient' ) && $transient = get_site_transient( 'update_plugins' ) )
|
| 90 |
-
$current = $transient;
|
| 91 |
-
|
| 92 |
-
elseif( $transient = get_transient( 'update_plugins' ) )
|
| 93 |
-
$current = $transient;
|
| 94 |
-
|
| 95 |
-
else
|
| 96 |
-
$current = get_option( 'update_plugins' );
|
| 97 |
-
|
| 98 |
-
foreach ( (array) $plugins as $plugin_file => $plugin ) {
|
| 99 |
-
|
| 100 |
-
$new_version = isset( $current->response[$plugin_file] ) ? $current->response[$plugin_file]->new_version : null;
|
| 101 |
-
|
| 102 |
-
if ( is_plugin_active( $plugin_file ) )
|
| 103 |
-
$plugins[$plugin_file]['active'] = true;
|
| 104 |
-
|
| 105 |
-
else
|
| 106 |
-
$plugins[$plugin_file]['active'] = false;
|
| 107 |
-
|
| 108 |
-
if ( $new_version ) {
|
| 109 |
-
$plugins[$plugin_file]['latest_version'] = $new_version;
|
| 110 |
-
$plugins[$plugin_file]['latest_package'] = $current->response[$plugin_file]->package;
|
| 111 |
-
$plugins[$plugin_file]['slug'] = $current->response[$plugin_file]->slug;
|
| 112 |
-
|
| 113 |
-
} else {
|
| 114 |
-
$plugins[$plugin_file]['latest_version'] = $plugin['Version'];
|
| 115 |
-
|
| 116 |
-
}
|
| 117 |
-
|
| 118 |
-
}
|
| 119 |
-
|
| 120 |
-
// TODO is this necessary?
|
| 121 |
-
global $wp_version;
|
| 122 |
-
$plugins_args = (object) compact( 'plugins' );
|
| 123 |
-
|
| 124 |
-
return $plugins;
|
| 125 |
-
}
|
| 126 |
-
|
| 127 |
-
/**
|
| 128 |
-
* Update a plugin
|
| 129 |
-
*
|
| 130 |
-
* @access private
|
| 131 |
-
* @param mixed $plugin
|
| 132 |
-
* @return array
|
| 133 |
-
*/
|
| 134 |
-
function _wpr_upgrade_plugin( $plugin ) {
|
| 135 |
-
|
| 136 |
-
include_once ( ABSPATH . 'wp-admin/includes/admin.php' );
|
| 137 |
-
|
| 138 |
-
if ( ! _wpr_supports_plugin_upgrade() )
|
| 139 |
-
return array( 'status' => 'error', 'error' => 'WordPress version too old for plugin upgrades' );
|
| 140 |
-
|
| 141 |
-
$skin = new WPR_Plugin_Upgrader_Skin();
|
| 142 |
-
$upgrader = new Plugin_Upgrader( $skin );
|
| 143 |
-
$is_active = is_plugin_active( $plugin );
|
| 144 |
-
|
| 145 |
-
// Do the upgrade
|
| 146 |
-
ob_start();
|
| 147 |
-
$result = $upgrader->upgrade( $plugin );
|
| 148 |
-
$data = ob_get_contents();
|
| 149 |
-
ob_clean();
|
| 150 |
-
|
| 151 |
-
if ( ( ! $result && ! is_null( $result ) ) || $data )
|
| 152 |
-
return array( 'status' => 'error', 'error' => 'file_permissions_error' );
|
| 153 |
-
|
| 154 |
-
elseif ( is_wp_error( $result ) )
|
| 155 |
-
return array( 'status' => 'error', 'error' => $result->get_error_code() );
|
| 156 |
-
|
| 157 |
-
if ( $skin->error )
|
| 158 |
-
return array( 'status' => 'error', 'error' => $skin->error );
|
| 159 |
-
|
| 160 |
-
// If the plugin was activited, we have to re-activate it
|
| 161 |
-
// @todo Shouldn't this use activate_plugin?
|
| 162 |
-
if ( $is_active ) {
|
| 163 |
-
$current = get_option( 'active_plugins', array() );
|
| 164 |
-
$current[] = plugin_basename( trim( $plugin ) );;
|
| 165 |
-
sort( $current );
|
| 166 |
-
update_option('active_plugins', $current );
|
| 167 |
-
}
|
| 168 |
-
|
| 169 |
-
return array( 'status' => 'success' );
|
| 170 |
-
|
| 171 |
-
}
|
| 172 |
-
|
| 173 |
-
/**
|
| 174 |
-
* Check if the site can support plugin upgrades
|
| 175 |
-
*
|
| 176 |
-
* @todo should probably check if we have direct filesystem access
|
| 177 |
-
* @todo can we remove support for versions which don't support Plugin_Upgrader
|
| 178 |
-
* @return bool
|
| 179 |
-
*/
|
| 180 |
-
function _wpr_supports_plugin_upgrade() {
|
| 181 |
-
|
| 182 |
-
include_once ( ABSPATH . 'wp-admin/includes/admin.php' );
|
| 183 |
-
|
| 184 |
-
return class_exists( 'Plugin_Upgrader' );
|
| 185 |
-
|
| 186 |
-
}
|
| 187 |
-
|
| 188 |
-
/**
|
| 189 |
-
* Return an array of installed themes
|
| 190 |
-
*
|
| 191 |
-
* @return array
|
| 192 |
-
*/
|
| 193 |
-
function _wpr_get_themes() {
|
| 194 |
-
|
| 195 |
-
require_once( ABSPATH . '/wp-admin/includes/theme.php' );
|
| 196 |
-
|
| 197 |
-
// Get all themes
|
| 198 |
-
$themes = get_themes();
|
| 199 |
-
|
| 200 |
-
// Get the list of active themes
|
| 201 |
-
$active = get_option( 'active_themes', array() );
|
| 202 |
-
|
| 203 |
-
// Force a theme update check
|
| 204 |
-
wp_update_themes();
|
| 205 |
-
|
| 206 |
-
// Different versions of wp store the updates in different places
|
| 207 |
-
// TODO can we depreciate
|
| 208 |
-
if( function_exists( 'get_site_transient' ) && $transient = get_site_transient( 'update_themes' ) )
|
| 209 |
-
$current = $transient;
|
| 210 |
-
|
| 211 |
-
elseif( $transient = get_transient( 'update_themes' ) )
|
| 212 |
-
$current = $transient;
|
| 213 |
-
|
| 214 |
-
else
|
| 215 |
-
$current = get_option( 'update_themes' );
|
| 216 |
-
|
| 217 |
-
foreach ( (array) $themes as $theme_file => $theme ) {
|
| 218 |
-
|
| 219 |
-
$new_version = isset( $current->response[$theme_file] ) ? $current->response[$theme_file]->new_version : null;
|
| 220 |
-
|
| 221 |
-
if ( is_theme_active( $theme_file ) )
|
| 222 |
-
$themes[$theme_file]['active'] = true;
|
| 223 |
-
|
| 224 |
-
else
|
| 225 |
-
$themes[$theme_file]['active'] = false;
|
| 226 |
-
|
| 227 |
-
if ( $new_version ) {
|
| 228 |
-
$themes[$theme_file]['latest_version'] = $new_version;
|
| 229 |
-
$themes[$theme_file]['latest_package'] = $current->response[$theme_file]->package;
|
| 230 |
-
$themes[$theme_file]['slug'] = $current->response[$theme_file]->slug;
|
| 231 |
-
|
| 232 |
-
} else {
|
| 233 |
-
$themes[$theme_file]['latest_version'] = $theme['Version'];
|
| 234 |
-
|
| 235 |
-
}
|
| 236 |
-
|
| 237 |
-
}
|
| 238 |
-
|
| 239 |
-
// TODO is this necessary?
|
| 240 |
-
global $wp_version;
|
| 241 |
-
$themes_args = (object) compact( 'themes' );
|
| 242 |
-
|
| 243 |
-
return $themes;
|
| 244 |
-
}
|
| 245 |
-
|
| 246 |
-
/**
|
| 247 |
-
* Update a theme
|
| 248 |
-
*
|
| 249 |
-
* @access private
|
| 250 |
-
* @param mixed $theme
|
| 251 |
-
* @return array
|
| 252 |
-
*/
|
| 253 |
-
function _wpr_upgrade_theme( $theme ) {
|
| 254 |
-
|
| 255 |
-
include_once ( ABSPATH . 'wp-admin/includes/admin.php' );
|
| 256 |
-
|
| 257 |
-
if ( ! _wpr_supports_theme_upgrade() )
|
| 258 |
-
return array( 'status' => 'error', 'error' => 'WordPress version too old for theme upgrades' );
|
| 259 |
-
|
| 260 |
-
$skin = new WPR_Theme_Upgrader_Skin();
|
| 261 |
-
$upgrader = new Theme_Upgrader( $skin );
|
| 262 |
-
$is_active = is_theme_active( $theme );
|
| 263 |
-
|
| 264 |
-
// Do the upgrade
|
| 265 |
-
ob_start();
|
| 266 |
-
$result = $upgrader->upgrade( $theme );
|
| 267 |
-
$data = ob_get_contents();
|
| 268 |
-
ob_clean();
|
| 269 |
-
|
| 270 |
-
if ( ( ! $result && ! is_null( $result ) ) || $data )
|
| 271 |
-
return array( 'status' => 'error', 'error' => 'file_permissions_error' );
|
| 272 |
-
|
| 273 |
-
elseif ( is_wp_error( $result ) )
|
| 274 |
-
return array( 'status' => 'error', 'error' => $result->get_error_code() );
|
| 275 |
-
|
| 276 |
-
if ( $skin->error )
|
| 277 |
-
return array( 'status' => 'error', 'error' => $skin->error );
|
| 278 |
-
|
| 279 |
-
// If the theme was activited, we have to re-activate it
|
| 280 |
-
// @todo Shouldn't this use activate_theme?
|
| 281 |
-
if ( $is_active ) {
|
| 282 |
-
$current = get_option( 'active_plugins', array() );
|
| 283 |
-
$current[] = theme_basename( trim( $theme ) );;
|
| 284 |
-
sort( $current );
|
| 285 |
-
update_option('active_themes', $current );
|
| 286 |
-
}
|
| 287 |
-
|
| 288 |
-
return array( 'status' => 'success' );
|
| 289 |
-
|
| 290 |
-
}
|
| 291 |
-
|
| 292 |
-
/**
|
| 293 |
-
* Check if the site can support theme upgrades
|
| 294 |
-
*
|
| 295 |
-
* @todo should probably check if we have direct filesystem access
|
| 296 |
-
* @todo can we remove support for versions which don't support Theme_Upgrader
|
| 297 |
-
* @return bool
|
| 298 |
-
*/
|
| 299 |
-
function _wpr_supports_plugin_upgrade() {
|
| 300 |
-
|
| 301 |
-
include_once ( ABSPATH . 'wp-admin/includes/admin.php' );
|
| 302 |
-
|
| 303 |
-
return class_exists( 'Theme_Upgrader' );
|
| 304 |
-
|
| 305 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wprp.plugin.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
/*
|
| 4 |
Plugin Name: WP Remote
|
| 5 |
Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>. Deactivate to clear your API Key.
|
| 6 |
-
Version: 2.0
|
| 7 |
Author: Human Made Limited
|
| 8 |
Author URI: http://hmn.md/
|
| 9 |
*/
|
| 3 |
/*
|
| 4 |
Plugin Name: WP Remote
|
| 5 |
Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>. Deactivate to clear your API Key.
|
| 6 |
+
Version: 2.0.1
|
| 7 |
Author: Human Made Limited
|
| 8 |
Author URI: http://hmn.md/
|
| 9 |
*/
|
