@@ -15,9 +15,13 @@ |
||
| 15 | 15 | ]; |
| 16 | 16 | foreach( $namespaces as $prefix => $base_dir ) { |
| 17 | 17 | $len = strlen( $prefix ); |
| 18 | - if( strncmp( $prefix, $className, $len ) !== 0 )continue; |
|
| 18 | + if( strncmp( $prefix, $className, $len ) !== 0 ) { |
|
| 19 | + continue; |
|
| 20 | + } |
|
| 19 | 21 | $file = $base_dir.str_replace( '\\', '/', substr( $className, $len )).'.php'; |
| 20 | - if( !file_exists( $file ))continue; |
|
| 22 | + if( !file_exists( $file )) { |
|
| 23 | + continue; |
|
| 24 | + } |
|
| 21 | 25 | require $file; |
| 22 | 26 | break; |
| 23 | 27 | } |
@@ -21,7 +21,9 @@ |
||
| 21 | 21 | if( !class_exists( 'GL_Plugin_Check_v1' )) { |
| 22 | 22 | require_once __DIR__.'/activate.php'; |
| 23 | 23 | } |
| 24 | -if( GL_Plugin_Check_v1::shouldDeactivate( __FILE__, array( 'wordpress' => '4.7.0' )))return; |
|
| 24 | +if( GL_Plugin_Check_v1::shouldDeactivate( __FILE__, array( 'wordpress' => '4.7.0' ))) { |
|
| 25 | + return; |
|
| 26 | +} |
|
| 25 | 27 | |
| 26 | 28 | require_once __DIR__.'/autoload.php'; |
| 27 | 29 | require_once __DIR__.'/helpers.php'; |
@@ -87,7 +87,9 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function deactivate( $plugin ) |
| 89 | 89 | { |
| 90 | - if( static::isValid() )return; |
|
| 90 | + if( static::isValid() ) { |
|
| 91 | + return; |
|
| 92 | + } |
|
| 91 | 93 | $pluginSlug = plugin_basename( static::$file ); |
| 92 | 94 | if( $plugin == $pluginSlug ) { |
| 93 | 95 | $this->redirect(); //exit |
@@ -142,8 +144,7 @@ discard block |
||
| 142 | 144 | sprintf( $messages[1], $messages[3].' '.static::$versions->php ), |
| 143 | 145 | sprintf( $messages[2], PHP_VERSION ) |
| 144 | 146 | ); |
| 145 | - } |
|
| 146 | - else if( !static::isWpValid() ) { |
|
| 147 | + } else if( !static::isWpValid() ) { |
|
| 147 | 148 | printf( $noticeTemplate, |
| 148 | 149 | sprintf( $messages[0], $pluginName ), |
| 149 | 150 | sprintf( $messages[1], $messages[4].' '.static::$versions->wordpress ), |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | if( file_exists( $file ) ) { |
| 26 | 26 | include $file; |
| 27 | - } |
|
| 28 | - else { |
|
| 27 | + } else { |
|
| 29 | 28 | glsr_log()->error( 'File not found: '.$file ); |
| 30 | 29 | } |
| 31 | 30 | |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | |
| 9 | 9 | if( file_exists( $file )) { |
| 10 | 10 | include $file; |
| 11 | -} |
|
| 12 | -else { |
|
| 11 | +} else { |
|
| 13 | 12 | glsr_log()->error( 'File not found: '.$file ); |
| 14 | 13 | } |
@@ -27,7 +27,9 @@ discard block |
||
| 27 | 27 | [], |
| 28 | 28 | glsr()->version |
| 29 | 29 | ); |
| 30 | - if( !$this->isCurrentScreen() )return; |
|
| 30 | + if( !$this->isCurrentScreen() ) { |
|
| 31 | + return; |
|
| 32 | + } |
|
| 31 | 33 | wp_enqueue_script( |
| 32 | 34 | Application::ID, |
| 33 | 35 | glsr()->url( 'assets/scripts/'.Application::ID.'-admin.js' ), |
@@ -86,7 +88,9 @@ discard block |
||
| 86 | 88 | { |
| 87 | 89 | $variables = []; |
| 88 | 90 | foreach( glsr()->mceShortcodes as $tag => $args ) { |
| 89 | - if( empty( $args['required'] ))continue; |
|
| 91 | + if( empty( $args['required'] )) { |
|
| 92 | + continue; |
|
| 93 | + } |
|
| 90 | 94 | $variables[$tag] = $args['required']; |
| 91 | 95 | } |
| 92 | 96 | return $variables; |
@@ -11,7 +11,9 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | public function handle( Command $command ) |
| 13 | 13 | { |
| 14 | - if( in_array( $command->postType, get_post_types( ['_builtin' => true] )))return; |
|
| 14 | + if( in_array( $command->postType, get_post_types( ['_builtin' => true] ))) { |
|
| 15 | + return; |
|
| 16 | + } |
|
| 15 | 17 | register_post_type( $command->postType, $command->args ); |
| 16 | 18 | glsr()->postTypeColumns = wp_parse_args( glsr()->postTypeColumns, [ |
| 17 | 19 | $command->postType => $command->columns, |
@@ -112,7 +112,9 @@ |
||
| 112 | 112 | protected function sendNotification( $post_id, Command $command ) |
| 113 | 113 | { |
| 114 | 114 | $notificationType = glsr_get_option( 'general.notification' ); |
| 115 | - if( !in_array( $notificationType, ['default','custom','webhook'] ))return; |
|
| 115 | + if( !in_array( $notificationType, ['default','custom','webhook'] )) { |
|
| 116 | + return; |
|
| 117 | + } |
|
| 116 | 118 | $assignedToTitle = get_the_title( (int) $command->assignedTo ); |
| 117 | 119 | $notificationSubject = _nx( |
| 118 | 120 | 'New %s-star review', |
@@ -18,8 +18,7 @@ |
||
| 18 | 18 | if( is_null( $command->pinned )) { |
| 19 | 19 | $meta = get_post_meta( $command->id, 'pinned', true ); |
| 20 | 20 | $command->pinned = !wp_validate_boolean( $meta ); |
| 21 | - } |
|
| 22 | - else { |
|
| 21 | + } else { |
|
| 23 | 22 | $notice = $command->pinned |
| 24 | 23 | ? __( 'The review is pinned.', 'site-reviews' ) |
| 25 | 24 | : __( 'The review is unpinned.', 'site-reviews' ); |