@@ -611,14 +611,14 @@ discard block |
||
611 | 611 | |
612 | 612 | if ( $child instanceof WordPoints_Entity_Attr ) { |
613 | 613 | |
614 | - $child_data[ $child_slug ]['_type'] = 'attr'; |
|
615 | - $child_data[ $child_slug ]['data_type'] = $child->get_data_type(); |
|
614 | + $child_data[ $child_slug ][ '_type' ] = 'attr'; |
|
615 | + $child_data[ $child_slug ][ 'data_type' ] = $child->get_data_type(); |
|
616 | 616 | |
617 | 617 | } elseif ( $child instanceof WordPoints_Entity_Relationship ) { |
618 | 618 | |
619 | - $child_data[ $child_slug ]['_type'] = 'relationship'; |
|
620 | - $child_data[ $child_slug ]['primary'] = $child->get_primary_entity_slug(); |
|
621 | - $child_data[ $child_slug ]['secondary'] = $child->get_related_entity_slug(); |
|
619 | + $child_data[ $child_slug ][ '_type' ] = 'relationship'; |
|
620 | + $child_data[ $child_slug ][ 'primary' ] = $child->get_primary_entity_slug(); |
|
621 | + $child_data[ $child_slug ][ 'secondary' ] = $child->get_related_entity_slug(); |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | /** |
@@ -650,14 +650,14 @@ discard block |
||
650 | 650 | |
651 | 651 | foreach ( $entity->get_enumerated_values() as $value ) { |
652 | 652 | if ( $entity->set_the_value( $value ) ) { |
653 | - $values[] = array( |
|
653 | + $values[ ] = array( |
|
654 | 654 | 'value' => $entity->get_the_id(), |
655 | 655 | 'label' => $entity->get_the_human_id(), |
656 | 656 | ); |
657 | 657 | } |
658 | 658 | } |
659 | 659 | |
660 | - $entities_data[ $slug ]['values'] = $values; |
|
660 | + $entities_data[ $slug ][ 'values' ] = $values; |
|
661 | 661 | } |
662 | 662 | |
663 | 663 | /** |
@@ -789,9 +789,9 @@ discard block |
||
789 | 789 | |
790 | 790 | $args = array_merge( $defaults, $args ); |
791 | 791 | |
792 | - if ( isset( $args['dismissable'] ) ) { |
|
792 | + if ( isset( $args[ 'dismissable' ] ) ) { |
|
793 | 793 | |
794 | - $args['dismissible'] = $args['dismissable']; |
|
794 | + $args[ 'dismissible' ] = $args[ 'dismissable' ]; |
|
795 | 795 | |
796 | 796 | _deprecated_argument( |
797 | 797 | __FUNCTION__ |
@@ -811,26 +811,26 @@ discard block |
||
811 | 811 | ); |
812 | 812 | } |
813 | 813 | |
814 | - if ( $args['dismissible'] && $args['option'] ) { |
|
814 | + if ( $args[ 'dismissible' ] && $args[ 'option' ] ) { |
|
815 | 815 | wp_enqueue_script( 'wordpoints-admin-dismiss-notice' ); |
816 | 816 | } |
817 | 817 | |
818 | 818 | ?> |
819 | 819 | |
820 | 820 | <div |
821 | - class="notice notice-<?php echo sanitize_html_class( $type, 'success' ); ?><?php echo ( $args['dismissible'] ) ? ' is-dismissible' : ''; ?>" |
|
822 | - <?php if ( $args['dismissible'] && $args['option'] ) : ?> |
|
823 | - data-nonce="<?php echo esc_attr( wp_create_nonce( "wordpoints_dismiss_notice-{$args['option']}" ) ); ?>" |
|
824 | - data-option="<?php echo esc_attr( $args['option'] ); ?>" |
|
821 | + class="notice notice-<?php echo sanitize_html_class( $type, 'success' ); ?><?php echo ( $args[ 'dismissible' ] ) ? ' is-dismissible' : ''; ?>" |
|
822 | + <?php if ( $args[ 'dismissible' ] && $args[ 'option' ] ) : ?> |
|
823 | + data-nonce="<?php echo esc_attr( wp_create_nonce( "wordpoints_dismiss_notice-{$args[ 'option' ]}" ) ); ?>" |
|
824 | + data-option="<?php echo esc_attr( $args[ 'option' ] ); ?>" |
|
825 | 825 | <?php endif; ?> |
826 | 826 | > |
827 | 827 | <p> |
828 | 828 | <?php echo wp_kses( $message, 'wordpoints_admin_message' ); ?> |
829 | 829 | </p> |
830 | - <?php if ( $args['dismissible'] && $args['option'] ) : ?> |
|
830 | + <?php if ( $args[ 'dismissible' ] && $args[ 'option' ] ) : ?> |
|
831 | 831 | <form method="post" class="wordpoints-notice-dismiss-form" style="padding-bottom: 5px;"> |
832 | - <input type="hidden" name="wordpoints_notice" value="<?php echo esc_html( $args['option'] ); ?>" /> |
|
833 | - <?php wp_nonce_field( "wordpoints_dismiss_notice-{$args['option']}" ); ?> |
|
832 | + <input type="hidden" name="wordpoints_notice" value="<?php echo esc_html( $args[ 'option' ] ); ?>" /> |
|
833 | + <?php wp_nonce_field( "wordpoints_dismiss_notice-{$args[ 'option' ]}" ); ?> |
|
834 | 834 | <?php submit_button( __( 'Hide This Notice', 'wordpoints' ), 'secondary', 'wordpoints_dismiss_notice', false ); ?> |
835 | 835 | </form> |
836 | 836 | <?php endif; ?> |
@@ -853,9 +853,9 @@ discard block |
||
853 | 853 | |
854 | 854 | $tab = ''; |
855 | 855 | |
856 | - if ( isset( $_GET['tab'] ) ) { // WPCS: CSRF OK. |
|
856 | + if ( isset( $_GET[ 'tab' ] ) ) { // WPCS: CSRF OK. |
|
857 | 857 | |
858 | - $tab = sanitize_key( $_GET['tab'] ); // WPCS: CSRF OK. |
|
858 | + $tab = sanitize_key( $_GET[ 'tab' ] ); // WPCS: CSRF OK. |
|
859 | 859 | } |
860 | 860 | |
861 | 861 | if ( isset( $tabs ) && ! isset( $tabs[ $tab ] ) ) { |
@@ -892,8 +892,8 @@ discard block |
||
892 | 892 | |
893 | 893 | $page = ''; |
894 | 894 | |
895 | - if ( isset( $_GET['page'] ) ) { // WPCS: CSRF OK. |
|
896 | - $page = sanitize_key( $_GET['page'] ); // WPCS: CSRF OK. |
|
895 | + if ( isset( $_GET[ 'page' ] ) ) { // WPCS: CSRF OK. |
|
896 | + $page = sanitize_key( $_GET[ 'page' ] ); // WPCS: CSRF OK. |
|
897 | 897 | } |
898 | 898 | |
899 | 899 | foreach ( $tabs as $tab => $name ) { |
@@ -1034,7 +1034,7 @@ discard block |
||
1034 | 1034 | |
1035 | 1035 | $info = wordpoints_get_module_data( $file, false, false ); |
1036 | 1036 | |
1037 | - if ( ! empty( $info['name'] ) ) { |
|
1037 | + if ( ! empty( $info[ 'name' ] ) ) { |
|
1038 | 1038 | $source = new WP_Error( |
1039 | 1039 | 'wordpoints_module_archive_not_plugin' |
1040 | 1040 | , $source->get_error_message() |
@@ -1174,9 +1174,9 @@ discard block |
||
1174 | 1174 | , 'post' |
1175 | 1175 | ); |
1176 | 1176 | |
1177 | - if ( $is_notice_dismissed && isset( $_POST['wordpoints_notice'] ) ) { |
|
1177 | + if ( $is_notice_dismissed && isset( $_POST[ 'wordpoints_notice' ] ) ) { |
|
1178 | 1178 | |
1179 | - $option = sanitize_key( $_POST['wordpoints_notice'] ); |
|
1179 | + $option = sanitize_key( $_POST[ 'wordpoints_notice' ] ); |
|
1180 | 1180 | |
1181 | 1181 | if ( ! is_network_admin() && 'wordpoints_incompatible_modules' === $option ) { |
1182 | 1182 | delete_option( $option ); |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | */ |
1232 | 1232 | function wordpoints_admin_ajax_breaking_module_check() { |
1233 | 1233 | |
1234 | - if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK. |
|
1234 | + if ( ! isset( $_GET[ 'wordpoints_module_check' ] ) ) { // WPCS: CSRF OK. |
|
1235 | 1235 | wp_die( '', 400 ); |
1236 | 1236 | } |
1237 | 1237 | |
@@ -1241,12 +1241,12 @@ discard block |
||
1241 | 1241 | $nonce = get_option( 'wordpoints_module_check_nonce' ); |
1242 | 1242 | } |
1243 | 1243 | |
1244 | - if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK. |
|
1244 | + if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET[ 'wordpoints_module_check' ] ) ) ) { // WPCS: CSRF OK. |
|
1245 | 1245 | wp_die( '', 403 ); |
1246 | 1246 | } |
1247 | 1247 | |
1248 | 1248 | // The list table constructor calls WP_Screen::get(), which expects this. |
1249 | - $GLOBALS['hook_suffix'] = null; |
|
1249 | + $GLOBALS[ 'hook_suffix' ] = null; |
|
1250 | 1250 | |
1251 | 1251 | wordpoints_admin_screen_modules(); |
1252 | 1252 |
@@ -853,7 +853,8 @@ discard block |
||
853 | 853 | |
854 | 854 | $tab = ''; |
855 | 855 | |
856 | - if ( isset( $_GET['tab'] ) ) { // WPCS: CSRF OK. |
|
856 | + if ( isset( $_GET['tab'] ) ) { |
|
857 | +// WPCS: CSRF OK. |
|
857 | 858 | |
858 | 859 | $tab = sanitize_key( $_GET['tab'] ); // WPCS: CSRF OK. |
859 | 860 | } |
@@ -892,7 +893,8 @@ discard block |
||
892 | 893 | |
893 | 894 | $page = ''; |
894 | 895 | |
895 | - if ( isset( $_GET['page'] ) ) { // WPCS: CSRF OK. |
|
896 | + if ( isset( $_GET['page'] ) ) { |
|
897 | +// WPCS: CSRF OK. |
|
896 | 898 | $page = sanitize_key( $_GET['page'] ); // WPCS: CSRF OK. |
897 | 899 | } |
898 | 900 | |
@@ -1231,7 +1233,8 @@ discard block |
||
1231 | 1233 | */ |
1232 | 1234 | function wordpoints_admin_ajax_breaking_module_check() { |
1233 | 1235 | |
1234 | - if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK. |
|
1236 | + if ( ! isset( $_GET['wordpoints_module_check'] ) ) { |
|
1237 | +// WPCS: CSRF OK. |
|
1235 | 1238 | wp_die( '', 400 ); |
1236 | 1239 | } |
1237 | 1240 | |
@@ -1241,7 +1244,8 @@ discard block |
||
1241 | 1244 | $nonce = get_option( 'wordpoints_module_check_nonce' ); |
1242 | 1245 | } |
1243 | 1246 | |
1244 | - if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK. |
|
1247 | + if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { |
|
1248 | +// WPCS: CSRF OK. |
|
1245 | 1249 | wp_die( '', 403 ); |
1246 | 1250 | } |
1247 | 1251 |
@@ -13,15 +13,15 @@ |
||
13 | 13 | |
14 | 14 | if ( |
15 | 15 | 'components' !== wordpoints_admin_get_current_tab() |
16 | - || ! isset( $_POST['wordpoints_component'], $_POST['wordpoints_component_action'], $_POST['_wpnonce'] ) |
|
16 | + || ! isset( $_POST[ 'wordpoints_component' ], $_POST[ 'wordpoints_component_action' ], $_POST[ '_wpnonce' ] ) |
|
17 | 17 | ) { |
18 | 18 | return; |
19 | 19 | } |
20 | 20 | |
21 | 21 | $components = WordPoints_Components::instance(); |
22 | -$component = sanitize_key( $_POST['wordpoints_component'] ); |
|
22 | +$component = sanitize_key( $_POST[ 'wordpoints_component' ] ); |
|
23 | 23 | |
24 | -$action = sanitize_key( $_POST['wordpoints_component_action'] ); |
|
24 | +$action = sanitize_key( $_POST[ 'wordpoints_component_action' ] ); |
|
25 | 25 | |
26 | 26 | check_admin_referer( "wordpoints_{$action}_component-{$component}" ); |
27 | 27 |
@@ -12,13 +12,13 @@ |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | if ( |
15 | - isset( $_POST['wordpoints_settings_nonce'], $_POST['excluded_users'] ) |
|
15 | + isset( $_POST[ 'wordpoints_settings_nonce' ], $_POST[ 'excluded_users' ] ) |
|
16 | 16 | && wordpoints_verify_nonce( 'wordpoints_settings_nonce', 'wordpoints_settings_submit', null, 'post' ) |
17 | 17 | ) { |
18 | 18 | |
19 | 19 | // - The form has been submitted. |
20 | 20 | |
21 | - $excluded_users = preg_replace( '/\s/', '', sanitize_text_field( wp_unslash( $_POST['excluded_users'] ) ) ); |
|
21 | + $excluded_users = preg_replace( '/\s/', '', sanitize_text_field( wp_unslash( $_POST[ 'excluded_users' ] ) ) ); |
|
22 | 22 | |
23 | 23 | if ( ! empty( $excluded_users ) ) { |
24 | 24 |
@@ -25,22 +25,22 @@ discard block |
||
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | -if ( isset( $_GET['error'] ) ) { |
|
28 | +if ( isset( $_GET[ 'error' ] ) ) { |
|
29 | 29 | |
30 | - if ( isset( $_GET['main'] ) ) { |
|
30 | + if ( isset( $_GET[ 'main' ] ) ) { |
|
31 | 31 | |
32 | 32 | wordpoints_show_admin_error( |
33 | 33 | esc_html__( 'You cannot delete a module while it is active on the main site.', 'wordpoints' ) |
34 | 34 | , array( 'dismissible' => true ) |
35 | 35 | ); |
36 | 36 | |
37 | - } elseif ( isset( $_GET['charsout'] ) ) { |
|
37 | + } elseif ( isset( $_GET[ 'charsout' ] ) ) { |
|
38 | 38 | |
39 | 39 | wordpoints_show_admin_message( |
40 | 40 | sprintf( |
41 | 41 | // translators: Number of characters. |
42 | 42 | __( 'The module generated %d characters of <strong>unexpected output</strong> during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this module.', 'wordpoints' ) |
43 | - , (int) $_GET['charsout'] // WPCS: CSRF OK. |
|
43 | + , (int) $_GET[ 'charsout' ] // WPCS: CSRF OK. |
|
44 | 44 | ) |
45 | 45 | , 'warning' |
46 | 46 | , array( 'dismissible' => true ) |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | $error_message = __( 'Module could not be activated because it triggered a <strong>fatal error</strong>.', 'wordpoints' ); |
52 | 52 | |
53 | 53 | if ( |
54 | - isset( $_GET['_error_nonce'], $_GET['module'] ) |
|
54 | + isset( $_GET[ '_error_nonce' ], $_GET[ 'module' ] ) |
|
55 | 55 | && wordpoints_verify_nonce( '_error_nonce', 'module-activation-error_%s', array( 'module' ) ) |
56 | 56 | ) { |
57 | 57 | |
58 | 58 | $url = self_admin_url( |
59 | 59 | 'admin.php?page=wordpoints_modules&action=error_scrape&module=' |
60 | - . sanitize_text_field( wp_unslash( $_GET['module'] ) ) |
|
61 | - . '&_wpnonce=' . sanitize_key( $_GET['_error_nonce'] ) |
|
60 | + . sanitize_text_field( wp_unslash( $_GET[ 'module' ] ) ) |
|
61 | + . '&_wpnonce=' . sanitize_key( $_GET[ '_error_nonce' ] ) |
|
62 | 62 | ); |
63 | 63 | |
64 | 64 | ?> |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | } // End if ( main error ) elseif ( unexpected output error ) else. |
84 | 84 | |
85 | -} elseif ( isset( $_GET['deleted'] ) ) { |
|
85 | +} elseif ( isset( $_GET[ 'deleted' ] ) ) { |
|
86 | 86 | |
87 | 87 | $user_id = get_current_user_id(); |
88 | 88 | $delete_result = get_transient( 'wordpoints_modules_delete_result_' . $user_id ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ); |
111 | 111 | } |
112 | 112 | |
113 | -} elseif ( isset( $_GET['activate'] ) ) { |
|
113 | +} elseif ( isset( $_GET[ 'activate' ] ) ) { |
|
114 | 114 | |
115 | 115 | wordpoints_show_admin_message( |
116 | 116 | __( 'Module <strong>activated</strong>.', 'wordpoints' ) |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | , array( 'dismissible' => true ) |
119 | 119 | ); |
120 | 120 | |
121 | -} elseif ( isset( $_GET['activate-multi'] ) ) { |
|
121 | +} elseif ( isset( $_GET[ 'activate-multi' ] ) ) { |
|
122 | 122 | |
123 | 123 | wordpoints_show_admin_message( |
124 | 124 | __( 'Selected modules <strong>activated</strong>.', 'wordpoints' ) |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | , array( 'dismissible' => true ) |
127 | 127 | ); |
128 | 128 | |
129 | -} elseif ( isset( $_GET['deactivate'] ) ) { |
|
129 | +} elseif ( isset( $_GET[ 'deactivate' ] ) ) { |
|
130 | 130 | |
131 | 131 | wordpoints_show_admin_message( |
132 | 132 | __( 'Module <strong>deactivated</strong>.', 'wordpoints' ) |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | , array( 'dismissible' => true ) |
135 | 135 | ); |
136 | 136 | |
137 | -} elseif ( isset( $_GET['deactivate-multi'] ) ) { |
|
137 | +} elseif ( isset( $_GET[ 'deactivate-multi' ] ) ) { |
|
138 | 138 | |
139 | 139 | wordpoints_show_admin_message( |
140 | 140 | __( 'Selected modules <strong>deactivated</strong>.', 'wordpoints' ) |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | , array( 'dismissible' => true ) |
143 | 143 | ); |
144 | 144 | |
145 | -} elseif ( isset( $_REQUEST['action'] ) && 'update-selected' === sanitize_key( $_REQUEST['action'] ) ) { |
|
145 | +} elseif ( isset( $_REQUEST[ 'action' ] ) && 'update-selected' === sanitize_key( $_REQUEST[ 'action' ] ) ) { |
|
146 | 146 | |
147 | 147 | wordpoints_show_admin_message( |
148 | 148 | esc_html__( 'No out of date modules were selected.', 'wordpoints' ) |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | <a href="<?php echo esc_url( self_admin_url( 'admin.php?page=wordpoints_install_modules' ) ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'module', 'wordpoints' ); ?></a> |
163 | 163 | <?php endif; ?> |
164 | 164 | |
165 | - <?php if ( ! empty( $_REQUEST['s'] ) ) : ?> |
|
165 | + <?php if ( ! empty( $_REQUEST[ 's' ] ) ) : ?> |
|
166 | 166 | <span class="subtitle"> |
167 | 167 | <?php |
168 | 168 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | sprintf( |
171 | 171 | // translators: Search term. |
172 | 172 | __( 'Search results for “%s”', 'wordpoints' ) |
173 | - , sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) |
|
173 | + , sanitize_text_field( wp_unslash( $_REQUEST[ 's' ] ) ) |
|
174 | 174 | ) |
175 | 175 | ); |
176 | 176 |
@@ -9,22 +9,22 @@ discard block |
||
9 | 9 | |
10 | 10 | global $status, $wp_version; |
11 | 11 | |
12 | -if ( isset( $_POST['clear-recent-list'] ) ) { |
|
12 | +if ( isset( $_POST[ 'clear-recent-list' ] ) ) { |
|
13 | 13 | $action = 'clear-recent-list'; |
14 | -} elseif ( isset( $_REQUEST['action'] ) && -1 !== (int) $_REQUEST['action'] ) { // WPCS: CSRF OK. |
|
15 | - $action = sanitize_key( $_REQUEST['action'] ); |
|
16 | -} elseif ( isset( $_REQUEST['action2'] ) && -1 !== (int) $_REQUEST['action2'] ) { // WPCS: CSRF OK. |
|
17 | - $action = sanitize_key( $_REQUEST['action2'] ); |
|
14 | +} elseif ( isset( $_REQUEST[ 'action' ] ) && -1 !== (int) $_REQUEST[ 'action' ] ) { // WPCS: CSRF OK. |
|
15 | + $action = sanitize_key( $_REQUEST[ 'action' ] ); |
|
16 | +} elseif ( isset( $_REQUEST[ 'action2' ] ) && -1 !== (int) $_REQUEST[ 'action2' ] ) { // WPCS: CSRF OK. |
|
17 | + $action = sanitize_key( $_REQUEST[ 'action2' ] ); |
|
18 | 18 | } else { |
19 | 19 | $action = ''; |
20 | 20 | } |
21 | 21 | |
22 | -$page = ( isset( $_REQUEST['paged'] ) ) ? max( 1, absint( $_REQUEST['paged'] ) ) : 1; // WPCS: CSRF OK. |
|
23 | -$module = ( isset( $_REQUEST['module'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['module'] ) ) : ''; // WPCS: CSRF OK. |
|
24 | -$s = ( isset( $_REQUEST['s'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) : ''; // WPCS: CSRF OK. |
|
22 | +$page = ( isset( $_REQUEST[ 'paged' ] ) ) ? max( 1, absint( $_REQUEST[ 'paged' ] ) ) : 1; // WPCS: CSRF OK. |
|
23 | +$module = ( isset( $_REQUEST[ 'module' ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ 'module' ] ) ) : ''; // WPCS: CSRF OK. |
|
24 | +$s = ( isset( $_REQUEST[ 's' ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ 's' ] ) ) : ''; // WPCS: CSRF OK. |
|
25 | 25 | |
26 | 26 | // Clean up request URI from temporary args for screen options/paging URI's to work as expected. |
27 | -$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce' ) ); |
|
27 | +$_SERVER[ 'REQUEST_URI' ] = remove_query_arg( array( 'error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce' ) ); |
|
28 | 28 | |
29 | 29 | $redirect_url = self_admin_url( "admin.php?page=wordpoints_modules&module_status={$status}&paged={$page}&s={$s}" ); |
30 | 30 | |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | |
91 | 91 | check_admin_referer( 'bulk-modules' ); |
92 | 92 | |
93 | - $modules = isset( $_POST['checked'] ) |
|
94 | - ? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['checked'] ) ) |
|
93 | + $modules = isset( $_POST[ 'checked' ] ) |
|
94 | + ? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST[ 'checked' ] ) ) |
|
95 | 95 | : array(); |
96 | 96 | |
97 | 97 | // Only activate modules which are not already active. |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | |
219 | 219 | check_admin_referer( 'bulk-modules' ); |
220 | 220 | |
221 | - $modules = isset( $_POST['checked'] ) |
|
222 | - ? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['checked'] ) ) |
|
221 | + $modules = isset( $_POST[ 'checked' ] ) |
|
222 | + ? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST[ 'checked' ] ) ) |
|
223 | 223 | : array(); |
224 | 224 | |
225 | 225 | $network_modules = array_filter( $modules, 'is_wordpoints_module_active_for_network' ); |
@@ -261,8 +261,8 @@ discard block |
||
261 | 261 | check_admin_referer( 'bulk-modules' ); |
262 | 262 | |
263 | 263 | // $_POST = from the module form; $_GET = from the FTP details screen. |
264 | - $modules = isset( $_REQUEST['checked'] ) |
|
265 | - ? array_map( 'sanitize_text_field', (array) wp_unslash( $_REQUEST['checked'] ) ) |
|
264 | + $modules = isset( $_REQUEST[ 'checked' ] ) |
|
265 | + ? array_map( 'sanitize_text_field', (array) wp_unslash( $_REQUEST[ 'checked' ] ) ) |
|
266 | 266 | : array(); |
267 | 267 | |
268 | 268 | if ( empty( $modules ) ) { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | |
288 | 288 | $parent_file = 'admin.php'; |
289 | 289 | |
290 | - if ( ! isset( $_REQUEST['verify-delete'] ) ) { |
|
290 | + if ( ! isset( $_REQUEST[ 'verify-delete' ] ) ) { |
|
291 | 291 | |
292 | 292 | wp_enqueue_script( 'jquery' ); |
293 | 293 | require_once ABSPATH . 'wp-admin/admin-header.php'; |
@@ -307,15 +307,15 @@ discard block |
||
307 | 307 | |
308 | 308 | if ( '.' === dirname( $module ) ) { |
309 | 309 | |
310 | - $files_to_delete[] = $module_dir . '/' . $module; |
|
310 | + $files_to_delete[ ] = $module_dir . '/' . $module; |
|
311 | 311 | $data = wordpoints_get_module_data( $module_dir . '/' . $module ); |
312 | 312 | |
313 | 313 | if ( ! empty( $data ) ) { |
314 | 314 | |
315 | 315 | $module_info[ $module ] = $data; |
316 | - $module_info[ $module ]['is_uninstallable'] = is_uninstallable_wordpoints_module( $module ); |
|
316 | + $module_info[ $module ][ 'is_uninstallable' ] = is_uninstallable_wordpoints_module( $module ); |
|
317 | 317 | |
318 | - if ( ! $module_info[ $module ]['network'] ) { |
|
318 | + if ( ! $module_info[ $module ][ 'network' ] ) { |
|
319 | 319 | $have_non_network_modules = true; |
320 | 320 | } |
321 | 321 | } |
@@ -335,9 +335,9 @@ discard block |
||
335 | 335 | foreach ( $folder_modules as $module_file => $data ) { |
336 | 336 | |
337 | 337 | $module_info[ $module_file ] = $data; |
338 | - $module_info[ $module_file ]['is_uninstallable'] = is_uninstallable_wordpoints_module( $module ); |
|
338 | + $module_info[ $module_file ][ 'is_uninstallable' ] = is_uninstallable_wordpoints_module( $module ); |
|
339 | 339 | |
340 | - if ( ! $module_info[ $module_file ]['network'] ) { |
|
340 | + if ( ! $module_info[ $module_file ][ 'network' ] ) { |
|
341 | 341 | $have_non_network_modules = true; |
342 | 342 | } |
343 | 343 | } |
@@ -376,16 +376,16 @@ discard block |
||
376 | 376 | |
377 | 377 | foreach ( $module_info as $module ) { |
378 | 378 | |
379 | - if ( $module['is_uninstallable'] ) { |
|
379 | + if ( $module[ 'is_uninstallable' ] ) { |
|
380 | 380 | |
381 | 381 | // translators: 1. Module name; 2. Module author. |
382 | - echo '<li>', wp_kses( sprintf( __( '<strong>%1$s</strong> by <em>%2$s</em> (will also <strong>delete its data</strong>)', 'wordpoints' ), esc_html( $module['name'] ), esc_html( $module['author_name'] ) ), array( 'strong' => array(), 'em' => array() ) ), '</li>'; |
|
382 | + echo '<li>', wp_kses( sprintf( __( '<strong>%1$s</strong> by <em>%2$s</em> (will also <strong>delete its data</strong>)', 'wordpoints' ), esc_html( $module[ 'name' ] ), esc_html( $module[ 'author_name' ] ) ), array( 'strong' => array(), 'em' => array() ) ), '</li>'; |
|
383 | 383 | $data_to_delete = true; |
384 | 384 | |
385 | 385 | } else { |
386 | 386 | |
387 | 387 | // translators: 1. Module name; 2. Module author. |
388 | - echo '<li>', wp_kses( sprintf( __( '<strong>%1$s</strong> by <em>%2$s</em>', 'wordpoints' ), esc_html( $module['name'] ), esc_html( $module['author_name'] ) ), array( 'strong' => array(), 'em' => array() ) ), '</li>'; |
|
388 | + echo '<li>', wp_kses( sprintf( __( '<strong>%1$s</strong> by <em>%2$s</em>', 'wordpoints' ), esc_html( $module[ 'name' ] ), esc_html( $module[ 'author_name' ] ) ), array( 'strong' => array(), 'em' => array() ) ), '</li>'; |
|
389 | 389 | } |
390 | 390 | } |
391 | 391 |
@@ -11,9 +11,11 @@ |
||
11 | 11 | |
12 | 12 | if ( isset( $_POST['clear-recent-list'] ) ) { |
13 | 13 | $action = 'clear-recent-list'; |
14 | -} elseif ( isset( $_REQUEST['action'] ) && -1 !== (int) $_REQUEST['action'] ) { // WPCS: CSRF OK. |
|
14 | +} elseif ( isset( $_REQUEST['action'] ) && -1 !== (int) $_REQUEST['action'] ) { |
|
15 | +// WPCS: CSRF OK. |
|
15 | 16 | $action = sanitize_key( $_REQUEST['action'] ); |
16 | -} elseif ( isset( $_REQUEST['action2'] ) && -1 !== (int) $_REQUEST['action2'] ) { // WPCS: CSRF OK. |
|
17 | +} elseif ( isset( $_REQUEST['action2'] ) && -1 !== (int) $_REQUEST['action2'] ) { |
|
18 | +// WPCS: CSRF OK. |
|
17 | 19 | $action = sanitize_key( $_REQUEST['action2'] ); |
18 | 20 | } else { |
19 | 21 | $action = ''; |
@@ -17,13 +17,13 @@ discard block |
||
17 | 17 | // Show messages and errors. |
18 | 18 | // |
19 | 19 | |
20 | -if ( isset( $_GET['wordpoints_component'], $_GET['_wpnonce'] ) && $wordpoints_components->is_registered( sanitize_key( $_GET['wordpoints_component'] ) ) ) { // WPCS: CSRF OK. |
|
20 | +if ( isset( $_GET[ 'wordpoints_component' ], $_GET[ '_wpnonce' ] ) && $wordpoints_components->is_registered( sanitize_key( $_GET[ 'wordpoints_component' ] ) ) ) { // WPCS: CSRF OK. |
|
21 | 21 | |
22 | - $component = sanitize_key( $_GET['wordpoints_component'] ); |
|
22 | + $component = sanitize_key( $_GET[ 'wordpoints_component' ] ); |
|
23 | 23 | |
24 | - if ( isset( $_GET['message'] ) && wordpoints_verify_nonce( '_wpnonce', "wordpoints_component_message-{$component}" ) ) { |
|
24 | + if ( isset( $_GET[ 'message' ] ) && wordpoints_verify_nonce( '_wpnonce', "wordpoints_component_message-{$component}" ) ) { |
|
25 | 25 | |
26 | - switch ( (int) $_GET['message'] ) { |
|
26 | + switch ( (int) $_GET[ 'message' ] ) { |
|
27 | 27 | |
28 | 28 | case 1: |
29 | 29 | if ( $wordpoints_components->is_active( $component ) ) { |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | if ( isset( $message ) ) { |
44 | 44 | |
45 | 45 | wordpoints_show_admin_message( |
46 | - esc_html( sprintf( $message, $components[ $component ]['name'] ) ) |
|
46 | + esc_html( sprintf( $message, $components[ $component ][ 'name' ] ) ) |
|
47 | 47 | , 'success' |
48 | 48 | , array( 'dismissible' => true ) |
49 | 49 | ); |
50 | 50 | } |
51 | 51 | |
52 | - } elseif ( isset( $_GET['error'] ) && wordpoints_verify_nonce( '_wpnonce', "wordpoints_component_error-{$component}" ) ) { |
|
52 | + } elseif ( isset( $_GET[ 'error' ] ) && wordpoints_verify_nonce( '_wpnonce', "wordpoints_component_error-{$component}" ) ) { |
|
53 | 53 | |
54 | - switch ( (int) $_GET['error'] ) { |
|
54 | + switch ( (int) $_GET[ 'error' ] ) { |
|
55 | 55 | |
56 | 56 | case 1: |
57 | 57 | if ( ! $wordpoints_components->is_active( $component ) ) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ( isset( $error ) ) { |
72 | 72 | |
73 | 73 | wordpoints_show_admin_error( |
74 | - esc_html( sprintf( $error, $components[ $component ]['name'] ) ) |
|
74 | + esc_html( sprintf( $error, $components[ $component ][ 'name' ] ) ) |
|
75 | 75 | , array( 'dismissible' => true ) |
76 | 76 | ); |
77 | 77 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | <?php |
111 | 111 | |
112 | - if ( $wordpoints_components->is_active( $component['slug'] ) ) { |
|
112 | + if ( $wordpoints_components->is_active( $component[ 'slug' ] ) ) { |
|
113 | 113 | |
114 | 114 | $action = 'deactivate'; |
115 | 115 | $button = __( 'Deactivate', 'wordpoints' ); |
@@ -124,38 +124,38 @@ discard block |
||
124 | 124 | |
125 | 125 | <tr> |
126 | 126 | <td> |
127 | - <?php if ( '' !== $component['component_uri'] ) : ?> |
|
128 | - <a href="<?php echo esc_url( $component['component_uri'] ); ?>"> |
|
127 | + <?php if ( '' !== $component[ 'component_uri' ] ) : ?> |
|
128 | + <a href="<?php echo esc_url( $component[ 'component_uri' ] ); ?>"> |
|
129 | 129 | <?php endif; ?> |
130 | - <?php echo esc_html( $component['name'] ); ?> |
|
131 | - <?php if ( '' !== $component['component_uri'] ) : ?> |
|
130 | + <?php echo esc_html( $component[ 'name' ] ); ?> |
|
131 | + <?php if ( '' !== $component[ 'component_uri' ] ) : ?> |
|
132 | 132 | </a> |
133 | 133 | <?php endif; ?> |
134 | 134 | </td> |
135 | 135 | <td> |
136 | - <?php echo wp_kses( $component['description'], 'wordpoints_component_description' ); ?> |
|
137 | - <?php if ( '' !== $component['author'] ) : ?> |
|
136 | + <?php echo wp_kses( $component[ 'description' ], 'wordpoints_component_description' ); ?> |
|
137 | + <?php if ( '' !== $component[ 'author' ] ) : ?> |
|
138 | 138 | | |
139 | 139 | <?php |
140 | 140 | // translators: Author name. |
141 | 141 | echo esc_html( sprintf( __( 'By %s', 'wordpoints' ), '' /* This space intentionally left blank */ ) ); |
142 | 142 | ?> |
143 | - <?php if ( '' !== $component['author_uri'] ) : ?> |
|
144 | - <a href="<?php echo esc_url( $component['author_uri'] ); ?>"> |
|
143 | + <?php if ( '' !== $component[ 'author_uri' ] ) : ?> |
|
144 | + <a href="<?php echo esc_url( $component[ 'author_uri' ] ); ?>"> |
|
145 | 145 | <?php endif; ?> |
146 | - <?php echo esc_html( $component['author'] ); ?> |
|
147 | - <?php if ( '' !== $component['author_uri'] ) : ?> |
|
146 | + <?php echo esc_html( $component[ 'author' ] ); ?> |
|
147 | + <?php if ( '' !== $component[ 'author_uri' ] ) : ?> |
|
148 | 148 | </a> |
149 | 149 | <?php endif; ?> |
150 | 150 | <?php endif; ?> |
151 | 151 | </td> |
152 | - <td><?php echo esc_html( $component['version'] ); ?></td> |
|
152 | + <td><?php echo esc_html( $component[ 'version' ] ); ?></td> |
|
153 | 153 | <td> |
154 | - <form method="post" name="wordpoints_components_form_<?php echo esc_attr( $component['slug'] ); ?>"> |
|
154 | + <form method="post" name="wordpoints_components_form_<?php echo esc_attr( $component[ 'slug' ] ); ?>"> |
|
155 | 155 | <input type="hidden" name="wordpoints_component_action" value="<?php echo esc_attr( $action ); ?>" /> |
156 | - <input type="hidden" name="wordpoints_component" value="<?php echo esc_attr( $component['slug'] ); ?>" /> |
|
157 | - <?php wp_nonce_field( "wordpoints_{$action}_component-{$component['slug']}" ); ?> |
|
158 | - <?php submit_button( $button, "secondary wordpoints-component-{$action}", "wordpoints-component-{$action}_{$component['slug']}", false ); ?> |
|
156 | + <input type="hidden" name="wordpoints_component" value="<?php echo esc_attr( $component[ 'slug' ] ); ?>" /> |
|
157 | + <?php wp_nonce_field( "wordpoints_{$action}_component-{$component[ 'slug' ]}" ); ?> |
|
158 | + <?php submit_button( $button, "secondary wordpoints-component-{$action}", "wordpoints-component-{$action}_{$component[ 'slug' ]}", false ); ?> |
|
159 | 159 | </form> |
160 | 160 | </td> |
161 | 161 | </tr> |
@@ -17,7 +17,8 @@ |
||
17 | 17 | // Show messages and errors. |
18 | 18 | // |
19 | 19 | |
20 | -if ( isset( $_GET['wordpoints_component'], $_GET['_wpnonce'] ) && $wordpoints_components->is_registered( sanitize_key( $_GET['wordpoints_component'] ) ) ) { // WPCS: CSRF OK. |
|
20 | +if ( isset( $_GET['wordpoints_component'], $_GET['_wpnonce'] ) && $wordpoints_components->is_registered( sanitize_key( $_GET['wordpoints_component'] ) ) ) { |
|
21 | +// WPCS: CSRF OK. |
|
21 | 22 | |
22 | 23 | $component = sanitize_key( $_GET['wordpoints_component'] ); |
23 | 24 |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public static function register( $class_name ) { |
112 | 112 | |
113 | - self::$classes[] = $class_name; |
|
113 | + self::$classes[ ] = $class_name; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -286,10 +286,10 @@ discard block |
||
286 | 286 | |
287 | 287 | $args = $hook_type->get_options(); |
288 | 288 | |
289 | - $args['_add'] = 'multi'; |
|
290 | - $args['_display'] = 'template'; |
|
291 | - $args['_multi_num'] = $hook_type->next_hook_id_number(); |
|
292 | - $args['_id_slug'] = $i; |
|
289 | + $args[ '_add' ] = 'multi'; |
|
290 | + $args[ '_display' ] = 'template'; |
|
291 | + $args[ '_multi_num' ] = $hook_type->next_hook_id_number(); |
|
292 | + $args[ '_id_slug' ] = $i; |
|
293 | 293 | |
294 | 294 | $hook_type->set_options( $args ); |
295 | 295 | |
@@ -338,11 +338,11 @@ discard block |
||
338 | 338 | |
339 | 339 | $options = $hook_type->get_options(); |
340 | 340 | |
341 | - $options['_display'] = 'instance'; |
|
341 | + $options[ '_display' ] = 'instance'; |
|
342 | 342 | |
343 | - unset( $options['_add'] ); |
|
343 | + unset( $options[ '_add' ] ); |
|
344 | 344 | |
345 | - $options['_id_slug'] = $slug; |
|
345 | + $options[ '_id_slug' ] = $slug; |
|
346 | 346 | |
347 | 347 | $hook_type->set_options( $options ); |
348 | 348 | |
@@ -596,15 +596,15 @@ discard block |
||
596 | 596 | |
597 | 597 | <p> |
598 | 598 | <label for="points-name-<?php echo esc_attr( $slug ); ?>"><?php echo esc_html_x( 'Name:', 'points type', 'wordpoints' ); ?></label> |
599 | - <input class="widefat" type="text" id="points-name-<?php echo esc_attr( $slug ); ?>" name="points-name" value="<?php echo esc_attr( $points_type['name'] ); ?>" /> |
|
599 | + <input class="widefat" type="text" id="points-name-<?php echo esc_attr( $slug ); ?>" name="points-name" value="<?php echo esc_attr( $points_type[ 'name' ] ); ?>" /> |
|
600 | 600 | </p> |
601 | 601 | <p> |
602 | 602 | <label for="points-prefix-<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $prefix ); ?></label> |
603 | - <input class="widefat" type="text" id="points-prefix-<?php echo esc_attr( $slug ); ?>" name="points-prefix" value="<?php echo esc_attr( $points_type['prefix'] ); ?>" /> |
|
603 | + <input class="widefat" type="text" id="points-prefix-<?php echo esc_attr( $slug ); ?>" name="points-prefix" value="<?php echo esc_attr( $points_type[ 'prefix' ] ); ?>" /> |
|
604 | 604 | </p> |
605 | 605 | <p> |
606 | 606 | <label for="points-suffix-<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $suffix ); ?></label> |
607 | - <input class="widefat" type="text" id="points-suffix-<?php echo esc_attr( $slug ); ?>" name="points-suffix" value="<?php echo esc_attr( $points_type['suffix'] ); ?>" /> |
|
607 | + <input class="widefat" type="text" id="points-suffix-<?php echo esc_attr( $slug ); ?>" name="points-suffix" value="<?php echo esc_attr( $points_type[ 'suffix' ] ); ?>" /> |
|
608 | 608 | </p> |
609 | 609 | |
610 | 610 | <?php |
@@ -677,28 +677,28 @@ discard block |
||
677 | 677 | |
678 | 678 | $id_format = $hook_id; |
679 | 679 | |
680 | - $multi_number = ( isset( $options['_multi_num'] ) ) ? $options['_multi_num'] : ''; |
|
681 | - $add_new = ( isset( $options['_add'] ) ) ? $options['_add'] : ''; |
|
680 | + $multi_number = ( isset( $options[ '_multi_num' ] ) ) ? $options[ '_multi_num' ] : ''; |
|
681 | + $add_new = ( isset( $options[ '_add' ] ) ) ? $options[ '_add' ] : ''; |
|
682 | 682 | |
683 | 683 | // Prepare the URL query string. |
684 | 684 | $query_arg = array( 'edithook' => $id_format ); |
685 | 685 | |
686 | 686 | if ( $add_new ) { |
687 | 687 | |
688 | - $query_arg['addnew'] = 1; |
|
688 | + $query_arg[ 'addnew' ] = 1; |
|
689 | 689 | |
690 | 690 | if ( $multi_number ) { |
691 | 691 | |
692 | - $query_arg['num'] = $multi_number; |
|
693 | - $query_arg['base'] = $id_base; |
|
692 | + $query_arg[ 'num' ] = $multi_number; |
|
693 | + $query_arg[ 'base' ] = $id_base; |
|
694 | 694 | } |
695 | 695 | |
696 | 696 | } else { |
697 | 697 | |
698 | - $query_arg['points_type'] = $points_type; |
|
698 | + $query_arg[ 'points_type' ] = $points_type; |
|
699 | 699 | } |
700 | 700 | |
701 | - if ( isset( $options['_display'] ) && 'template' === $options['_display'] ) { |
|
701 | + if ( isset( $options[ '_display' ] ) && 'template' === $options[ '_display' ] ) { |
|
702 | 702 | |
703 | 703 | /* |
704 | 704 | * We aren't outputting the form for a hook, but a template form for this |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | |
715 | 715 | ?> |
716 | 716 | |
717 | - <div id="hook-<?php echo esc_html( $options['_id_slug'] ); ?>_<?php echo esc_attr( $id_format ); ?>" class="hook <?php echo esc_attr( $options['_classname'] ); ?>"> |
|
717 | + <div id="hook-<?php echo esc_html( $options[ '_id_slug' ] ); ?>_<?php echo esc_attr( $id_format ); ?>" class="hook <?php echo esc_attr( $options[ '_classname' ] ); ?>"> |
|
718 | 718 | <div class="hook-top"> |
719 | 719 | <div class="hook-title-action"> |
720 | 720 | <a class="hook-action hide-if-no-js" href="#available-hooks"></a> |
@@ -739,8 +739,8 @@ discard block |
||
739 | 739 | |
740 | 740 | <input type="hidden" name="hook-id" class="hook-id" value="<?php echo esc_attr( $id_format ); ?>" /> |
741 | 741 | <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr( $id_base ); ?>" /> |
742 | - <input type="hidden" name="hook-width" class="hook-width" value="<?php echo isset( $options['width'] ) ? esc_attr( $options['width'] ) : ''; ?>" /> |
|
743 | - <input type="hidden" name="hook-height" class="hook-height" value="<?php echo isset( $options['height'] ) ? esc_attr( $options['height'] ) : ''; ?>" /> |
|
742 | + <input type="hidden" name="hook-width" class="hook-width" value="<?php echo isset( $options[ 'width' ] ) ? esc_attr( $options[ 'width' ] ) : ''; ?>" /> |
|
743 | + <input type="hidden" name="hook-height" class="hook-height" value="<?php echo isset( $options[ 'height' ] ) ? esc_attr( $options[ 'height' ] ) : ''; ?>" /> |
|
744 | 744 | <input type="hidden" name="hook_number" class="hook_number" value="<?php echo esc_attr( $number ); ?>" /> |
745 | 745 | <input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr( $multi_number ); ?>" /> |
746 | 746 | <input type="hidden" name="add_new" class="add_new" value="<?php echo esc_attr( $add_new ); ?>" /> |
@@ -760,8 +760,8 @@ discard block |
||
760 | 760 | </div> |
761 | 761 | |
762 | 762 | <div class="hook-description"> |
763 | - <?php if ( ! empty( $options['description'] ) ) : ?> |
|
764 | - <?php echo esc_html( $options['description'] ); ?> |
|
763 | + <?php if ( ! empty( $options[ 'description' ] ) ) : ?> |
|
764 | + <?php echo esc_html( $options[ 'description' ] ); ?> |
|
765 | 765 | <?php endif; ?> |
766 | 766 | </div> |
767 | 767 | </div> |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | |
185 | 185 | $instance = array_merge( $this->defaults, $instance ); |
186 | 186 | |
187 | - if ( ! $this->is_matching_post_type( $post->post_type, $instance['post_type'] ) ) { |
|
187 | + if ( ! $this->is_matching_post_type( $post->post_type, $instance[ 'post_type' ] ) ) { |
|
188 | 188 | continue; |
189 | 189 | } |
190 | 190 | |
191 | 191 | $points_type = $this->points_type( $number ); |
192 | 192 | |
193 | - wordpoints_subtract_points( $comment->user_id, $instance['points'], $points_type, 'comment_disapprove', array( 'status' => $new_status ) ); |
|
193 | + wordpoints_subtract_points( $comment->user_id, $instance[ 'points' ], $points_type, 'comment_disapprove', array( 'status' => $new_status ) ); |
|
194 | 194 | |
195 | 195 | update_comment_meta( |
196 | 196 | $comment->comment_ID |
@@ -375,14 +375,14 @@ discard block |
||
375 | 375 | $instance = array_merge( $this->defaults, $instance ); |
376 | 376 | |
377 | 377 | if ( |
378 | - $this->is_matching_post_type( $post->post_type, $instance['post_type'] ) |
|
378 | + $this->is_matching_post_type( $post->post_type, $instance[ 'post_type' ] ) |
|
379 | 379 | && 'auto-draft' !== $post->post_status |
380 | 380 | && __( 'Auto Draft', 'default' ) !== $post->post_title |
381 | 381 | ) { |
382 | 382 | |
383 | 383 | wordpoints_alter_points( |
384 | 384 | $post->post_author |
385 | - , -$instance['points'] |
|
385 | + , -$instance[ 'points' ] |
|
386 | 386 | , $this->points_type( $number ) |
387 | 387 | , 'post_delete' |
388 | 388 | , array( 'post_title' => $post->post_title, 'post_type' => $post->post_type ) |
@@ -85,15 +85,15 @@ discard block |
||
85 | 85 | |
86 | 86 | if ( |
87 | 87 | ! isset( $last_visit[ $points_type ] ) |
88 | - || (int) ( $last_visit[ $points_type ] / $instance['period'] ) < (int) ( $now / $instance['period'] ) |
|
88 | + || (int) ( $last_visit[ $points_type ] / $instance[ 'period' ] ) < (int) ( $now / $instance[ 'period' ] ) |
|
89 | 89 | ) { |
90 | 90 | |
91 | 91 | wordpoints_add_points( |
92 | 92 | $user_id |
93 | - , $instance['points'] |
|
93 | + , $instance[ 'points' ] |
|
94 | 94 | , $points_type |
95 | 95 | , 'periodic' |
96 | - , array( 'period' => $instance['period'] ) |
|
96 | + , array( 'period' => $instance[ 'period' ] ) |
|
97 | 97 | ); |
98 | 98 | |
99 | 99 | $last_visit[ $points_type ] = $now; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function logs( $text, $points, $points_type, $user_id, $log_type, $meta ) { |
135 | 135 | |
136 | - switch ( $meta['period'] ) { |
|
136 | + switch ( $meta[ 'period' ] ) { |
|
137 | 137 | |
138 | 138 | case HOUR_IN_SECONDS: |
139 | 139 | $message = _x( 'Hourly points.', 'points log description', 'wordpoints' ); |
@@ -169,9 +169,9 @@ discard block |
||
169 | 169 | */ |
170 | 170 | protected function generate_description( $instance = array() ) { |
171 | 171 | |
172 | - if ( ! empty( $instance['period'] ) ) { |
|
172 | + if ( ! empty( $instance[ 'period' ] ) ) { |
|
173 | 173 | |
174 | - switch ( $instance['period'] ) { |
|
174 | + switch ( $instance[ 'period' ] ) { |
|
175 | 175 | |
176 | 176 | case HOUR_IN_SECONDS: |
177 | 177 | return __( 'Visiting the site at least once in an hour.', 'wordpoints' ); |
@@ -207,8 +207,8 @@ discard block |
||
207 | 207 | |
208 | 208 | $new_instance = array_merge( $this->defaults, $old_instance, $new_instance ); |
209 | 209 | |
210 | - wordpoints_posint( $new_instance['points'] ); |
|
211 | - wordpoints_posint( $new_instance['period'] ); |
|
210 | + wordpoints_posint( $new_instance[ 'points' ] ); |
|
211 | + wordpoints_posint( $new_instance[ 'period' ] ); |
|
212 | 212 | |
213 | 213 | return $new_instance; |
214 | 214 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $instance = array_merge( $this->defaults, $instance ); |
228 | 228 | |
229 | 229 | $dropdown_args = array( |
230 | - 'selected' => $instance['period'], |
|
230 | + 'selected' => $instance[ 'period' ], |
|
231 | 231 | 'id' => $this->get_field_id( 'period' ), |
232 | 232 | 'name' => $this->get_field_name( 'period' ), |
233 | 233 | 'class' => 'widefat wordpoints-append-to-hook-title', |
@@ -261,9 +261,9 @@ discard block |
||
261 | 261 | protected function get_periods() { |
262 | 262 | |
263 | 263 | $periods = array( |
264 | - HOUR_IN_SECONDS => __( 'hourly', 'wordpoints' ), |
|
265 | - DAY_IN_SECONDS => __( 'daily', 'wordpoints' ), |
|
266 | - WEEK_IN_SECONDS => __( 'weekly', 'wordpoints' ), |
|
264 | + HOUR_IN_SECONDS => __( 'hourly', 'wordpoints' ), |
|
265 | + DAY_IN_SECONDS => __( 'daily', 'wordpoints' ), |
|
266 | + WEEK_IN_SECONDS => __( 'weekly', 'wordpoints' ), |
|
267 | 267 | 30 * DAY_IN_SECONDS => __( 'monthly', 'wordpoints' ), |
268 | 268 | ); |
269 | 269 |