$defaults = array
( 'clear_update_cache' => true,
);
$parsed_args =
wp_parse_args( $args,
$defaults );
$this->
init();
$this->
upgrade_strings();
$current =
get_site_transient( 'update_plugins'
);
if ( !
isset( $current->response
[ $plugin ] ) ) { $this->skin->
before();
$this->skin->
set_result( false
);
$this->skin->
error( 'up_to_date'
);
$this->skin->
after();
return false;
} // Get the URL to the zip file.
$r =
$current->response
[ $plugin ];
add_filter( 'upgrader_pre_install', array
( $this, 'deactivate_plugin_before_upgrade'
), 10, 2
);
add_filter( 'upgrader_pre_install', array
( $this, 'active_before'
), 10, 2
);
add_filter( 'upgrader_clear_destination', array
( $this, 'delete_old_plugin'
), 10, 4
);