@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $this->versions = wp_parse_args( $versions, array( |
| 31 | 31 | 'php' => static::MIN_PHP_VERSION, |
| 32 | 32 | 'wordpress' => static::MIN_WORDPRESS_VERSION, |
| 33 | - )); |
|
| 33 | + ) ); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | if( $this->isValid() ) { |
| 42 | 42 | return true; |
| 43 | 43 | } |
| 44 | - add_action( 'activated_plugin', array( $this, 'deactivate' )); |
|
| 45 | - add_action( 'admin_notices', array( $this, 'deactivate' )); |
|
| 44 | + add_action( 'activated_plugin', array( $this, 'deactivate' ) ); |
|
| 45 | + add_action( 'admin_notices', array( $this, 'deactivate' ) ); |
|
| 46 | 46 | return false; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | filter_input( INPUT_GET, 'plugin_status' ), |
| 138 | 138 | filter_input( INPUT_GET, 'paged' ), |
| 139 | 139 | filter_input( INPUT_GET, 's' ) |
| 140 | - ))); |
|
| 140 | + ) ) ); |
|
| 141 | 141 | exit; |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -77,7 +77,9 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | public function deactivate( $plugin ) |
| 79 | 79 | { |
| 80 | - if( $this->isValid() )return; |
|
| 80 | + if( $this->isValid() ) { |
|
| 81 | + return; |
|
| 82 | + } |
|
| 81 | 83 | $pluginSlug = plugin_basename( $this->file ); |
| 82 | 84 | if( $plugin == $pluginSlug ) { |
| 83 | 85 | $this->redirect(); //exit |
@@ -22,15 +22,15 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | $instructions = array_reduce( $this->getInstructionGroups(), function( $html, $metabox ) { |
| 24 | 24 | $fields = $this->getInstructionFields( $metabox ); |
| 25 | - if( empty( $fields )) { |
|
| 25 | + if( empty($fields) ) { |
|
| 26 | 26 | return $html; |
| 27 | 27 | } |
| 28 | - return $html . sprintf( '<p><strong>%s</strong></p><pre class="my-sites nav-tab-active misc-pub-section">%s</pre>', |
|
| 28 | + return $html.sprintf( '<p><strong>%s</strong></p><pre class="my-sites nav-tab-active misc-pub-section">%s</pre>', |
|
| 29 | 29 | $metabox['title'], |
| 30 | 30 | $fields |
| 31 | 31 | ); |
| 32 | 32 | }); |
| 33 | - return $this->filter( 'before/instructions', '' ) . $instructions . $this->filter( 'after/instructions', '' ); |
|
| 33 | + return $this->filter( 'before/instructions', '' ).$instructions.$this->filter( 'after/instructions', '' ); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | protected function getInstructionFields( $metabox ) |
| 40 | 40 | { |
| 41 | 41 | $skipFields = ['custom_html', 'divider', 'heading', 'taxonomy']; |
| 42 | - return array_reduce( $metabox['fields'], function( $html, $field ) use( $metabox, $skipFields ) { |
|
| 42 | + return array_reduce( $metabox['fields'], function( $html, $field ) use($metabox, $skipFields) { |
|
| 43 | 43 | return $this->validate( $field['condition'] ) && !in_array( $field['type'], $skipFields ) |
| 44 | - ? $html . $this->filter( 'instruction', "PostMeta::get('{$field['slug']}');", $field, $metabox ) . PHP_EOL |
|
| 44 | + ? $html.$this->filter( 'instruction', "PostMeta::get('{$field['slug']}');", $field, $metabox ).PHP_EOL |
|
| 45 | 45 | : $html; |
| 46 | 46 | }); |
| 47 | 47 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | return $this->filter( 'show/instructions', count( array_filter( $this->metaboxes, function( $metabox ) { |
| 87 | 87 | return $this->show( false, $metabox ); |
| 88 | - })) > 0 ); |
|
| 88 | + }) ) > 0 ); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -62,7 +62,9 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | protected function initInstructions() |
| 64 | 64 | { |
| 65 | - if( !$this->showInstructions() )return; |
|
| 65 | + if( !$this->showInstructions() ) { |
|
| 66 | + return; |
|
| 67 | + } |
|
| 66 | 68 | return [ |
| 67 | 69 | 'infodiv' => [ |
| 68 | 70 | 'context' => 'side', |
@@ -3,7 +3,9 @@ |
||
| 3 | 3 | defined( 'WP_UNINSTALL_PLUGIN' ) || die; |
| 4 | 4 | |
| 5 | 5 | require_once __DIR__.'/pollux.php'; |
| 6 | -if( !(new GL_Plugin_Check_v3( __FILE__ ))->isValid() )return; |
|
| 6 | +if( !(new GL_Plugin_Check_v3( __FILE__ ))->isValid() ) { |
|
| 7 | + return; |
|
| 8 | +} |
|
| 7 | 9 | |
| 8 | 10 | delete_option( GeminiLabs\Pollux\Config\Config::id() ); |
| 9 | 11 | delete_option( GeminiLabs\Pollux\PostType\Archive::id() ); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | defined( 'WPINC' ) || die; |
| 20 | 20 | |
| 21 | -if( !class_exists( 'GL_Plugin_Check_v3' )) { |
|
| 21 | +if( !class_exists( 'GL_Plugin_Check_v3' ) ) { |
|
| 22 | 22 | require_once __DIR__.'/activate.php'; |
| 23 | 23 | } |
| 24 | 24 | if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() )return; |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | $app = GeminiLabs\Pollux\Application::getInstance(); |
| 30 | 30 | |
| 31 | -register_activation_hook( __FILE__, array( $app, 'onActivation' )); |
|
| 32 | -register_deactivation_hook( __FILE__, array( $app, 'onDeactivation' )); |
|
| 31 | +register_activation_hook( __FILE__, array( $app, 'onActivation' ) ); |
|
| 32 | +register_deactivation_hook( __FILE__, array( $app, 'onDeactivation' ) ); |
|
| 33 | 33 | |
| 34 | 34 | $app->register( new GeminiLabs\Pollux\Provider ); |
| 35 | 35 | $app->init(); |
@@ -21,7 +21,9 @@ |
||
| 21 | 21 | if( !class_exists( 'GL_Plugin_Check_v3' )) { |
| 22 | 22 | require_once __DIR__.'/activate.php'; |
| 23 | 23 | } |
| 24 | -if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() )return; |
|
| 24 | +if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() ) { |
|
| 25 | + return; |
|
| 26 | +} |
|
| 25 | 27 | require_once __DIR__.'/autoload.php'; |
| 26 | 28 | require_once __DIR__.'/helpers.php'; |
| 27 | 29 | require_once __DIR__.'/thirdparty.php'; |