Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Break Automattic_Developer_Empty_Upgrader_Skin out into an includes file

  • Loading branch information...
commit eeb1683ec36f0e93ceb70f48bbb6116e32595a3c 1 parent 2d83d77
@Viper007Bond Viper007Bond authored
Showing with 32 additions and 31 deletions.
  1. +5 −31 developer.php
  2. +27 −0 includes/class-empty-upgrader-skin.php
View
36 developer.php
@@ -15,6 +15,11 @@
**************************************************************************/
+// Load helper class if installing a plugin
+if ( ! empty( $_POST['action'] ) && 'a8c_developer_install_plugin' == $_POST['action'] )
+ require_once( __DIR__ . '/includes/class-empty-upgrader-skin.php' );
+
+
class Automattic_Developer {
public $settings = array();
@@ -564,35 +569,4 @@ public function is_recommended_plugin_installed( $slug ) {
$Automattic_Developer = new Automattic_Developer();
-
-
-if ( ! empty( $_POST['action'] ) && 'a8c_developer_install_plugin' == $_POST['action'] ) {
-
- include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
-
- class Automattic_Developer_Empty_Upgrader_Skin extends WP_Upgrader_Skin {
- function __construct($args = array()) {
- $defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' );
- $args = wp_parse_args( $args, $defaults );
-
- $this->type = $args['type'];
- $this->api = isset( $args['api'] ) ? $args['api'] : array();
-
- parent::__construct( $args );
- }
-
- public function request_filesystem_credentials() {
- return true;
- }
-
- public function error() {
- die( '-1' );
- }
-
- public function header() {}
- public function footer() {}
- public function feedback() {}
- }
-}
-
?>
View
27 includes/class-empty-upgrader-skin.php
@@ -0,0 +1,27 @@
+<?php
+
+include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
+
+class Automattic_Developer_Empty_Upgrader_Skin extends WP_Upgrader_Skin {
+ function __construct($args = array()) {
+ $defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' );
+ $args = wp_parse_args( $args, $defaults );
+
+ $this->type = $args['type'];
+ $this->api = isset( $args['api'] ) ? $args['api'] : array();
+
+ parent::__construct( $args );
+ }
+
+ public function request_filesystem_credentials() {
+ return true;
+ }
+
+ public function error() {
+ die( '-1' );
+ }
+
+ public function header() {}
+ public function footer() {}
+ public function feedback() {}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.