@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php defined( 'WPINC' ) || die; |
2 | 2 | |
3 | -include trailingslashit(__DIR__).'header.php'; |
|
4 | -include trailingslashit(__DIR__).'body.php'; |
|
5 | -include trailingslashit(__DIR__).'footer.php'; |
|
3 | +include trailingslashit( __DIR__ ).'header.php'; |
|
4 | +include trailingslashit( __DIR__ ).'body.php'; |
|
5 | +include trailingslashit( __DIR__ ).'footer.php'; |
@@ -4,6 +4,6 @@ |
||
4 | 4 | <html> |
5 | 5 | <head> |
6 | 6 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
7 | - <title><?= wp_specialchars_decode( (string) get_option( 'blogname', '' ), ENT_QUOTES ); ?></title> |
|
7 | + <title><?= wp_specialchars_decode( (string)get_option( 'blogname', '' ), ENT_QUOTES ); ?></title> |
|
8 | 8 | </head> |
9 | 9 | <body> |
@@ -7,17 +7,17 @@ |
||
7 | 7 | <?php |
8 | 8 | |
9 | 9 | $html->renderNotices(); |
10 | - $html->renderPartial( 'tabs' , [ |
|
10 | + $html->renderPartial( 'tabs', [ |
|
11 | 11 | 'page' => $page, |
12 | 12 | 'tab' => $currentTab, |
13 | 13 | 'tabs' => $tabs, |
14 | - ]); |
|
15 | - $html->renderPartial( 'sections' , [ |
|
14 | + ] ); |
|
15 | + $html->renderPartial( 'sections', [ |
|
16 | 16 | 'page' => $page, |
17 | 17 | 'section' => $currentSection, |
18 | 18 | 'tab' => $currentTab, |
19 | 19 | 'tabs' => $tabs, |
20 | - ]); |
|
20 | + ] ); |
|
21 | 21 | $file = $currentSection ? $currentTab.'/'.$currentSection : $currentTab; |
22 | 22 | $file = trailingslashit( __DIR__ ).$page.'/'.$file.'.php'; |
23 | 23 | $file = apply_filters( 'site-reviews/addon/views/file', $file, $view, $data ); |
@@ -3,7 +3,7 @@ |
||
3 | 3 | <p>{{ data.s1 }}</p> |
4 | 4 | <p>{{ data.p1 }}</p> |
5 | 5 | <p class="row-actions"> |
6 | - <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
6 | + <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
7 | 7 | </p> |
8 | 8 | <button type="button" class="toggle-row"> |
9 | 9 | <span class="screen-reader-text"><?= __( 'Show custom translation', 'site-reviews' ); ?></span> |
@@ -2,7 +2,7 @@ |
||
2 | 2 | <td class="glsr-string-td1 column-primary"> |
3 | 3 | <p>{{ data.s1 }}</p> |
4 | 4 | <p class="row-actions"> |
5 | - <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
5 | + <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
6 | 6 | </p> |
7 | 7 | <button type="button" class="toggle-row"> |
8 | 8 | <span class="screen-reader-text"><?= __( 'Show custom translation', 'site-reviews' ); ?></span> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | </ul> |
21 | 21 | </div> |
22 | 22 | |
23 | - <?php if( current_user_can( $taxonomy->cap->edit_terms )) : ?> |
|
23 | + <?php if( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
|
24 | 24 | <div id="<?= $tax_name; ?>-adder" class="wp-hidden-children"> |
25 | 25 | <a id="<?= $tax_name; ?>-add-toggle" href="#<?= $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new"> |
26 | 26 | <?= sprintf( '+ %s', $taxonomy->labels->add_new_item ); ?> |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | <label class="screen-reader-text" for="new<?= $tax_name; ?>"><?= $taxonomy->labels->add_new_item; ?></label> |
30 | 30 | <input type="text" name="new<?= $tax_name; ?>" id="new<?= $tax_name; ?>" class="form-required form-input-tip" value="<?= esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/> |
31 | 31 | <input type="button" id="<?= $tax_name; ?>-add-submit" data-wp-lists="add:<?= $tax_name; ?>checklist:<?= $tax_name; ?>-add" class="button category-add-submit" value="<?= esc_attr( $taxonomy->labels->add_new_item ); ?>" /> |
32 | - <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?> |
|
32 | + <?php wp_nonce_field( 'add-'.$tax_name, '_ajax_nonce-add-'.$tax_name, false ); ?> |
|
33 | 33 | <span id="<?= $tax_name; ?>-ajax-response"></span> |
34 | 34 | </div> |
35 | 35 | </div> |
@@ -2,31 +2,31 @@ |
||
2 | 2 | |
3 | 3 | $render->rating( 'rating', [ |
4 | 4 | 'label' => __( 'Your overall rating', 'site-reviews' ), |
5 | -]); |
|
5 | +] ); |
|
6 | 6 | $render->text( 'title', [ |
7 | 7 | 'label' => __( 'Title of your review', 'site-reviews' ), |
8 | 8 | 'placeholder' => __( 'Summarize your review or highlight an interesting detail', 'site-reviews' ), |
9 | -]); |
|
9 | +] ); |
|
10 | 10 | $render->textarea( 'content', [ |
11 | 11 | 'label' => __( 'Your review', 'site-reviews' ), |
12 | 12 | 'placeholder' => __( 'Tell people your review', 'site-reviews' ), |
13 | -]); |
|
13 | +] ); |
|
14 | 14 | $render->text( 'name', [ |
15 | 15 | 'label' => __( 'Your name', 'site-reviews' ), |
16 | 16 | 'placeholder' => __( 'Tell us your name', 'site-reviews' ), |
17 | -]); |
|
17 | +] ); |
|
18 | 18 | $render->email( 'email', [ |
19 | 19 | 'label' => __( 'Your email', 'site-reviews' ), |
20 | 20 | 'placeholder' => __( 'Tell us your email', 'site-reviews' ), |
21 | -]); |
|
21 | +] ); |
|
22 | 22 | $render->checkbox( 'terms', [ |
23 | 23 | 'label' => __( 'This review is based on my own experience and is my genuine opinion.', 'site-reviews' ), |
24 | -]); |
|
24 | +] ); |
|
25 | 25 | $render->honeypot( 'gotcha' ); |
26 | 26 | $render->hidden( 'assign_to' ); |
27 | 27 | $render->hidden( 'category' ); |
28 | 28 | $render->hidden( 'excluded' ); |
29 | 29 | $render->hidden( 'id' ); |
30 | 30 | wp_nonce_field( 'post-review' ); |
31 | -$render->submit( __( 'Submit your review', 'site-reviews' )); |
|
31 | +$render->submit( __( 'Submit your review', 'site-reviews' ) ); |
|
32 | 32 | $render->result(); |
@@ -197,7 +197,7 @@ |
||
197 | 197 | 'type' => 'text', |
198 | 198 | ], |
199 | 199 | 'settings.submissions.required' => [ |
200 | - 'default' => ['title','content','name','email'], |
|
200 | + 'default' => ['title', 'content', 'name', 'email'], |
|
201 | 201 | 'label' => __( 'Required Fields', 'site-reviews' ), |
202 | 202 | 'options' => [ |
203 | 203 | 'title' => __( 'Title', 'site-reviews' ), |
@@ -16,7 +16,9 @@ discard block |
||
16 | 16 | public function routeAdminPostRequest() |
17 | 17 | { |
18 | 18 | $request = filter_input( INPUT_POST, Application::ID, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); |
19 | - if( !isset( $request['action'] ))return; |
|
19 | + if( !isset( $request['action'] )) { |
|
20 | + return; |
|
21 | + } |
|
20 | 22 | $this->checkNonce( $request['action'] ); |
21 | 23 | switch( $request['action'] ) { |
22 | 24 | case 'clear-log': |
@@ -75,7 +77,9 @@ discard block |
||
75 | 77 | public function routeWebhookRequest() |
76 | 78 | { |
77 | 79 | $request = filter_input( INPUT_GET, sprintf( '%s-hook', Application::ID )); |
78 | - if( !$request )return; |
|
80 | + if( !$request ) { |
|
81 | + return; |
|
82 | + } |
|
79 | 83 | // @todo manage webhook here |
80 | 84 | } |
81 | 85 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function routeAdminPostRequest() |
17 | 17 | { |
18 | 18 | $request = filter_input( INPUT_POST, Application::ID, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); |
19 | - if( !isset( $request['action'] ))return; |
|
19 | + if( !isset($request['action']) )return; |
|
20 | 20 | $this->checkNonce( $request['action'] ); |
21 | 21 | switch( $request['action'] ) { |
22 | 22 | case 'clear-log': |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | public function routeAjaxRequest() |
43 | 43 | { |
44 | 44 | $request = $this->normalizeAjaxRequest(); |
45 | - if( !wp_verify_nonce( $request['nonce'], $request['action'] )) { |
|
45 | + if( !wp_verify_nonce( $request['nonce'], $request['action'] ) ) { |
|
46 | 46 | glsr_log()->error( 'Nonce check failed for ajax request' )->info( $request ); |
47 | 47 | wp_die( -1, 403 ); |
48 | 48 | } |
49 | 49 | $controller = glsr( AjaxController::class ); |
50 | 50 | $method = glsr( Helper::class )->buildMethodName( $request['action'] ); |
51 | - if( is_callable( [$controller, $method] )) { |
|
51 | + if( is_callable( [$controller, $method] ) ) { |
|
52 | 52 | call_user_func( [$controller, $method], $request ); |
53 | 53 | } |
54 | 54 | else { |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function routePublicPostRequest() |
64 | 64 | { |
65 | - switch( filter_input( INPUT_POST, 'action' )) { |
|
65 | + switch( filter_input( INPUT_POST, 'action' ) ) { |
|
66 | 66 | case 'submit-review': |
67 | - glsr( PublicController::class )->routerCreateReview( $this->normalize( $_POST )); |
|
67 | + glsr( PublicController::class )->routerCreateReview( $this->normalize( $_POST ) ); |
|
68 | 68 | break; |
69 | 69 | } |
70 | 70 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function routeWebhookRequest() |
76 | 76 | { |
77 | - $request = filter_input( INPUT_GET, sprintf( '%s-hook', Application::ID )); |
|
77 | + $request = filter_input( INPUT_GET, sprintf( '%s-hook', Application::ID ) ); |
|
78 | 78 | if( !$request )return; |
79 | 79 | // @todo manage webhook here |
80 | 80 | } |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | protected function normalizeAjaxRequest() |
113 | 113 | { |
114 | 114 | $request = filter_input( INPUT_POST, 'request', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); |
115 | - if( isset( $request[Application::ID]['action'] )) { |
|
115 | + if( isset($request[Application::ID]['action']) ) { |
|
116 | 116 | $request = $request[Application::ID]; |
117 | 117 | } |
118 | - if( !isset( $request['action'] )) { |
|
118 | + if( !isset($request['action']) ) { |
|
119 | 119 | glsr_log()->error( 'The AJAX request must include an action' )->info( $request ); |
120 | 120 | wp_die(); |
121 | 121 | } |
122 | - if( !isset( $request['nonce'] )) { |
|
122 | + if( !isset($request['nonce']) ) { |
|
123 | 123 | glsr_log()->error( 'The AJAX request must include a nonce' )->info( $request ); |
124 | 124 | wp_die(); |
125 | 125 | } |