@@ -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 { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function routeWebhookRequest() |
| 80 | 80 | { |
| 81 | - $request = filter_input( INPUT_GET, sprintf( '%s-hook', Application::ID )); |
|
| 81 | + $request = filter_input( INPUT_GET, sprintf( '%s-hook', Application::ID ) ); |
|
| 82 | 82 | if( !$request )return; |
| 83 | 83 | // @todo manage webhook here |
| 84 | 84 | } |
@@ -116,14 +116,14 @@ discard block |
||
| 116 | 116 | protected function normalizeAjaxRequest() |
| 117 | 117 | { |
| 118 | 118 | $request = filter_input( INPUT_POST, 'request', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); |
| 119 | - if( isset( $request[Application::ID]['action'] )) { |
|
| 119 | + if( isset($request[Application::ID]['action']) ) { |
|
| 120 | 120 | $request = $request[Application::ID]; |
| 121 | 121 | } |
| 122 | - if( !isset( $request['action'] )) { |
|
| 122 | + if( !isset($request['action']) ) { |
|
| 123 | 123 | glsr_log()->error( 'The AJAX request must include an action' )->info( $request ); |
| 124 | 124 | wp_die(); |
| 125 | 125 | } |
| 126 | - if( !isset( $request['nonce'] )) { |
|
| 126 | + if( !isset($request['nonce']) ) { |
|
| 127 | 127 | glsr_log()->error( 'The AJAX request must include a nonce' )->info( $request ); |
| 128 | 128 | wp_die(); |
| 129 | 129 | } |
@@ -20,22 +20,22 @@ discard block |
||
| 20 | 20 | 'class' => 'widefat', |
| 21 | 21 | 'label' => __( 'Title', 'site-reviews' ), |
| 22 | 22 | 'name' => 'title', |
| 23 | - ]); |
|
| 23 | + ] ); |
|
| 24 | 24 | if( count( glsr()->reviewTypes ) > 1 ) { |
| 25 | 25 | $this->renderField( 'select', [ |
| 26 | 26 | 'class' => 'widefat', |
| 27 | 27 | 'label' => __( 'Which type of review would you like to use?', 'site-reviews' ), |
| 28 | 28 | 'name' => 'type', |
| 29 | 29 | 'options' => ['' => __( 'All review types', 'site-reviews' )] + glsr()->reviewTypes, |
| 30 | - ]); |
|
| 30 | + ] ); |
|
| 31 | 31 | } |
| 32 | - if( !empty( $terms )) { |
|
| 32 | + if( !empty($terms) ) { |
|
| 33 | 33 | $this->renderField( 'select', [ |
| 34 | 34 | 'class' => 'widefat', |
| 35 | 35 | 'label' => __( 'Limit summary to this category', 'site-reviews' ), |
| 36 | 36 | 'name' => 'category', |
| 37 | 37 | 'options' => ['' => __( 'All Categories', 'site-reviews' )] + $terms, |
| 38 | - ]); |
|
| 38 | + ] ); |
|
| 39 | 39 | } |
| 40 | 40 | $this->renderField( 'text', [ |
| 41 | 41 | 'class' => 'widefat', |
@@ -43,12 +43,12 @@ discard block |
||
| 43 | 43 | 'description' => sprintf( __( "Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews' ), '<code>post_id</code>' ), |
| 44 | 44 | 'label' => __( 'Limit summary to reviews assigned to a page/post ID', 'site-reviews' ), |
| 45 | 45 | 'name' => 'assigned_to', |
| 46 | - ]); |
|
| 46 | + ] ); |
|
| 47 | 47 | $this->renderField( 'text', [ |
| 48 | 48 | 'class' => 'widefat', |
| 49 | 49 | 'label' => __( 'Enter any custom CSS classes here', 'site-reviews' ), |
| 50 | 50 | 'name' => 'class', |
| 51 | - ]); |
|
| 51 | + ] ); |
|
| 52 | 52 | $this->renderField( 'checkbox', [ |
| 53 | 53 | 'name' => 'hide', |
| 54 | 54 | 'options' => [ |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | 'summary' => __( 'Hide the summary text?', 'site-reviews' ), |
| 59 | 59 | 'if_empty' => __( 'Hide the summary if no reviews are found?', 'site-reviews' ), |
| 60 | 60 | ], |
| 61 | - ]); |
|
| 61 | + ] ); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |