@@ -20,6 +20,7 @@ |
||
| 20 | 20 | * @since 2.1.0 |
| 21 | 21 | * |
| 22 | 22 | * @param WordPoints_Hook_Fire $fire The fire that was a miss. |
| 23 | + * @return void |
|
| 23 | 24 | */ |
| 24 | 25 | public function after_miss( WordPoints_Hook_Fire $fire ); |
| 25 | 26 | } |
@@ -38,6 +38,7 @@ |
||
| 38 | 38 | * |
| 39 | 39 | * @param WordPoints_Hook_ReactionI $reaction The reaction object. |
| 40 | 40 | * @param array $settings The settings for a hook reaction. |
| 41 | + * @return void |
|
| 41 | 42 | */ |
| 42 | 43 | public function update_settings( |
| 43 | 44 | WordPoints_Hook_ReactionI $reaction, |
@@ -18,6 +18,7 @@ |
||
| 18 | 18 | * @since 2.2.0 |
| 19 | 19 | * |
| 20 | 20 | * @param object $log The object for the points log the restriction is for. |
| 21 | + * @return void |
|
| 21 | 22 | */ |
| 22 | 23 | public function __construct( $log ); |
| 23 | 24 | |
@@ -280,7 +280,7 @@ |
||
| 280 | 280 | * |
| 281 | 281 | * @since 1.8.0 |
| 282 | 282 | * |
| 283 | - * @return string|WP_Error|null An error message or object on failure. |
|
| 283 | + * @return string|null An error message or object on failure. |
|
| 284 | 284 | */ |
| 285 | 285 | protected function verify_atts() { |
| 286 | 286 | |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | protected function verify_atts() { |
| 172 | 172 | |
| 173 | 173 | // If this shortcode supports the user_id attribute, verify it. |
| 174 | - if ( isset( $this->pairs['user_id'] ) ) { |
|
| 174 | + if ( isset( $this->pairs[ 'user_id' ] ) ) { |
|
| 175 | 175 | |
| 176 | - if ( 'post_author' === $this->atts['user_id'] ) { |
|
| 176 | + if ( 'post_author' === $this->atts[ 'user_id' ] ) { |
|
| 177 | 177 | |
| 178 | 178 | $post = get_post(); |
| 179 | 179 | |
@@ -186,13 +186,13 @@ discard block |
||
| 186 | 186 | ); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $this->atts['user_id'] = $post->post_author; |
|
| 189 | + $this->atts[ 'user_id' ] = $post->post_author; |
|
| 190 | 190 | |
| 191 | - } elseif ( ! $this->atts['user_id'] ) { |
|
| 191 | + } elseif ( ! $this->atts[ 'user_id' ] ) { |
|
| 192 | 192 | |
| 193 | - $this->atts['user_id'] = get_current_user_id(); |
|
| 193 | + $this->atts[ 'user_id' ] = get_current_user_id(); |
|
| 194 | 194 | |
| 195 | - } elseif ( ! wordpoints_posint( $this->atts['user_id'] ) ) { |
|
| 195 | + } elseif ( ! wordpoints_posint( $this->atts[ 'user_id' ] ) ) { |
|
| 196 | 196 | |
| 197 | 197 | return sprintf( |
| 198 | 198 | // translators: 1. Attribute name; 2. Shortcode name; 3. Expected value. |
@@ -697,7 +697,7 @@ |
||
| 697 | 697 | * @since 2.0.0 |
| 698 | 698 | * |
| 699 | 699 | * @param string $option The name of the option to set. |
| 700 | - * @param mixed $value The value of the option. |
|
| 700 | + * @param string $value The value of the option. |
|
| 701 | 701 | */ |
| 702 | 702 | private function _set_option( $option, $value = true ) { |
| 703 | 703 | |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | $option_name = $this->_get_installed_site_ids_option_name(); |
| 923 | 923 | |
| 924 | 924 | $sites = wordpoints_get_array_option( $option_name, 'site' ); |
| 925 | - $sites[] = $id; |
|
| 925 | + $sites[ ] = $id; |
|
| 926 | 926 | |
| 927 | 927 | update_site_option( $option_name, $sites ); |
| 928 | 928 | } |
@@ -984,12 +984,12 @@ discard block |
||
| 984 | 984 | |
| 985 | 985 | if ( 'wordpoints' === $this->slug ) { |
| 986 | 986 | |
| 987 | - if ( isset( $wordpoints_data['version'] ) ) { |
|
| 988 | - return $wordpoints_data['version']; |
|
| 987 | + if ( isset( $wordpoints_data[ 'version' ] ) ) { |
|
| 988 | + return $wordpoints_data[ 'version' ]; |
|
| 989 | 989 | } |
| 990 | 990 | |
| 991 | - } elseif ( isset( $wordpoints_data[ "{$this->type}s" ][ $this->slug ]['version'] ) ) { |
|
| 992 | - return $wordpoints_data[ "{$this->type}s" ][ $this->slug ]['version']; |
|
| 991 | + } elseif ( isset( $wordpoints_data[ "{$this->type}s" ][ $this->slug ][ 'version' ] ) ) { |
|
| 992 | + return $wordpoints_data[ "{$this->type}s" ][ $this->slug ][ 'version' ]; |
|
| 993 | 993 | } |
| 994 | 994 | |
| 995 | 995 | return false; |
@@ -1016,9 +1016,9 @@ discard block |
||
| 1016 | 1016 | } |
| 1017 | 1017 | |
| 1018 | 1018 | if ( 'wordpoints' === $this->slug ) { |
| 1019 | - $wordpoints_data['version'] = $version; |
|
| 1019 | + $wordpoints_data[ 'version' ] = $version; |
|
| 1020 | 1020 | } else { |
| 1021 | - $wordpoints_data[ "{$this->type}s" ][ $this->slug ]['version'] = $version; |
|
| 1021 | + $wordpoints_data[ "{$this->type}s" ][ $this->slug ][ 'version' ] = $version; |
|
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | if ( $this->network_wide ) { |
@@ -1074,8 +1074,8 @@ discard block |
||
| 1074 | 1074 | 'wordpoints_data' |
| 1075 | 1075 | ); |
| 1076 | 1076 | |
| 1077 | - if ( empty( $wordpoints_data['components'][ $component ]['version'] ) ) { |
|
| 1078 | - $wordpoints_data['components'][ $component ]['version'] = $version; |
|
| 1077 | + if ( empty( $wordpoints_data[ 'components' ][ $component ][ 'version' ] ) ) { |
|
| 1078 | + $wordpoints_data[ 'components' ][ $component ][ 'version' ] = $version; |
|
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | 1081 | wordpoints_update_maybe_network_option( 'wordpoints_data', $wordpoints_data ); |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | $this->custom_caps_keys = array_keys( $this->custom_caps ); |
| 1097 | 1097 | |
| 1098 | 1098 | if ( 'uninstall' === $this->action ) { |
| 1099 | - $this->uninstall['local']['custom_caps'] = true; |
|
| 1099 | + $this->uninstall[ 'local' ][ 'custom_caps' ] = true; |
|
| 1100 | 1100 | } |
| 1101 | 1101 | } |
| 1102 | 1102 | |
@@ -1145,7 +1145,7 @@ discard block |
||
| 1145 | 1145 | */ |
| 1146 | 1146 | public function get_db_schema() { |
| 1147 | 1147 | |
| 1148 | - if ( ! isset( $this->schema[ $this->context ]['tables'] ) ) { |
|
| 1148 | + if ( ! isset( $this->schema[ $this->context ][ 'tables' ] ) ) { |
|
| 1149 | 1149 | return ''; |
| 1150 | 1150 | } |
| 1151 | 1151 | |
@@ -1161,7 +1161,7 @@ discard block |
||
| 1161 | 1161 | $prefix = $wpdb->base_prefix; |
| 1162 | 1162 | } |
| 1163 | 1163 | |
| 1164 | - foreach ( $this->schema[ $this->context ]['tables'] as $table_name => $table_schema ) { |
|
| 1164 | + foreach ( $this->schema[ $this->context ][ 'tables' ] as $table_name => $table_schema ) { |
|
| 1165 | 1165 | |
| 1166 | 1166 | $table_name = str_replace( '`', '``', $table_name ); |
| 1167 | 1167 | $table_schema = trim( $table_schema ); |
@@ -1191,18 +1191,18 @@ discard block |
||
| 1191 | 1191 | // Add any tables to uninstall based on the db schema. |
| 1192 | 1192 | foreach ( $this->schema as $context => $schema ) { |
| 1193 | 1193 | |
| 1194 | - if ( ! isset( $schema['tables'] ) ) { |
|
| 1194 | + if ( ! isset( $schema[ 'tables' ] ) ) { |
|
| 1195 | 1195 | continue; |
| 1196 | 1196 | } |
| 1197 | 1197 | |
| 1198 | - if ( ! isset( $this->uninstall[ $context ]['tables'] ) ) { |
|
| 1199 | - $this->uninstall[ $context ]['tables'] = array(); |
|
| 1198 | + if ( ! isset( $this->uninstall[ $context ][ 'tables' ] ) ) { |
|
| 1199 | + $this->uninstall[ $context ][ 'tables' ] = array(); |
|
| 1200 | 1200 | } |
| 1201 | 1201 | |
| 1202 | - $this->uninstall[ $context ]['tables'] = array_unique( |
|
| 1202 | + $this->uninstall[ $context ][ 'tables' ] = array_unique( |
|
| 1203 | 1203 | array_merge( |
| 1204 | - $this->uninstall[ $context ]['tables'] |
|
| 1205 | - , array_keys( $schema['tables'] ) |
|
| 1204 | + $this->uninstall[ $context ][ 'tables' ] |
|
| 1205 | + , array_keys( $schema[ 'tables' ] ) |
|
| 1206 | 1206 | ) |
| 1207 | 1207 | ); |
| 1208 | 1208 | } |
@@ -1242,7 +1242,7 @@ discard block |
||
| 1242 | 1242 | */ |
| 1243 | 1243 | protected function prepare_uninstall_list_tables() { |
| 1244 | 1244 | |
| 1245 | - if ( ! isset( $this->uninstall['list_tables'] ) ) { |
|
| 1245 | + if ( ! isset( $this->uninstall[ 'list_tables' ] ) ) { |
|
| 1246 | 1246 | return; |
| 1247 | 1247 | } |
| 1248 | 1248 | |
@@ -1253,14 +1253,14 @@ discard block |
||
| 1253 | 1253 | ); |
| 1254 | 1254 | |
| 1255 | 1255 | // Loop through all of the list table screens. |
| 1256 | - foreach ( $this->uninstall['list_tables'] as $screen_id => $args ) { |
|
| 1256 | + foreach ( $this->uninstall[ 'list_tables' ] as $screen_id => $args ) { |
|
| 1257 | 1257 | |
| 1258 | 1258 | // Back-compat for pre-2.1.0. |
| 1259 | - if ( isset( $args['parent'] ) && '_page' === substr( $args['parent'], -5 /* _page */ ) ) { |
|
| 1260 | - $args['parent'] = substr( $args['parent'], 0, -5 ); |
|
| 1259 | + if ( isset( $args[ 'parent' ] ) && '_page' === substr( $args[ 'parent' ], -5 /* _page */ ) ) { |
|
| 1260 | + $args[ 'parent' ] = substr( $args[ 'parent' ], 0, -5 ); |
|
| 1261 | 1261 | } |
| 1262 | 1262 | |
| 1263 | - $this->uninstall['universal']['list_tables'][ $screen_id ] = $args; |
|
| 1263 | + $this->uninstall[ 'universal' ][ 'list_tables' ][ $screen_id ] = $args; |
|
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | 1266 | $this->prepare_uninstall_non_per_site_items( 'list_tables' ); |
@@ -1283,20 +1283,20 @@ discard block |
||
| 1283 | 1283 | */ |
| 1284 | 1284 | protected function prepare_uninstall_non_per_site_items( $items_key ) { |
| 1285 | 1285 | |
| 1286 | - if ( isset( $this->uninstall['universal'][ $items_key ] ) ) { |
|
| 1286 | + if ( isset( $this->uninstall[ 'universal' ][ $items_key ] ) ) { |
|
| 1287 | 1287 | |
| 1288 | - $this->uninstall['global'][ $items_key ] |
|
| 1289 | - = $this->uninstall['universal'][ $items_key ]; |
|
| 1288 | + $this->uninstall[ 'global' ][ $items_key ] |
|
| 1289 | + = $this->uninstall[ 'universal' ][ $items_key ]; |
|
| 1290 | 1290 | |
| 1291 | - unset( $this->uninstall['universal'][ $items_key ] ); |
|
| 1291 | + unset( $this->uninstall[ 'universal' ][ $items_key ] ); |
|
| 1292 | 1292 | } |
| 1293 | 1293 | |
| 1294 | - if ( isset( $this->uninstall['site'][ $items_key ] ) ) { |
|
| 1294 | + if ( isset( $this->uninstall[ 'site' ][ $items_key ] ) ) { |
|
| 1295 | 1295 | |
| 1296 | - $this->uninstall['network'][ $items_key ] |
|
| 1297 | - = $this->uninstall['site'][ $items_key ]; |
|
| 1296 | + $this->uninstall[ 'network' ][ $items_key ] |
|
| 1297 | + = $this->uninstall[ 'site' ][ $items_key ]; |
|
| 1298 | 1298 | |
| 1299 | - unset( $this->uninstall['site'][ $items_key ] ); |
|
| 1299 | + unset( $this->uninstall[ 'site' ][ $items_key ] ); |
|
| 1300 | 1300 | } |
| 1301 | 1301 | } |
| 1302 | 1302 | |
@@ -1346,7 +1346,7 @@ discard block |
||
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | 1348 | foreach ( $this->uninstall[ $type ][ $shortcut ] as $slug ) { |
| 1349 | - $this->uninstall[ $type ][ $canonical ][] = $args['prefix'] . $slug; |
|
| 1349 | + $this->uninstall[ $type ][ $canonical ][ ] = $args[ 'prefix' ] . $slug; |
|
| 1350 | 1350 | } |
| 1351 | 1351 | } |
| 1352 | 1352 | } |
@@ -1459,7 +1459,7 @@ discard block |
||
| 1459 | 1459 | $prefix = $wpdb->prefix; |
| 1460 | 1460 | } |
| 1461 | 1461 | |
| 1462 | - foreach ( $this->schema[ $type ]['tables'] as $table_name => $schema ) { |
|
| 1462 | + foreach ( $this->schema[ $type ][ 'tables' ] as $table_name => $schema ) { |
|
| 1463 | 1463 | maybe_convert_table_to_utf8mb4( $prefix . $table_name ); |
| 1464 | 1464 | } |
| 1465 | 1465 | } |
@@ -1489,31 +1489,31 @@ discard block |
||
| 1489 | 1489 | , $this->uninstall[ $type ] |
| 1490 | 1490 | ); |
| 1491 | 1491 | |
| 1492 | - if ( ! empty( $uninstall['custom_caps'] ) ) { |
|
| 1492 | + if ( ! empty( $uninstall[ 'custom_caps' ] ) ) { |
|
| 1493 | 1493 | $this->uninstall_custom_caps( $this->custom_caps_keys ); |
| 1494 | 1494 | } |
| 1495 | 1495 | |
| 1496 | - foreach ( $uninstall['user_meta'] as $meta_key ) { |
|
| 1496 | + foreach ( $uninstall[ 'user_meta' ] as $meta_key ) { |
|
| 1497 | 1497 | $this->uninstall_metadata( 'user', $meta_key ); |
| 1498 | 1498 | } |
| 1499 | 1499 | |
| 1500 | - foreach ( $uninstall['options'] as $option ) { |
|
| 1500 | + foreach ( $uninstall[ 'options' ] as $option ) { |
|
| 1501 | 1501 | $this->uninstall_option( $option ); |
| 1502 | 1502 | } |
| 1503 | 1503 | |
| 1504 | - foreach ( $uninstall['tables'] as $table ) { |
|
| 1504 | + foreach ( $uninstall[ 'tables' ] as $table ) { |
|
| 1505 | 1505 | $this->uninstall_table( $table ); |
| 1506 | 1506 | } |
| 1507 | 1507 | |
| 1508 | - foreach ( $uninstall['comment_meta'] as $meta_key ) { |
|
| 1508 | + foreach ( $uninstall[ 'comment_meta' ] as $meta_key ) { |
|
| 1509 | 1509 | $this->uninstall_metadata( 'comment', $meta_key ); |
| 1510 | 1510 | } |
| 1511 | 1511 | |
| 1512 | - foreach ( $uninstall['meta_boxes'] as $screen_id => $args ) { |
|
| 1512 | + foreach ( $uninstall[ 'meta_boxes' ] as $screen_id => $args ) { |
|
| 1513 | 1513 | $this->uninstall_meta_boxes( $screen_id, $args ); |
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | - foreach ( $uninstall['list_tables'] as $screen_id => $args ) { |
|
| 1516 | + foreach ( $uninstall[ 'list_tables' ] as $screen_id => $args ) { |
|
| 1517 | 1517 | $this->uninstall_list_table( $screen_id, $args ); |
| 1518 | 1518 | } |
| 1519 | 1519 | } |
@@ -1541,7 +1541,7 @@ discard block |
||
| 1541 | 1541 | protected function uninstall_metadata( $type, $key ) { |
| 1542 | 1542 | |
| 1543 | 1543 | if ( 'user' === $type && 'site' === $this->context ) { |
| 1544 | - $key = $GLOBALS['wpdb']->get_blog_prefix() . $key; |
|
| 1544 | + $key = $GLOBALS[ 'wpdb' ]->get_blog_prefix() . $key; |
|
| 1545 | 1545 | } |
| 1546 | 1546 | |
| 1547 | 1547 | if ( false !== strpos( $key, '%' ) ) { |
@@ -1608,20 +1608,20 @@ discard block |
||
| 1608 | 1608 | ); |
| 1609 | 1609 | |
| 1610 | 1610 | $args = array_merge( $defaults, $args ); |
| 1611 | - $args['options'] = array_merge( $defaults['options'], $args['options'] ); |
|
| 1611 | + $args[ 'options' ] = array_merge( $defaults[ 'options' ], $args[ 'options' ] ); |
|
| 1612 | 1612 | |
| 1613 | 1613 | // Each user gets to set the options to their liking. |
| 1614 | - foreach ( $args['options'] as $option ) { |
|
| 1614 | + foreach ( $args[ 'options' ] as $option ) { |
|
| 1615 | 1615 | |
| 1616 | 1616 | $this->uninstall_metadata( |
| 1617 | 1617 | 'user' |
| 1618 | - , "{$option}_{$args['parent']}_page_{$screen_id}" |
|
| 1618 | + , "{$option}_{$args[ 'parent' ]}_page_{$screen_id}" |
|
| 1619 | 1619 | ); |
| 1620 | 1620 | |
| 1621 | 1621 | if ( 'network' === $this->context ) { |
| 1622 | 1622 | $this->uninstall_metadata( |
| 1623 | 1623 | 'user' |
| 1624 | - , "{$option}_{$args['parent']}_page_{$screen_id}-network" |
|
| 1624 | + , "{$option}_{$args[ 'parent' ]}_page_{$screen_id}-network" |
|
| 1625 | 1625 | ); |
| 1626 | 1626 | } |
| 1627 | 1627 | } |
@@ -1668,7 +1668,7 @@ discard block |
||
| 1668 | 1668 | |
| 1669 | 1669 | $args = array_merge( $defaults, $args ); |
| 1670 | 1670 | |
| 1671 | - $network_parent = $args['parent']; |
|
| 1671 | + $network_parent = $args[ 'parent' ]; |
|
| 1672 | 1672 | $parent = $network_parent; |
| 1673 | 1673 | |
| 1674 | 1674 | // The parent page is usually the same on a multisite site, but we need to |
@@ -1680,20 +1680,20 @@ discard block |
||
| 1680 | 1680 | $meta_keys = array(); |
| 1681 | 1681 | |
| 1682 | 1682 | // Each user can hide specific columns of the table. |
| 1683 | - $meta_keys[] = "manage{$parent}_page_{$screen_id}columnshidden"; |
|
| 1683 | + $meta_keys[ ] = "manage{$parent}_page_{$screen_id}columnshidden"; |
|
| 1684 | 1684 | |
| 1685 | 1685 | if ( 'network' === $this->context ) { |
| 1686 | - $meta_keys[] = "manage{$network_parent}_page_{$screen_id}-networkcolumnshidden"; |
|
| 1686 | + $meta_keys[ ] = "manage{$network_parent}_page_{$screen_id}-networkcolumnshidden"; |
|
| 1687 | 1687 | } |
| 1688 | 1688 | |
| 1689 | 1689 | // Loop through each of the other options provided by this list table. |
| 1690 | - foreach ( $args['options'] as $option ) { |
|
| 1690 | + foreach ( $args[ 'options' ] as $option ) { |
|
| 1691 | 1691 | |
| 1692 | 1692 | // Each user gets to set the options to their liking. |
| 1693 | - $meta_keys[] = "{$parent}_page_{$screen_id}_{$option}"; |
|
| 1693 | + $meta_keys[ ] = "{$parent}_page_{$screen_id}_{$option}"; |
|
| 1694 | 1694 | |
| 1695 | 1695 | if ( 'network' === $this->context ) { |
| 1696 | - $meta_keys[] = "{$network_parent}_page_{$screen_id}_network_{$option}"; |
|
| 1696 | + $meta_keys[ ] = "{$network_parent}_page_{$screen_id}_network_{$option}"; |
|
| 1697 | 1697 | } |
| 1698 | 1698 | } |
| 1699 | 1699 | |
@@ -1857,7 +1857,7 @@ discard block |
||
| 1857 | 1857 | */ |
| 1858 | 1858 | protected function install_site() { |
| 1859 | 1859 | |
| 1860 | - if ( isset( $this->schema['site'] ) ) { |
|
| 1860 | + if ( isset( $this->schema[ 'site' ] ) ) { |
|
| 1861 | 1861 | $this->install_db_schema(); |
| 1862 | 1862 | } |
| 1863 | 1863 | |
@@ -1921,7 +1921,7 @@ discard block |
||
| 1921 | 1921 | */ |
| 1922 | 1922 | protected function uninstall_network() { |
| 1923 | 1923 | |
| 1924 | - if ( ! empty( $this->uninstall['network'] ) ) { |
|
| 1924 | + if ( ! empty( $this->uninstall[ 'network' ] ) ) { |
|
| 1925 | 1925 | $this->uninstall_( 'network' ); |
| 1926 | 1926 | } |
| 1927 | 1927 | |
@@ -1939,7 +1939,7 @@ discard block |
||
| 1939 | 1939 | */ |
| 1940 | 1940 | protected function uninstall_site() { |
| 1941 | 1941 | |
| 1942 | - if ( ! empty( $this->uninstall['site'] ) ) { |
|
| 1942 | + if ( ! empty( $this->uninstall[ 'site' ] ) ) { |
|
| 1943 | 1943 | $this->uninstall_( 'site' ); |
| 1944 | 1944 | } |
| 1945 | 1945 | |
@@ -1957,7 +1957,7 @@ discard block |
||
| 1957 | 1957 | */ |
| 1958 | 1958 | protected function uninstall_single() { |
| 1959 | 1959 | |
| 1960 | - if ( ! empty( $this->uninstall['single'] ) ) { |
|
| 1960 | + if ( ! empty( $this->uninstall[ 'single' ] ) ) { |
|
| 1961 | 1961 | $this->uninstall_( 'single' ); |
| 1962 | 1962 | } |
| 1963 | 1963 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | // If we're not running a module check, let the maintenance message show. |
| 23 | -if ( ! isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK. |
|
| 23 | +if ( ! isset( $_GET[ 'wordpoints_module_check' ], $_GET[ 'check_module' ] ) ) { // WPCS: CSRF OK. |
|
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | // If we're not running a module check, let the maintenance message show. |
| 23 | -if ( ! isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK. |
|
| 23 | +if ( ! isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { |
|
| 24 | +// WPCS: CSRF OK. |
|
| 24 | 25 | return; |
| 25 | 26 | } |
| 26 | 27 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | $module_data = wordpoints_get_module_data( wordpoints_modules_dir() . '/' . $module ); |
| 71 | 71 | |
| 72 | - return $module_data['network']; |
|
| 72 | + return $module_data[ 'network' ]; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -257,17 +257,17 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | $module_data = WordPoints_Modules::get_data( $module_file ); |
| 259 | 259 | |
| 260 | - if ( $module_data && wp_normalize_path( $module_file ) === $module_data['raw_file'] ) { |
|
| 261 | - unset( $module_data['raw'], $module_data['raw_file'] ); |
|
| 260 | + if ( $module_data && wp_normalize_path( $module_file ) === $module_data[ 'raw_file' ] ) { |
|
| 261 | + unset( $module_data[ 'raw' ], $module_data[ 'raw_file' ] ); |
|
| 262 | 262 | } else { |
| 263 | 263 | $module_data = get_file_data( $module_file, $default_headers, 'wordpoints_module' ); |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | - if ( ! empty( $module_data['update_api'] ) ) { |
|
| 266 | + if ( ! empty( $module_data[ 'update_api' ] ) ) { |
|
| 267 | 267 | _deprecated_argument( __FUNCTION__, '1.10.0', 'The "Update API" module header has been deprecated in favor of "Channel".' ); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - $module_data['network'] = ( 'true' === strtolower( $module_data['network'] ) ); |
|
| 270 | + $module_data[ 'network' ] = ( 'true' === strtolower( $module_data[ 'network' ] ) ); |
|
| 271 | 271 | |
| 272 | 272 | if ( $markup || $translate ) { |
| 273 | 273 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | // Translate fields |
| 278 | 278 | if ( $translate ) { |
| 279 | 279 | |
| 280 | - $textdomain = $module_data['text_domain']; |
|
| 280 | + $textdomain = $module_data[ 'text_domain' ]; |
|
| 281 | 281 | |
| 282 | 282 | if ( $textdomain ) { |
| 283 | 283 | |
@@ -285,8 +285,8 @@ discard block |
||
| 285 | 285 | |
| 286 | 286 | $domain_path = dirname( $module_file ); |
| 287 | 287 | |
| 288 | - if ( $module_data['domain_path'] ) { |
|
| 289 | - $domain_path .= $module_data['domain_path']; |
|
| 288 | + if ( $module_data[ 'domain_path' ] ) { |
|
| 289 | + $domain_path .= $module_data[ 'domain_path' ]; |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | wordpoints_load_module_textdomain( $textdomain, $domain_path ); |
@@ -309,48 +309,48 @@ discard block |
||
| 309 | 309 | ); |
| 310 | 310 | |
| 311 | 311 | $allowed_tags = $allowed_tags_in_links; |
| 312 | - $allowed_tags['a'] = array( 'href' => true, 'title' => true ); |
|
| 312 | + $allowed_tags[ 'a' ] = array( 'href' => true, 'title' => true ); |
|
| 313 | 313 | |
| 314 | 314 | // Name and author ar marked up inside <a> tags. Don't allow these. |
| 315 | - $module_data['name'] = wp_kses( $module_data['name'], $allowed_tags_in_links ); |
|
| 316 | - $module_data['author'] = wp_kses( $module_data['author'], $allowed_tags_in_links ); |
|
| 315 | + $module_data[ 'name' ] = wp_kses( $module_data[ 'name' ], $allowed_tags_in_links ); |
|
| 316 | + $module_data[ 'author' ] = wp_kses( $module_data[ 'author' ], $allowed_tags_in_links ); |
|
| 317 | 317 | |
| 318 | - $module_data['description'] = wp_kses( $module_data['description'], $allowed_tags ); |
|
| 319 | - $module_data['version'] = wp_kses( $module_data['version'], $allowed_tags ); |
|
| 318 | + $module_data[ 'description' ] = wp_kses( $module_data[ 'description' ], $allowed_tags ); |
|
| 319 | + $module_data[ 'version' ] = wp_kses( $module_data[ 'version' ], $allowed_tags ); |
|
| 320 | 320 | |
| 321 | - $module_data['module_uri'] = esc_url( $module_data['module_uri'] ); |
|
| 322 | - $module_data['author_uri'] = esc_url( $module_data['author_uri'] ); |
|
| 321 | + $module_data[ 'module_uri' ] = esc_url( $module_data[ 'module_uri' ] ); |
|
| 322 | + $module_data[ 'author_uri' ] = esc_url( $module_data[ 'author_uri' ] ); |
|
| 323 | 323 | |
| 324 | - $module_data['title'] = $module_data['name']; |
|
| 325 | - $module_data['author_name'] = $module_data['author']; |
|
| 324 | + $module_data[ 'title' ] = $module_data[ 'name' ]; |
|
| 325 | + $module_data[ 'author_name' ] = $module_data[ 'author' ]; |
|
| 326 | 326 | |
| 327 | 327 | // Apply markup. |
| 328 | 328 | if ( $markup ) { |
| 329 | 329 | |
| 330 | - if ( $module_data['module_uri'] && $module_data['name'] ) { |
|
| 331 | - $module_data['title'] = '<a href="' . $module_data['module_uri'] |
|
| 332 | - . '">' . $module_data['name'] . '</a>'; |
|
| 330 | + if ( $module_data[ 'module_uri' ] && $module_data[ 'name' ] ) { |
|
| 331 | + $module_data[ 'title' ] = '<a href="' . $module_data[ 'module_uri' ] |
|
| 332 | + . '">' . $module_data[ 'name' ] . '</a>'; |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | - if ( $module_data['author_uri'] && $module_data['author'] ) { |
|
| 336 | - $module_data['author'] = '<a href="' . $module_data['author_uri'] |
|
| 337 | - . '">' . $module_data['author'] . '</a>'; |
|
| 335 | + if ( $module_data[ 'author_uri' ] && $module_data[ 'author' ] ) { |
|
| 336 | + $module_data[ 'author' ] = '<a href="' . $module_data[ 'author_uri' ] |
|
| 337 | + . '">' . $module_data[ 'author' ] . '</a>'; |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | - $module_data['description'] = wptexturize( $module_data['description'] ); |
|
| 340 | + $module_data[ 'description' ] = wptexturize( $module_data[ 'description' ] ); |
|
| 341 | 341 | |
| 342 | - if ( $module_data['author'] ) { |
|
| 343 | - $module_data['description'] .= ' <cite>' |
|
| 342 | + if ( $module_data[ 'author' ] ) { |
|
| 343 | + $module_data[ 'description' ] .= ' <cite>' |
|
| 344 | 344 | // translators: Author name. |
| 345 | - . sprintf( __( 'By %s.', 'wordpoints' ), $module_data['author'] ) |
|
| 345 | + . sprintf( __( 'By %s.', 'wordpoints' ), $module_data[ 'author' ] ) |
|
| 346 | 346 | . '</cite>'; |
| 347 | 347 | } |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | } else { |
| 351 | 351 | |
| 352 | - $module_data['title'] = $module_data['name']; |
|
| 353 | - $module_data['author_name'] = $module_data['author']; |
|
| 352 | + $module_data[ 'title' ] = $module_data[ 'name' ]; |
|
| 353 | + $module_data[ 'author_name' ] = $module_data[ 'author' ]; |
|
| 354 | 354 | |
| 355 | 355 | } // End if ( $markup || $translate ) else. |
| 356 | 356 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | $module_data = wordpoints_get_module_data( $module_file, $markup, $translate ); |
| 476 | 476 | |
| 477 | - if ( empty( $module_data['name'] ) ) { |
|
| 477 | + if ( empty( $module_data[ 'name' ] ) ) { |
|
| 478 | 478 | continue; |
| 479 | 479 | } |
| 480 | 480 | |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | */ |
| 574 | 574 | function _wordpoints_sort_uname_callback( $a, $b ) { |
| 575 | 575 | |
| 576 | - return strnatcasecmp( $a['name'], $b['name'] ); |
|
| 576 | + return strnatcasecmp( $a[ 'name' ], $b[ 'name' ] ); |
|
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | /** |
@@ -691,7 +691,7 @@ discard block |
||
| 691 | 691 | |
| 692 | 692 | } else { |
| 693 | 693 | |
| 694 | - $current[] = $module; |
|
| 694 | + $current[ ] = $module; |
|
| 695 | 695 | sort( $current ); |
| 696 | 696 | update_option( 'wordpoints_active_modules', $current ); |
| 697 | 697 | } |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | $checked = array(); |
| 858 | 858 | |
| 859 | 859 | foreach ( $modules as $module ) { |
| 860 | - $checked[] = 'checked[]=' . $module; |
|
| 860 | + $checked[ ] = 'checked[]=' . $module; |
|
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | ob_start(); |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | if ( ! $deleted ) { |
| 937 | - $errors[] = $module_file; |
|
| 937 | + $errors[ ] = $module_file; |
|
| 938 | 938 | } |
| 939 | 939 | } |
| 940 | 940 | |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | $parts = explode( '\\', $slug, 2 ); |
| 71 | 71 | |
| 72 | - if ( isset( $parts[1] ) ) { |
|
| 73 | - $parsed['dynamic'] = $parts[1]; |
|
| 74 | - $parsed['generic'] = $parts[0]; |
|
| 72 | + if ( isset( $parts[ 1 ] ) ) { |
|
| 73 | + $parsed[ 'dynamic' ] = $parts[ 1 ]; |
|
| 74 | + $parsed[ 'generic' ] = $parts[ 0 ]; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $parsed; |
@@ -341,11 +341,11 @@ discard block |
||
| 341 | 341 | |
| 342 | 342 | $supports = get_all_post_type_supports( $slug ); |
| 343 | 343 | |
| 344 | - if ( isset( $supports['editor'] ) ) { |
|
| 344 | + if ( isset( $supports[ 'editor' ] ) ) { |
|
| 345 | 345 | $children->register( "post\\{$slug}", 'content', 'WordPoints_Entity_Post_Content' ); |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | - if ( isset( $supports['comments'] ) ) { |
|
| 348 | + if ( isset( $supports[ 'comments' ] ) ) { |
|
| 349 | 349 | $entities->register( "comment\\{$slug}", 'WordPoints_Entity_Comment' ); |
| 350 | 350 | $children->register( "comment\\{$slug}", "post\\{$slug}", 'WordPoints_Entity_Comment_Post' ); |
| 351 | 351 | $children->register( "comment\\{$slug}", 'author', 'WordPoints_Entity_Comment_Author' ); |
@@ -466,10 +466,10 @@ discard block |
||
| 466 | 466 | if ( |
| 467 | 467 | defined( 'DOING_AJAX' ) |
| 468 | 468 | && DOING_AJAX |
| 469 | - && isset( $_SERVER['HTTP_REFERER'] ) |
|
| 469 | + && isset( $_SERVER[ 'HTTP_REFERER' ] ) |
|
| 470 | 470 | && preg_match( |
| 471 | 471 | '#^' . preg_quote( network_admin_url(), '#' ) . '#i' |
| 472 | - , esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) |
|
| 472 | + , esc_url_raw( wp_unslash( $_SERVER[ 'HTTP_REFERER' ] ) ) |
|
| 473 | 473 | ) |
| 474 | 474 | ) { |
| 475 | 475 | return true; |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | add_action( 'admin_notices', 'WordPoints_Installables::admin_notices' ); |
| 29 | 29 | add_action( 'wpmu_new_blog', 'WordPoints_Installables::wpmu_new_blog' ); |
| 30 | 30 | |
| 31 | -if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK. |
|
| 31 | +if ( isset( $_GET[ 'wordpoints_module_check' ], $_GET[ 'check_module' ] ) ) { // WPCS: CSRF OK. |
|
| 32 | 32 | |
| 33 | 33 | add_action( 'shutdown', 'wordpoints_maintenance_shutdown_print_rand_str' ); |
| 34 | 34 | |
@@ -28,7 +28,8 @@ |
||
| 28 | 28 | add_action( 'admin_notices', 'WordPoints_Installables::admin_notices' ); |
| 29 | 29 | add_action( 'wpmu_new_blog', 'WordPoints_Installables::wpmu_new_blog' ); |
| 30 | 30 | |
| 31 | -if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK. |
|
| 31 | +if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { |
|
| 32 | +// WPCS: CSRF OK. |
|
| 32 | 33 | |
| 33 | 34 | add_action( 'shutdown', 'wordpoints_maintenance_shutdown_print_rand_str' ); |
| 34 | 35 | |