@@ -20,7 +20,9 @@ |
||
| 20 | 20 | |
| 21 | 21 | require_once __DIR__.'/activate.php'; |
| 22 | 22 | |
| 23 | -if( \Pollux_Activate::shouldDeactivate() )return; |
|
| 23 | +if( \Pollux_Activate::shouldDeactivate() ) { |
|
| 24 | + return; |
|
| 25 | +} |
|
| 24 | 26 | |
| 25 | 27 | require_once __DIR__.'/autoload.php'; |
| 26 | 28 | require_once __DIR__.'/helpers.php'; |
@@ -59,7 +59,9 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | public function deactivate( $plugin ) |
| 61 | 61 | { |
| 62 | - if( static::isValid() )return; |
|
| 62 | + if( static::isValid() ) { |
|
| 63 | + return; |
|
| 64 | + } |
|
| 63 | 65 | $pluginName = plugin_basename( dirname( realpath( __FILE__ )).'/'.static::BASENAME ); |
| 64 | 66 | if( $plugin == $pluginName ) { |
| 65 | 67 | $this->redirect(); //exit |
@@ -49,7 +49,9 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | if( get_current_screen()->id != sprintf( 'settings_page_%s', pollux_app()->id ) |
| 51 | 51 | || filter_input( INPUT_GET, 'action' ) != 'activate' |
| 52 | - )return; |
|
| 52 | + ) { |
|
| 53 | + return; |
|
| 54 | + } |
|
| 53 | 55 | $plugin = filter_input( INPUT_GET, 'plugin' ); |
| 54 | 56 | check_admin_referer( 'activate-plugin_' . $plugin ); |
| 55 | 57 | $result = activate_plugin( $plugin, null, is_network_admin(), true ); |
@@ -99,7 +101,9 @@ discard block |
||
| 99 | 101 | public function hasPendingDependencies() |
| 100 | 102 | { |
| 101 | 103 | foreach( static::DEPENDENCIES as $plugin => $data ) { |
| 102 | - if( !$this->isPluginDependency( $plugin ))continue; |
|
| 104 | + if( !$this->isPluginDependency( $plugin )) { |
|
| 105 | + continue; |
|
| 106 | + } |
|
| 103 | 107 | $this->isPluginActive( $plugin ); |
| 104 | 108 | $this->isPluginVersionValid( $plugin ); |
| 105 | 109 | } |
@@ -178,7 +182,9 @@ discard block |
||
| 178 | 182 | if( get_current_screen()->id != 'settings_page_pollux' |
| 179 | 183 | || pollux_app()->config->disable_config |
| 180 | 184 | || !$this->hasPendingDependencies() |
| 181 | - )return; |
|
| 185 | + ) { |
|
| 186 | + return; |
|
| 187 | + } |
|
| 182 | 188 | $message = sprintf( '<strong>%s:</strong> %s', |
| 183 | 189 | __( 'Pollux requires the latest version of the following plugins', 'pollux' ), |
| 184 | 190 | $this->getDependencyLinks() |
@@ -239,7 +245,8 @@ discard block |
||
| 239 | 245 | */ |
| 240 | 246 | protected function getDependencyLinks() |
| 241 | 247 | { |
| 242 | - return array_reduce( array_keys( $this->errors ), function( $carry, $plugin ) { |
|
| 248 | + return array_reduce( array_keys( $this->errors ), function( $carry, $plugin ) |
|
| 249 | + { |
|
| 243 | 250 | return $carry . $this->getPluginLink( $plugin ); |
| 244 | 251 | }); |
| 245 | 252 | } |