@@ -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 | $check = new GL_Plugin_Check_v3( __FILE__ ); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | $app = new GeminiLabs\SiteReviews\Application; |
32 | 32 | $app->make( 'Provider' )->register( $app ); |
33 | -register_activation_hook( __FILE__, array( $app, 'activate' )); |
|
34 | -register_deactivation_hook( __FILE__, array( $app, 'deactivate' )); |
|
35 | -register_shutdown_function( array( $app, 'catchFatalError' )); |
|
33 | +register_activation_hook( __FILE__, array( $app, 'activate' ) ); |
|
34 | +register_deactivation_hook( __FILE__, array( $app, 'deactivate' ) ); |
|
35 | +register_shutdown_function( array( $app, 'catchFatalError' ) ); |
|
36 | 36 | $app->init(); |
@@ -22,7 +22,9 @@ |
||
22 | 22 | require_once __DIR__.'/activate.php'; |
23 | 23 | } |
24 | 24 | $check = new GL_Plugin_Check_v3( __FILE__ ); |
25 | -if( !$check->canProceed() )return; |
|
25 | +if( !$check->canProceed() ) { |
|
26 | + return; |
|
27 | +} |
|
26 | 28 | require_once __DIR__.'/autoload.php'; |
27 | 29 | require_once __DIR__.'/compatibility.php'; |
28 | 30 | require_once __DIR__.'/deprecated.php'; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function enqueueAssets() |
29 | 29 | { |
30 | - if( apply_filters( 'site-reviews/assets/css', true )) { |
|
30 | + if( apply_filters( 'site-reviews/assets/css', true ) ) { |
|
31 | 31 | wp_enqueue_style( |
32 | 32 | Application::ID, |
33 | 33 | $this->getStylesheet(), |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | glsr()->version |
36 | 36 | ); |
37 | 37 | } |
38 | - if( apply_filters( 'site-reviews/assets/js', true )) { |
|
38 | + if( apply_filters( 'site-reviews/assets/js', true ) ) { |
|
39 | 39 | $dependencies = apply_filters( 'site-reviews/assets/polyfill', true ) |
40 | 40 | ? [Application::ID.'/polyfill'] |
41 | 41 | : []; |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function enqueuePolyfillService() |
57 | 57 | { |
58 | - if( !apply_filters( 'site-reviews/assets/polyfill', true ))return; |
|
59 | - wp_enqueue_script( Application::ID.'/polyfill', add_query_arg([ |
|
58 | + if( !apply_filters( 'site-reviews/assets/polyfill', true ) )return; |
|
59 | + wp_enqueue_script( Application::ID.'/polyfill', add_query_arg( [ |
|
60 | 60 | 'features' => 'CustomEvent,Element.prototype.closest,Element.prototype.dataset,Event,XMLHttpRequest,MutationObserver', |
61 | 61 | 'flags' => 'gated', |
62 | - ], 'https://polyfill.io/v3/polyfill.min.js' )); |
|
62 | + ], 'https://polyfill.io/v3/polyfill.min.js' ) ); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -72,10 +72,10 @@ discard block |
||
72 | 72 | // nf-google-recaptcha |
73 | 73 | if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return; |
74 | 74 | $language = apply_filters( 'site-reviews/recaptcha/language', get_locale() ); |
75 | - wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg([ |
|
75 | + wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg( [ |
|
76 | 76 | 'hl' => $language, |
77 | 77 | 'render' => 'explicit', |
78 | - ], 'https://www.google.com/recaptcha/api.js' )); |
|
78 | + ], 'https://www.google.com/recaptcha/api.js' ) ); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | public function inlineStyles() |
85 | 85 | { |
86 | 86 | $inlineStylesheetPath = glsr()->path( 'assets/styles/inline-styles.css' ); |
87 | - if( !apply_filters( 'site-reviews/assets/css', true ))return; |
|
88 | - if( !file_exists( $inlineStylesheetPath )) { |
|
87 | + if( !apply_filters( 'site-reviews/assets/css', true ) )return; |
|
88 | + if( !file_exists( $inlineStylesheetPath ) ) { |
|
89 | 89 | glsr_log()->error( 'Inline stylesheet is missing: '.$inlineStylesheetPath ); |
90 | 90 | return; |
91 | 91 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | protected function getFixedSelectorsForPagination() |
122 | 122 | { |
123 | - $selectors = ['#wpadminbar','.site-navigation-fixed']; |
|
123 | + $selectors = ['#wpadminbar', '.site-navigation-fixed']; |
|
124 | 124 | return apply_filters( 'site-reviews/enqueue/public/localize/ajax-pagination', $selectors ); |
125 | 125 | } |
126 | 126 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | protected function getStylesheet() |
131 | 131 | { |
132 | 132 | $currentStyle = glsr( Style::class )->style; |
133 | - return file_exists( glsr()->path( 'assets/styles/custom/'.$currentStyle.'.css' )) |
|
133 | + return file_exists( glsr()->path( 'assets/styles/custom/'.$currentStyle.'.css' ) ) |
|
134 | 134 | ? glsr()->url( 'assets/styles/custom/'.$currentStyle.'.css' ) |
135 | 135 | : glsr()->url( 'assets/styles/'.Application::ID.'.css' ); |
136 | 136 | } |
@@ -55,7 +55,9 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function enqueuePolyfillService() |
57 | 57 | { |
58 | - if( !apply_filters( 'site-reviews/assets/polyfill', true ))return; |
|
58 | + if( !apply_filters( 'site-reviews/assets/polyfill', true )) { |
|
59 | + return; |
|
60 | + } |
|
59 | 61 | wp_enqueue_script( Application::ID.'/polyfill', add_query_arg([ |
60 | 62 | 'features' => 'CustomEvent,Element.prototype.closest,Element.prototype.dataset,Event,XMLHttpRequest,MutationObserver', |
61 | 63 | 'flags' => 'gated', |
@@ -70,7 +72,9 @@ discard block |
||
70 | 72 | // wpforms-recaptcha |
71 | 73 | // google-recaptcha |
72 | 74 | // nf-google-recaptcha |
73 | - if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return; |
|
75 | + if( !glsr( OptionManager::class )->isRecaptchaEnabled() ) { |
|
76 | + return; |
|
77 | + } |
|
74 | 78 | $language = apply_filters( 'site-reviews/recaptcha/language', get_locale() ); |
75 | 79 | wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg([ |
76 | 80 | 'hl' => $language, |
@@ -84,7 +88,9 @@ discard block |
||
84 | 88 | public function inlineStyles() |
85 | 89 | { |
86 | 90 | $inlineStylesheetPath = glsr()->path( 'assets/styles/inline-styles.css' ); |
87 | - if( !apply_filters( 'site-reviews/assets/css', true ))return; |
|
91 | + if( !apply_filters( 'site-reviews/assets/css', true )) { |
|
92 | + return; |
|
93 | + } |
|
88 | 94 | if( !file_exists( $inlineStylesheetPath )) { |
89 | 95 | glsr_log()->error( 'Inline stylesheet is missing: '.$inlineStylesheetPath ); |
90 | 96 | return; |