@@ -48,7 +48,9 @@ |
||
| 48 | 48 | public function filterUpdateMessages( array $messages ) |
| 49 | 49 | { |
| 50 | 50 | $post = get_post(); |
| 51 | - if( !( $post instanceof WP_Post ))return; |
|
| 51 | + if( !( $post instanceof WP_Post )) { |
|
| 52 | + return; |
|
| 53 | + } |
|
| 52 | 54 | $strings = $this->getReviewLabels(); |
| 53 | 55 | $restored = filter_input( INPUT_GET, 'revision' ); |
| 54 | 56 | if( $revisionTitle = wp_post_revision_title( intval( $restored ), false )) { |
@@ -107,7 +107,9 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function renderReviewEditor( WP_Post $post ) |
| 109 | 109 | { |
| 110 | - if( !$this->isReviewPostType( $post ) || $this->isReviewEditable( $post ))return; |
|
| 110 | + if( !$this->isReviewPostType( $post ) || $this->isReviewEditable( $post )) { |
|
| 111 | + return; |
|
| 112 | + } |
|
| 111 | 113 | glsr()->render( 'partials/editor/review', [ |
| 112 | 114 | 'post' => $post, |
| 113 | 115 | ]); |
@@ -119,7 +121,9 @@ discard block |
||
| 119 | 121 | */ |
| 120 | 122 | public function renderReviewNotice( WP_Post $post ) |
| 121 | 123 | { |
| 122 | - if( !$this->isReviewPostType( $post ) || $this->isReviewEditable( $post ))return; |
|
| 124 | + if( !$this->isReviewPostType( $post ) || $this->isReviewEditable( $post )) { |
|
| 125 | + return; |
|
| 126 | + } |
|
| 123 | 127 | glsr( Notice::class )->addWarning( __( 'This review is read-only.', 'site-reviews' )); |
| 124 | 128 | glsr( Html::class )->renderTemplate( 'partials/editor/notice', [ |
| 125 | 129 | 'context' => [ |
@@ -134,13 +138,19 @@ discard block |
||
| 134 | 138 | */ |
| 135 | 139 | public function renderTinymceButton() |
| 136 | 140 | { |
| 137 | - if( glsr_current_screen()->base != 'post' )return; |
|
| 141 | + if( glsr_current_screen()->base != 'post' ) { |
|
| 142 | + return; |
|
| 143 | + } |
|
| 138 | 144 | $shortcodes = []; |
| 139 | 145 | foreach( glsr()->mceShortcodes as $shortcode => $values ) { |
| 140 | - if( !apply_filters( sanitize_title( $shortcode ).'_condition', true ))continue; |
|
| 146 | + if( !apply_filters( sanitize_title( $shortcode ).'_condition', true )) { |
|
| 147 | + continue; |
|
| 148 | + } |
|
| 141 | 149 | $shortcodes[$shortcode] = $values; |
| 142 | 150 | } |
| 143 | - if( empty( $shortcodes ))return; |
|
| 151 | + if( empty( $shortcodes )) { |
|
| 152 | + return; |
|
| 153 | + } |
|
| 144 | 154 | glsr()->render( 'partials/editor/tinymce', [ |
| 145 | 155 | 'shortcodes' => $shortcodes, |
| 146 | 156 | ]); |
@@ -72,7 +72,9 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function send() |
| 74 | 74 | { |
| 75 | - if( !$this->message || !$this->subject || !$this->to )return; |
|
| 75 | + if( !$this->message || !$this->subject || !$this->to ) { |
|
| 76 | + return; |
|
| 77 | + } |
|
| 76 | 78 | $sent = wp_mail( |
| 77 | 79 | $this->to, |
| 78 | 80 | $this->subject, |
@@ -90,8 +92,12 @@ discard block |
||
| 90 | 92 | */ |
| 91 | 93 | public function buildPlainTextMessage( PHPMailer $phpmailer ) |
| 92 | 94 | { |
| 93 | - if( empty( $this->email ))return; |
|
| 94 | - if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return; |
|
| 95 | + if( empty( $this->email )) { |
|
| 96 | + return; |
|
| 97 | + } |
|
| 98 | + if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody )) { |
|
| 99 | + return; |
|
| 100 | + } |
|
| 95 | 101 | $message = $this->stripHtmlTags( $phpmailer->Body ); |
| 96 | 102 | $phpmailer->AltBody = apply_filters( 'site-reviews/email/message', $message, 'text', $this ); |
| 97 | 103 | } |
@@ -29,7 +29,8 @@ |
||
| 29 | 29 | protected $settings; |
| 30 | 30 | protected $taxonomy; |
| 31 | 31 | |
| 32 | - public function __construct( Application $app ) { |
|
| 32 | + public function __construct( Application $app ) |
|
| 33 | + { |
|
| 33 | 34 | $this->app = $app; |
| 34 | 35 | $this->admin = $app->make( AdminController::class ); |
| 35 | 36 | $this->editor = $app->make( EditorController::class ); |
@@ -212,7 +212,9 @@ discard block |
||
| 212 | 212 | $newParents = $parents; |
| 213 | 213 | foreach( $parents as $parent ) { |
| 214 | 214 | $parentClass = glsr( Helper::class )->buildClassName( $parent, __NAMESPACE__ ); |
| 215 | - if( !class_exists( $parentClass ))continue; |
|
| 215 | + if( !class_exists( $parentClass )) { |
|
| 216 | + continue; |
|
| 217 | + } |
|
| 216 | 218 | $newParents = array_merge( $newParents, $this->getParents( (new $parentClass)->parents )); |
| 217 | 219 | } |
| 218 | 220 | return array_values( array_unique( $newParents )); |
@@ -226,7 +228,9 @@ discard block |
||
| 226 | 228 | $parents = $this->getParents(); |
| 227 | 229 | foreach( $parents as $parent ) { |
| 228 | 230 | $parentClass = glsr( Helper::class )->buildClassName( $parent, __NAMESPACE__ ); |
| 229 | - if( !class_exists( $parentClass ))continue; |
|
| 231 | + if( !class_exists( $parentClass )) { |
|
| 232 | + continue; |
|
| 233 | + } |
|
| 230 | 234 | $this->allowed = array_values( array_unique( array_merge( (new $parentClass)->allowed, $this->allowed ))); |
| 231 | 235 | } |
| 232 | 236 | } |
@@ -91,7 +91,9 @@ discard block |
||
| 91 | 91 | get_mu_plugins(), |
| 92 | 92 | get_plugins( '/../'.basename( WPMU_PLUGIN_DIR )) |
| 93 | 93 | ); |
| 94 | - if( empty( $plugins ))return; |
|
| 94 | + if( empty( $plugins )) { |
|
| 95 | + return; |
|
| 96 | + } |
|
| 95 | 97 | return $this->normalizePluginList( $plugins ); |
| 96 | 98 | } |
| 97 | 99 | |
@@ -100,7 +102,9 @@ discard block |
||
| 100 | 102 | */ |
| 101 | 103 | public function getMultisitePluginDetails() |
| 102 | 104 | { |
| 103 | - if( !is_multisite() || empty( get_site_option( 'active_sitewide_plugins', [] )))return; |
|
| 105 | + if( !is_multisite() || empty( get_site_option( 'active_sitewide_plugins', [] ))) { |
|
| 106 | + return; |
|
| 107 | + } |
|
| 104 | 108 | return $this->normalizePluginList( wp_get_active_network_plugins() ); |
| 105 | 109 | } |
| 106 | 110 | |
@@ -157,7 +161,9 @@ discard block |
||
| 157 | 161 | ksort( $settings ); |
| 158 | 162 | $details = []; |
| 159 | 163 | foreach( $settings as $key => $value ) { |
| 160 | - if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key ))continue; |
|
| 164 | + if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key )) { |
|
| 165 | + continue; |
|
| 166 | + } |
|
| 161 | 167 | $value = htmlspecialchars( trim( preg_replace('/\s\s+/', '\\n', $value )), ENT_QUOTES, 'UTF-8' ); |
| 162 | 168 | $details[$key] = $value; |
| 163 | 169 | } |
@@ -230,7 +236,9 @@ discard block |
||
| 230 | 236 | 'WPE_APIKEY' => 'WP Engine', |
| 231 | 237 | ]; |
| 232 | 238 | foreach( $checks as $key => $value ) { |
| 233 | - if( !$this->isWebhostCheckValid( $key ))continue; |
|
| 239 | + if( !$this->isWebhostCheckValid( $key )) { |
|
| 240 | + continue; |
|
| 241 | + } |
|
| 234 | 242 | return $value; |
| 235 | 243 | } |
| 236 | 244 | return implode( ',', array_filter( [DB_HOST, filter_input( INPUT_SERVER, 'SERVER_NAME' )] )); |
@@ -311,7 +319,9 @@ discard block |
||
| 311 | 319 | ]; |
| 312 | 320 | array_walk( $settings, function( &$value, $setting ) use( $keys ) { |
| 313 | 321 | foreach( $keys as $key ) { |
| 314 | - if( !glsr( Helper::class )->startsWith( $key, $setting ) || empty( $value ))continue; |
|
| 322 | + if( !glsr( Helper::class )->startsWith( $key, $setting ) || empty( $value )) { |
|
| 323 | + continue; |
|
| 324 | + } |
|
| 315 | 325 | $value = str_repeat( '•', 13 ); |
| 316 | 326 | return; |
| 317 | 327 | } |
@@ -15,14 +15,20 @@ |
||
| 15 | 15 | <span class="glsr-addon-link button button-secondary" disabled> |
| 16 | 16 | <?= __( 'Installed', 'site-reviews' ); ?> |
| 17 | 17 | </span> |
| 18 | - <?php else: ?> |
|
| 19 | - <a href="<?= wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin='.$plugin ), 'activate-plugin_'.$plugin );?>" class="glsr-addon-link button button-secondary"> |
|
| 18 | + <?php else { |
|
| 19 | + : ?> |
|
| 20 | + <a href="<?= wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin='.$plugin ), 'activate-plugin_'.$plugin ); |
|
| 21 | +} |
|
| 22 | +?>" class="glsr-addon-link button button-secondary"> |
|
| 20 | 23 | <?= __( 'Activate', 'site-reviews' ); ?> |
| 21 | 24 | </a> |
| 22 | 25 | <?php endif; ?> |
| 23 | - <?php else: ?> |
|
| 26 | + <?php else { |
|
| 27 | + : ?> |
|
| 24 | 28 | <a href="{{ link }}" class="glsr-addon-link glsr-external button button-secondary"> |
| 25 | - <?= __( 'More Info', 'site-reviews' ); ?> |
|
| 29 | + <?= __( 'More Info', 'site-reviews' ); |
|
| 30 | +} |
|
| 31 | +?> |
|
| 26 | 32 | </a> |
| 27 | 33 | <?php endif; ?> |
| 28 | 34 | </div> |
@@ -46,9 +46,12 @@ |
||
| 46 | 46 | <option value="<?= $slug; ?>" class="hide-if-no-js"><?= $details['name']; ?></option> |
| 47 | 47 | <?php endforeach; ?> |
| 48 | 48 | </select> |
| 49 | - <?php else: ?> |
|
| 49 | + <?php else { |
|
| 50 | + : ?> |
|
| 50 | 51 | <?php foreach( $sites as $slug => $details ) : ?> |
| 51 | - <input type="hidden" name="{{ id }}[site]" value="<?= $slug; ?>"> |
|
| 52 | + <input type="hidden" name="{{ id }}[site]" value="<?= $slug; |
|
| 53 | +} |
|
| 54 | +?>"> |
|
| 52 | 55 | <?php endforeach; ?> |
| 53 | 56 | <?php endif; ?> |
| 54 | 57 | <input type="hidden" name="{{ id }}[action]" value="sync-reviews"> |
@@ -60,7 +60,9 @@ |
||
| 60 | 60 | */ |
| 61 | 61 | public function deactivate( $plugin ) |
| 62 | 62 | { |
| 63 | - if( $this->isValid() )return; |
|
| 63 | + if( $this->isValid() ) { |
|
| 64 | + return; |
|
| 65 | + } |
|
| 64 | 66 | $pluginSlug = plugin_basename( $this->file ); |
| 65 | 67 | if( $plugin == $pluginSlug ) { |
| 66 | 68 | $this->redirect(); //exit |