@@ -33,6 +33,6 @@ |
||
33 | 33 | 'permission_callback' => [$this, 'get_items_permissions_check'], |
34 | 34 | ], |
35 | 35 | 'schema' => [$this, 'get_public_item_schema'], |
36 | - ]); |
|
36 | + ] ); |
|
37 | 37 | } |
38 | 38 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | 'title' => 'Images', |
18 | 18 | ], |
19 | 19 | 'plugin' => 'site-reviews-images/site-reviews-images.php', |
20 | - ]); |
|
20 | + ] ); |
|
21 | 21 | $template->render( 'partials/addons/addon', [ |
22 | 22 | 'context' => [ |
23 | 23 | 'description' => __( 'Sync your Tripadvisor reviews to your website and manage them with Site Reviews.', 'site-reviews' ), |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | 'title' => 'Tripadvisor Reviews', |
27 | 27 | ], |
28 | 28 | 'plugin' => 'site-reviews-tripadvisor/site-reviews-tripadvisor.php', |
29 | - ]); |
|
29 | + ] ); |
|
30 | 30 | ?> |
31 | 31 | </div> |
32 | 32 | </div> |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function renderTaxonomyFilter() |
37 | 37 | { |
38 | - if( !is_object_in_taxonomy( glsr_current_screen()->post_type, Application::TAXONOMY ))return; |
|
38 | + if( !is_object_in_taxonomy( glsr_current_screen()->post_type, Application::TAXONOMY ) )return; |
|
39 | 39 | echo glsr( Builder::class )->label( __( 'Filter by category', 'site-reviews' ), [ |
40 | 40 | 'class' => 'screen-reader-text', |
41 | 41 | 'for' => Application::TAXONOMY, |
42 | - ]); |
|
43 | - wp_dropdown_categories([ |
|
42 | + ] ); |
|
43 | + wp_dropdown_categories( [ |
|
44 | 44 | 'depth' => 3, |
45 | 45 | 'hide_empty' => true, |
46 | 46 | 'hide_if_empty' => true, |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 'show_option_all' => $this->getShowOptionAll(), |
53 | 53 | 'taxonomy' => Application::TAXONOMY, |
54 | 54 | 'value_field' => 'slug', |
55 | - ]); |
|
55 | + ] ); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | protected function getSelected() |
62 | 62 | { |
63 | 63 | global $wp_query; |
64 | - return isset( $wp_query->query[Application::TAXONOMY] ) |
|
64 | + return isset($wp_query->query[Application::TAXONOMY]) |
|
65 | 65 | ? $wp_query->query[Application::TAXONOMY] |
66 | 66 | : ''; |
67 | 67 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $taxonomy = get_taxonomy( Application::TAXONOMY ); |
75 | 75 | return $taxonomy |
76 | - ? ucfirst( strtolower( $taxonomy->labels->all_items )) |
|
76 | + ? ucfirst( strtolower( $taxonomy->labels->all_items ) ) |
|
77 | 77 | : ''; |
78 | 78 | } |
79 | 79 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | 'savePending' => __( 'Save as Unapproved', 'site-reviews' ), |
18 | 18 | 'published' => __( 'Approved', 'site-reviews' ), |
19 | 19 | ]; |
20 | - if( $this->canModifyTranslation() && isset( $wp_scripts->registered['post']->extra['data'] )) { |
|
20 | + if( $this->canModifyTranslation() && isset($wp_scripts->registered['post']->extra['data']) ) { |
|
21 | 21 | $l10n = &$wp_scripts->registered['post']->extra['data']; |
22 | 22 | foreach( $strings as $search => $replace ) { |
23 | 23 | $l10n = preg_replace( '/("'.$search.'":")([^"]+)/', "$1".$replace, $l10n ); |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function filterPostStatusLabels( $translation, $text, $domain ) |
35 | 35 | { |
36 | - if( $this->canModifyTranslation( $domain )) { |
|
36 | + if( $this->canModifyTranslation( $domain ) ) { |
|
37 | 37 | $replacements = $this->getStatusLabels(); |
38 | - if( array_key_exists( $text, $replacements )) { |
|
38 | + if( array_key_exists( $text, $replacements ) ) { |
|
39 | 39 | $translation = $replacements[$text]; |
40 | 40 | } |
41 | 41 | } |
@@ -48,14 +48,14 @@ discard block |
||
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) )return; |
|
52 | 52 | $strings = $this->getReviewLabels(); |
53 | 53 | $restored = filter_input( INPUT_GET, 'revision' ); |
54 | - if( $revisionTitle = wp_post_revision_title( intval( $restored ), false )) { |
|
54 | + if( $revisionTitle = wp_post_revision_title( intval( $restored ), false ) ) { |
|
55 | 55 | $restored = sprintf( $strings['restored'], $revisionTitle ); |
56 | 56 | } |
57 | - $scheduled_date = date_i18n( 'M j, Y @ H:i', strtotime( $post->post_date )); |
|
58 | - $messages[ Application::POST_TYPE ] = [ |
|
57 | + $scheduled_date = date_i18n( 'M j, Y @ H:i', strtotime( $post->post_date ) ); |
|
58 | + $messages[Application::POST_TYPE] = [ |
|
59 | 59 | 1 => $strings['updated'], |
60 | 60 | 4 => $strings['updated'], |
61 | 61 | 5 => $restored, |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | protected function canModifyTranslation( $domain = 'default' ) |
79 | 79 | { |
80 | - if( $domain != 'default' || empty( glsr_current_screen()->base )) { |
|
80 | + if( $domain != 'default' || empty(glsr_current_screen()->base) ) { |
|
81 | 81 | return false; |
82 | 82 | } |
83 | 83 | return glsr_current_screen()->post_type == Application::POST_TYPE |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | protected function getStatusLabels() |
113 | 113 | { |
114 | 114 | static $labels; |
115 | - if( empty( $labels )) { |
|
115 | + if( empty($labels) ) { |
|
116 | 116 | $labels = [ |
117 | 117 | 'Pending' => __( 'Unapproved', 'site-reviews' ), |
118 | 118 | 'Pending Review' => __( 'Unapproved', 'site-reviews' ), |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | { |
23 | 23 | global $menu, $typenow; |
24 | 24 | foreach( $menu as $key => $value ) { |
25 | - if( !isset( $value[2] ) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE )continue; |
|
25 | + if( !isset($value[2]) || $value[2] != 'edit.php?post_type='.Application::POST_TYPE )continue; |
|
26 | 26 | $postCount = wp_count_posts( Application::POST_TYPE ); |
27 | 27 | $pendingCount = glsr( Builder::class )->span( number_format_i18n( $postCount->pending ), [ |
28 | 28 | 'class' => 'pending-count', |
29 | - ]); |
|
29 | + ] ); |
|
30 | 30 | $awaitingModeration = glsr( Builder::class )->span( $pendingCount, [ |
31 | 31 | 'class' => 'awaiting-mod count-'.$postCount->pending, |
32 | - ]); |
|
32 | + ] ); |
|
33 | 33 | $menu[$key][0] .= ' '.$awaitingModeration; |
34 | 34 | if( $typenow === Application::POST_TYPE ) { |
35 | - $menu[$key][4].= ' current'; |
|
35 | + $menu[$key][4] .= ' current'; |
|
36 | 36 | } |
37 | 37 | break; |
38 | 38 | } |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | 'tools' => __( 'Tools', 'site-reviews' ), |
50 | 50 | 'addons' => __( 'Add-ons', 'site-reviews' ), |
51 | 51 | 'documentation' => __( 'Documentation', 'site-reviews' ), |
52 | - ]); |
|
52 | + ] ); |
|
53 | 53 | foreach( $pages as $slug => $title ) { |
54 | 54 | $method = glsr( Helper::class )->buildMethodName( 'render-'.$slug.'-menu' ); |
55 | 55 | $callback = apply_filters( 'site-reviews/addon/submenu/callback', [$this, $method], $slug ); |
56 | - if( !is_callable( $callback ))continue; |
|
56 | + if( !is_callable( $callback ) )continue; |
|
57 | 57 | add_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, $title, $title, glsr()->constant( 'CAPABILITY' ), $slug, $callback ); |
58 | 58 | } |
59 | 59 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $this->renderPage( 'addons', [ |
69 | 69 | 'template' => glsr( Template::class ), |
70 | - ]); |
|
70 | + ] ); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -84,16 +84,16 @@ discard block |
||
84 | 84 | 'hooks' => __( 'Hooks', 'site-reviews' ), |
85 | 85 | 'functions' => __( 'Functions', 'site-reviews' ), |
86 | 86 | 'addons' => __( 'Addons', 'site-reviews' ), |
87 | - ]); |
|
87 | + ] ); |
|
88 | 88 | $addons = apply_filters( 'site-reviews/addon/documentation', [] ); |
89 | 89 | ksort( $addons ); |
90 | - if( empty( $addons )) { |
|
91 | - unset( $tabs['addons'] ); |
|
90 | + if( empty($addons) ) { |
|
91 | + unset($tabs['addons']); |
|
92 | 92 | } |
93 | 93 | $this->renderPage( 'documentation', [ |
94 | 94 | 'addons' => $addons, |
95 | 95 | 'tabs' => $tabs, |
96 | - ]); |
|
96 | + ] ); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -111,18 +111,18 @@ discard block |
||
111 | 111 | 'translations' => __( 'Translations', 'site-reviews' ), |
112 | 112 | 'addons' => __( 'Addons', 'site-reviews' ), |
113 | 113 | 'licenses' => __( 'Licenses', 'site-reviews' ), |
114 | - ]); |
|
115 | - if( empty( glsr( Helper::class )->getPathValue( 'settings.addons', glsr()->defaults ))) { |
|
116 | - unset( $tabs['addons'] ); |
|
114 | + ] ); |
|
115 | + if( empty(glsr( Helper::class )->getPathValue( 'settings.addons', glsr()->defaults )) ) { |
|
116 | + unset($tabs['addons']); |
|
117 | 117 | } |
118 | - if( empty( glsr( Helper::class )->getPathValue( 'settings.licenses', glsr()->defaults ))) { |
|
119 | - unset( $tabs['licenses'] ); |
|
118 | + if( empty(glsr( Helper::class )->getPathValue( 'settings.licenses', glsr()->defaults )) ) { |
|
119 | + unset($tabs['licenses']); |
|
120 | 120 | } |
121 | 121 | $this->renderPage( 'settings', [ |
122 | 122 | 'notices' => $this->getNotices(), |
123 | 123 | 'settings' => glsr( Settings::class ), |
124 | 124 | 'tabs' => $tabs, |
125 | - ]); |
|
125 | + ] ); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -137,24 +137,24 @@ discard block |
||
137 | 137 | 'sync' => __( 'Sync Reviews', 'site-reviews' ), |
138 | 138 | 'console' => __( 'Console', 'site-reviews' ), |
139 | 139 | 'system-info' => __( 'System Info', 'site-reviews' ), |
140 | - ]); |
|
141 | - if( !apply_filters( 'site-reviews/addon/sync/enable', false )) { |
|
142 | - unset( $tabs['sync'] ); |
|
140 | + ] ); |
|
141 | + if( !apply_filters( 'site-reviews/addon/sync/enable', false ) ) { |
|
142 | + unset($tabs['sync']); |
|
143 | 143 | } |
144 | 144 | $this->renderPage( 'tools', [ |
145 | 145 | 'data' => [ |
146 | 146 | 'context' => [ |
147 | 147 | 'base_url' => admin_url( 'edit.php?post_type='.Application::POST_TYPE ), |
148 | - 'console' => strval( glsr( Console::class )), |
|
148 | + 'console' => strval( glsr( Console::class ) ), |
|
149 | 149 | 'id' => Application::ID, |
150 | - 'system' => strval( glsr( System::class )), |
|
150 | + 'system' => strval( glsr( System::class ) ), |
|
151 | 151 | ], |
152 | 152 | 'services' => apply_filters( 'site-reviews/addon/sync/services', [] ), |
153 | 153 | ], |
154 | 154 | 'notices' => $this->getNotices(), |
155 | 155 | 'tabs' => $tabs, |
156 | 156 | 'template' => glsr( Template::class ), |
157 | - ]); |
|
157 | + ] ); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | { |
176 | 176 | return glsr( Builder::class )->div( glsr( Notice::class )->get(), [ |
177 | 177 | 'id' => 'glsr-notices', |
178 | - ]); |
|
178 | + ] ); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function handle( Command $command ) |
15 | 15 | { |
16 | - $postId = wp_update_post([ |
|
16 | + $postId = wp_update_post( [ |
|
17 | 17 | 'ID' => $command->id, |
18 | 18 | 'post_status' => $command->status, |
19 | - ]); |
|
20 | - if( is_wp_error( $postId )) { |
|
19 | + ] ); |
|
20 | + if( is_wp_error( $postId ) ) { |
|
21 | 21 | glsr_log()->error( $postId->get_error_message() ); |
22 | 22 | return []; |
23 | 23 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | 'aria-label' => '“'.esc_attr( $title ).'” ('.__( 'Edit', 'site-reviews' ).')', |
40 | 40 | 'class' => 'row-title', |
41 | 41 | 'href' => get_edit_post_link( $postId ), |
42 | - ]); |
|
42 | + ] ); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | protected function getPostState( $postId ) |
50 | 50 | { |
51 | 51 | ob_start(); |
52 | - _post_states( get_post( $postId )); |
|
52 | + _post_states( get_post( $postId ) ); |
|
53 | 53 | return ob_get_clean(); |
54 | 54 | } |
55 | 55 | |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | protected function getStatusLinks() |
60 | 60 | { |
61 | 61 | global $avail_post_stati; |
62 | - require_once( ABSPATH.'wp-admin/includes/class-wp-posts-list-table.php' ); |
|
62 | + require_once(ABSPATH.'wp-admin/includes/class-wp-posts-list-table.php'); |
|
63 | 63 | $hookName = 'edit-'.Application::POST_TYPE; |
64 | 64 | set_current_screen( $hookName ); |
65 | 65 | $avail_post_stati = get_available_post_statuses( Application::POST_TYPE ); |
66 | 66 | $table = new \WP_Posts_List_Table( ['screen' => $hookName] ); |
67 | 67 | $views = apply_filters( 'views_'.$hookName, $table->get_views() ); // uses compat get_views() |
68 | - if( empty( $views ))return; |
|
68 | + if( empty($views) )return; |
|
69 | 69 | foreach( $views as $class => $view ) { |
70 | 70 | $views[$class] = "\t<li class='$class'>$view"; |
71 | 71 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'setting' => 'Plugin Settings', |
41 | 41 | 'reviews' => 'Review Counts', |
42 | 42 | ]; |
43 | - $systemInfo = array_reduce( array_keys( $details ), function( $carry, $key ) use( $details ) { |
|
43 | + $systemInfo = array_reduce( array_keys( $details ), function( $carry, $key ) use($details) { |
|
44 | 44 | $methodName = glsr( Helper::class )->buildMethodName( 'get-'.$key.'-details' ); |
45 | 45 | if( method_exists( $this, $methodName ) && $systemDetails = $this->$methodName() ) { |
46 | 46 | return $carry.$this->implode( |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | { |
61 | 61 | $plugins = get_plugins(); |
62 | 62 | $activePlugins = (array)get_option( 'active_plugins', [] ); |
63 | - $inactive = array_diff_key( $plugins, array_flip( $activePlugins )); |
|
64 | - return $this->normalizePluginList( array_diff_key( $plugins, $inactive )); |
|
63 | + $inactive = array_diff_key( $plugins, array_flip( $activePlugins ) ); |
|
64 | + return $this->normalizePluginList( array_diff_key( $plugins, $inactive ) ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | public function getInactivePluginDetails() |
96 | 96 | { |
97 | 97 | $activePlugins = (array)get_option( 'active_plugins', [] ); |
98 | - return $this->normalizePluginList( array_diff_key( get_plugins(), array_flip( $activePlugins ))); |
|
98 | + return $this->normalizePluginList( array_diff_key( get_plugins(), array_flip( $activePlugins ) ) ); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | { |
106 | 106 | $plugins = array_merge( |
107 | 107 | get_mu_plugins(), |
108 | - get_plugins( '/../'.basename( WPMU_PLUGIN_DIR )) |
|
108 | + get_plugins( '/../'.basename( WPMU_PLUGIN_DIR ) ) |
|
109 | 109 | ); |
110 | - if( empty( $plugins ))return; |
|
110 | + if( empty($plugins) )return; |
|
111 | 111 | return $this->normalizePluginList( $plugins ); |
112 | 112 | } |
113 | 113 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function getMultisitePluginDetails() |
118 | 118 | { |
119 | - if( !is_multisite() || empty( get_site_option( 'active_sitewide_plugins', [] )))return; |
|
119 | + if( !is_multisite() || empty(get_site_option( 'active_sitewide_plugins', [] )) )return; |
|
120 | 120 | return $this->normalizePluginList( wp_get_active_network_plugins() ); |
121 | 121 | } |
122 | 122 | |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | 'Max Input Vars' => ini_get( 'max_input_vars' ), |
144 | 144 | 'Memory Limit' => ini_get( 'memory_limit' ), |
145 | 145 | 'Post Max Size' => ini_get( 'post_max_size' ), |
146 | - 'Session Cookie Path' => esc_html( ini_get( 'session.cookie_path' )), |
|
147 | - 'Session Name' => esc_html( ini_get( 'session.name' )), |
|
148 | - 'Session Save Path' => esc_html( ini_get( 'session.save_path' )), |
|
149 | - 'Session Use Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_cookies' )), true ), |
|
150 | - 'Session Use Only Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_only_cookies' )), true ), |
|
146 | + 'Session Cookie Path' => esc_html( ini_get( 'session.cookie_path' ) ), |
|
147 | + 'Session Name' => esc_html( ini_get( 'session.name' ) ), |
|
148 | + 'Session Save Path' => esc_html( ini_get( 'session.save_path' ) ), |
|
149 | + 'Session Use Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_cookies' ) ), true ), |
|
150 | + 'Session Use Only Cookies' => var_export( wp_validate_boolean( ini_get( 'session.use_only_cookies' ) ), true ), |
|
151 | 151 | 'Upload Max Filesize' => ini_get( 'upload_max_filesize' ), |
152 | 152 | ]; |
153 | 153 | } |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | { |
160 | 160 | $counts = glsr( CountsManager::class )->getCounts(); |
161 | 161 | $counts = glsr( Helper::class )->flattenArray( $counts ); |
162 | - array_walk( $counts, function( &$ratings ) use( $counts ) { |
|
163 | - if( !is_array( $ratings )) { |
|
162 | + array_walk( $counts, function( &$ratings ) use($counts) { |
|
163 | + if( !is_array( $ratings ) ) { |
|
164 | 164 | glsr_log() |
165 | 165 | ->error( '$ratings is not an array, possibly due to incorrectly imported reviews.' ) |
166 | 166 | ->debug( $ratings ) |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | ksort( $settings ); |
200 | 200 | $details = []; |
201 | 201 | foreach( $settings as $key => $value ) { |
202 | - if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key ))continue; |
|
203 | - $value = htmlspecialchars( trim( preg_replace('/\s\s+/', '\\n', $value )), ENT_QUOTES, 'UTF-8' ); |
|
202 | + if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key ) )continue; |
|
203 | + $value = htmlspecialchars( trim( preg_replace( '/\s\s+/', '\\n', $value ) ), ENT_QUOTES, 'UTF-8' ); |
|
204 | 204 | $details[$key] = $value; |
205 | 205 | } |
206 | 206 | return $details; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | { |
214 | 214 | return [ |
215 | 215 | 'Console size' => glsr( Console::class )->humanSize( '0' ), |
216 | - 'Last Rating Count' => date_i18n( 'Y-m-d H:i', glsr( OptionManager::class )->get( 'last_review_count' )), |
|
216 | + 'Last Rating Count' => date_i18n( 'Y-m-d H:i', glsr( OptionManager::class )->get( 'last_review_count' ) ), |
|
217 | 217 | 'Version (current)' => glsr()->version, |
218 | 218 | 'Version (previous)' => glsr( OptionManager::class )->get( 'version_upgraded_from' ), |
219 | 219 | ]; |
@@ -273,10 +273,10 @@ discard block |
||
273 | 273 | 'WPE_APIKEY' => 'WP Engine', |
274 | 274 | ]; |
275 | 275 | foreach( $checks as $key => $value ) { |
276 | - if( !$this->isWebhostCheckValid( $key ))continue; |
|
276 | + if( !$this->isWebhostCheckValid( $key ) )continue; |
|
277 | 277 | return $value; |
278 | 278 | } |
279 | - return implode( ',', array_filter( [DB_HOST, filter_input( INPUT_SERVER, 'SERVER_NAME' )] )); |
|
279 | + return implode( ',', array_filter( [DB_HOST, filter_input( INPUT_SERVER, 'SERVER_NAME' )] ) ); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | /** |
@@ -297,8 +297,8 @@ discard block |
||
297 | 297 | { |
298 | 298 | $plugins = get_plugins(); |
299 | 299 | $activePlugins = (array)get_option( 'active_plugins', [] ); |
300 | - $inactive = $this->normalizePluginList( array_diff_key( $plugins, array_flip( $activePlugins ))); |
|
301 | - $active = $this->normalizePluginList( array_diff_key( $plugins, $inactive )); |
|
300 | + $inactive = $this->normalizePluginList( array_diff_key( $plugins, array_flip( $activePlugins ) ) ); |
|
301 | + $active = $this->normalizePluginList( array_diff_key( $plugins, $inactive ) ); |
|
302 | 302 | return $active + $inactive; |
303 | 303 | } |
304 | 304 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | protected function implode( $title, array $details ) |
310 | 310 | { |
311 | 311 | $strings = ['['.$title.']']; |
312 | - $padding = max( array_map( 'strlen', array_keys( $details )) ); |
|
312 | + $padding = max( array_map( 'strlen', array_keys( $details ) ) ); |
|
313 | 313 | $padding = max( [$padding, static::PAD] ); |
314 | 314 | foreach( $details as $key => $value ) { |
315 | 315 | $strings[] = is_string( $key ) |
@@ -352,9 +352,9 @@ discard block |
||
352 | 352 | $keys = [ |
353 | 353 | 'licenses.', 'submissions.recaptcha.key', 'submissions.recaptcha.secret', |
354 | 354 | ]; |
355 | - array_walk( $settings, function( &$value, $setting ) use( $keys ) { |
|
355 | + array_walk( $settings, function( &$value, $setting ) use($keys) { |
|
356 | 356 | foreach( $keys as $key ) { |
357 | - if( !glsr( Helper::class )->startsWith( $key, $setting ) || empty( $value ))continue; |
|
357 | + if( !glsr( Helper::class )->startsWith( $key, $setting ) || empty($value) )continue; |
|
358 | 358 | $value = str_repeat( '•', 13 ); |
359 | 359 | return; |
360 | 360 | } |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | * @see https://wordpress.org/plugins/wp-super-cache/ |
21 | 21 | */ |
22 | 22 | add_action( 'site-reviews/review/created', function( $review, $request ) { |
23 | - if( !function_exists( 'wp_cache_post_change' ))return; |
|
23 | + if( !function_exists( 'wp_cache_post_change' ) )return; |
|
24 | 24 | wp_cache_post_change( $request->post_id ); |
25 | - if( empty( $review->assigned_to ) || $review->assigned_to == $request->post_id )return; |
|
25 | + if( empty($review->assigned_to) || $review->assigned_to == $request->post_id )return; |
|
26 | 26 | wp_cache_post_change( $review->assigned_to ); |
27 | 27 | }, 10, 2 ); |
28 | 28 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | add_filter( 'sbp_exclude_defer_scripts', function( $scriptHandles ) { |
35 | 35 | $scriptHandles[] = 'site-reviews/google-recaptcha'; |
36 | - return array_keys( array_flip( $scriptHandles )); |
|
36 | + return array_keys( array_flip( $scriptHandles ) ); |
|
37 | 37 | }); |
38 | 38 | |
39 | 39 | /** |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | * @see https://searchandfilter.com/ |
44 | 44 | */ |
45 | 45 | add_filter( 'sf_edit_query_args', function( $query ) { |
46 | - if( !empty( $query['meta_key'] ) && $query['meta_key'] == '_glsr_ranking' ) { |
|
47 | - unset( $query['meta_key'] ); |
|
46 | + if( !empty($query['meta_key']) && $query['meta_key'] == '_glsr_ranking' ) { |
|
47 | + unset($query['meta_key']); |
|
48 | 48 | $query['meta_query'] = [ |
49 | 49 | 'relation' => 'OR', |
50 | 50 | ['key' => '_glsr_ranking', 'compare' => 'EXISTS'], |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $className = str_replace( '.php', '', $file ); |
25 | 25 | $version = str_replace( ['Upgrade_', '_'], ['', '.'], $className ); |
26 | 26 | $versionSuffix = preg_replace( '/[\d.]+(.+)?/', '${1}', glsr()->version ); // allow alpha/beta versions |
27 | - if( version_compare( $this->currentVersion(), $version.$versionSuffix, '>=' ))return; |
|
27 | + if( version_compare( $this->currentVersion(), $version.$versionSuffix, '>=' ) )return; |
|
28 | 28 | glsr( 'Modules\\Upgrader\\'.$className ); |
29 | 29 | glsr_log()->info( 'Completed Upgrade for v'.$version.$versionSuffix ); |
30 | 30 | }); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $this->setReviewCounts(); |
42 | 42 | $this->updateVersionFrom( $version ); |
43 | 43 | } |
44 | - else if( !glsr( OptionManager::class )->get( 'last_review_count', false )) { |
|
44 | + else if( !glsr( OptionManager::class )->get( 'last_review_count', false ) ) { |
|
45 | 45 | $this->setReviewCounts(); |
46 | 46 | } |
47 | 47 | } |