@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function routerChangeStatus( array $request ) |
24 | 24 | { |
25 | - wp_send_json_success( $this->execute( new ChangeStatus( $request ))); |
|
25 | + wp_send_json_success( $this->execute( new ChangeStatus( $request ) ) ); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | public function routerClearConsole() |
32 | 32 | { |
33 | 33 | glsr( AdminController::class )->routerClearConsole(); |
34 | - wp_send_json_success([ |
|
34 | + wp_send_json_success( [ |
|
35 | 35 | 'console' => glsr( Console::class )->get(), |
36 | 36 | 'notices' => glsr( Notice::class )->get(), |
37 | - ]); |
|
37 | + ] ); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | public function routerCountReviews() |
44 | 44 | { |
45 | 45 | glsr( AdminController::class )->routerCountReviews(); |
46 | - wp_send_json_success([ |
|
46 | + wp_send_json_success( [ |
|
47 | 47 | 'notices' => glsr( Notice::class )->get(), |
48 | - ]); |
|
48 | + ] ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | { |
56 | 56 | $shortcode = $request['shortcode']; |
57 | 57 | $response = false; |
58 | - if( array_key_exists( $shortcode, glsr()->mceShortcodes )) { |
|
58 | + if( array_key_exists( $shortcode, glsr()->mceShortcodes ) ) { |
|
59 | 59 | $data = glsr()->mceShortcodes[$shortcode]; |
60 | - if( !empty( $data['errors'] )) { |
|
60 | + if( !empty($data['errors']) ) { |
|
61 | 61 | $data['btn_okay'] = [esc_html__( 'Okay', 'site-reviews' )]; |
62 | 62 | } |
63 | 63 | $response = [ |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | public function routerFetchConsole() |
78 | 78 | { |
79 | 79 | glsr( AdminController::class )->routerFetchConsole(); |
80 | - wp_send_json_success([ |
|
80 | + wp_send_json_success( [ |
|
81 | 81 | 'console' => glsr( Console::class )->get(), |
82 | 82 | 'notices' => glsr( Notice::class )->get(), |
83 | - ]); |
|
83 | + ] ); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | public function routerSearchPosts( array $request ) |
90 | 90 | { |
91 | 91 | $results = glsr( Database::class )->searchPosts( $request['search'] ); |
92 | - wp_send_json_success([ |
|
92 | + wp_send_json_success( [ |
|
93 | 93 | 'empty' => '<div>'.__( 'Nothing found.', 'site-reviews' ).'</div>', |
94 | 94 | 'items' => $results, |
95 | - ]); |
|
95 | + ] ); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function routerSearchTranslations( array $request ) |
102 | 102 | { |
103 | - if( empty( $request['exclude'] )) { |
|
103 | + if( empty($request['exclude']) ) { |
|
104 | 104 | $request['exclude'] = []; |
105 | 105 | } |
106 | 106 | $results = glsr( Translator::class ) |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | ->exclude() |
109 | 109 | ->exclude( $request['exclude'] ) |
110 | 110 | ->renderResults(); |
111 | - wp_send_json_success([ |
|
111 | + wp_send_json_success( [ |
|
112 | 112 | 'empty' => '<div>'.__( 'Nothing found.', 'site-reviews' ).'</div>', |
113 | 113 | 'items' => $results, |
114 | - ]); |
|
114 | + ] ); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | 'errors' => glsr( Session::class )->get( $request['form_id'].'errors', false, true ), |
125 | 125 | 'message' => glsr( Session::class )->get( $request['form_id'].'message', '', true ), |
126 | 126 | 'recaptcha' => glsr( Session::class )->get( $request['form_id'].'recaptcha', false, true ), |
127 | - 'redirect' => trim( strval( get_post_meta( intval( $request['post_id'] ), 'redirect_to', true ))), |
|
127 | + 'redirect' => trim( strval( get_post_meta( intval( $request['post_id'] ), 'redirect_to', true ) ) ), |
|
128 | 128 | ]; |
129 | - if( !wp_validate_boolean( $data['errors'] )) { |
|
129 | + if( !wp_validate_boolean( $data['errors'] ) ) { |
|
130 | 130 | glsr( Session::class )->clear(); |
131 | 131 | wp_send_json_success( $data ); |
132 | 132 | } |
@@ -138,10 +138,10 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function routerTogglePinned( array $request ) |
140 | 140 | { |
141 | - $isPinned = $this->execute( new TogglePinned( $request )); |
|
142 | - wp_send_json_success([ |
|
141 | + $isPinned = $this->execute( new TogglePinned( $request ) ); |
|
142 | + wp_send_json_success( [ |
|
143 | 143 | 'notices' => glsr( Notice::class )->get(), |
144 | 144 | 'pinned' => $isPinned, |
145 | - ]); |
|
145 | + ] ); |
|
146 | 146 | } |
147 | 147 | } |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | $review = glsr( ReviewManager::class )->create( $command ); |
18 | 18 | if( !$review ) { |
19 | 19 | glsr( Session::class )->set( $command->form_id.'errors', [] ); |
20 | - glsr( Session::class )->set( $command->form_id.'message', __( 'Your review could not be submitted and the error has been logged. Please notify the site admin.', 'site-reviews' )); |
|
20 | + glsr( Session::class )->set( $command->form_id.'message', __( 'Your review could not be submitted and the error has been logged. Please notify the site admin.', 'site-reviews' ) ); |
|
21 | 21 | return; |
22 | 22 | } |
23 | - glsr( Session::class )->set( $command->form_id.'message', __( 'Your review has been submitted!', 'site-reviews' )); |
|
23 | + glsr( Session::class )->set( $command->form_id.'message', __( 'Your review has been submitted!', 'site-reviews' ) ); |
|
24 | 24 | glsr( Notification::class )->send( $review ); |
25 | 25 | do_action( 'site-reviews/local/review/submitted', null, $command ); // @compat |
26 | 26 | do_action( 'site-reviews/review/submitted', $review ); |
27 | 27 | if( $command->ajax_request )return; |
28 | - wp_safe_redirect( $this->getReferer( $command )); |
|
28 | + wp_safe_redirect( $this->getReferer( $command ) ); |
|
29 | 29 | exit; |
30 | 30 | } |
31 | 31 | |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | */ |
35 | 35 | protected function getReferer( Command $command ) |
36 | 36 | { |
37 | - $referer = trim( strval( get_post_meta( $command->post_id, 'redirect_to', true ))); |
|
38 | - if( empty( $referer )) { |
|
37 | + $referer = trim( strval( get_post_meta( $command->post_id, 'redirect_to', true ) ) ); |
|
38 | + if( empty($referer) ) { |
|
39 | 39 | $referer = $command->referer; |
40 | 40 | } |
41 | - if( empty( $referer )) { |
|
41 | + if( empty($referer) ) { |
|
42 | 42 | glsr_log()->warning( 'The form referer ($_SERVER[REQUEST_URI]) was empty.' )->info( $command ); |
43 | 43 | $referer = home_url(); |
44 | 44 | } |