Skip to content

Commit 00eebc2

Browse files
committed
Merge pull request #284 from Ninos/small-fixes
Remove extract() function
2 parents cd066d7 + effa9b1 commit 00eebc2

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

class-tgm-plugin-activation.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,12 +1860,11 @@ public function run( $options ) {
18601860
'hook_extra' => array(),
18611861
);
18621862

1863-
// Parse default options with config options from $this->bulk_upgrade and extract them.
1863+
// Parse default options with config options from $this->bulk_upgrade.
18641864
$options = wp_parse_args( $options, $defaults );
1865-
extract( $options );
18661865

18671866
// Connect to the Filesystem.
1868-
$res = $this->fs_connect( array( WP_CONTENT_DIR, $destination ) );
1867+
$res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) );
18691868
if ( ! $res ) {
18701869
return false;
18711870
}
@@ -1877,22 +1876,22 @@ public function run( $options ) {
18771876
}
18781877

18791878
// Call $this->header separately if running multiple times.
1880-
if ( ! $is_multi )
1879+
if ( ! $options['is_multi'] )
18811880
$this->skin->header();
18821881

18831882
// Set strings before the package is installed.
18841883
$this->skin->before();
18851884

18861885
// Download the package (this just returns the filename of the file if the package is a local file).
1887-
$download = $this->download_package( $package );
1886+
$download = $this->download_package( $options['package'] );
18881887
if ( is_wp_error( $download ) ) {
18891888
$this->skin->error( $download );
18901889
$this->skin->after();
18911890
return $download;
18921891
}
18931892

18941893
// Don't accidentally delete a local file.
1895-
$delete_package = ( $download != $package );
1894+
$delete_package = ( $download != $options['package'] );
18961895

18971896
// Unzip file into a temporary working directory.
18981897
$working_dir = $this->unpack_package( $download, $delete_package );
@@ -1906,10 +1905,10 @@ public function run( $options ) {
19061905
$result = $this->install_package(
19071906
array(
19081907
'source' => $working_dir,
1909-
'destination' => $destination,
1910-
'clear_destination' => $clear_destination,
1911-
'clear_working' => $clear_working,
1912-
'hook_extra' => $hook_extra,
1908+
'destination' => $options['destination'],
1909+
'clear_destination' => $options['clear_destination'],
1910+
'clear_working' => $options['clear_working'],
1911+
'hook_extra' => $options['hook_extra'],
19131912
)
19141913
);
19151914

@@ -1932,7 +1931,7 @@ public function run( $options ) {
19321931
wp_cache_flush();
19331932

19341933
// Get the installed plugin file and activate it.
1935-
$plugin_info = $this->plugin_info( $package );
1934+
$plugin_info = $this->plugin_info( $options['package'] );
19361935
$activate = activate_plugin( $plugin_info );
19371936

19381937
// Re-populate the file path now that the plugin has been installed and activated.
@@ -1954,7 +1953,7 @@ public function run( $options ) {
19541953

19551954
// Set install footer strings.
19561955
$this->skin->after();
1957-
if ( ! $is_multi ) {
1956+
if ( ! $options['is_multi'] ) {
19581957
$this->skin->footer();
19591958
}
19601959

0 commit comments

Comments
 (0)