Completed
Branch master (e9e0b4)
by J.D.
03:54
created
src/components/ranks/includes/filters.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@
 block discarded – undo
7 7
  * @since 2.1.0
8 8
  */
9 9
 
10
-add_action( 'wordpoints_modules_loaded', 'WordPoints_Rank_Types::init' );
10
+add_action('wordpoints_modules_loaded', 'WordPoints_Rank_Types::init');
11 11
 
12
-add_action( 'wordpoints_ranks_register', 'wordpoints_register_core_ranks' );
12
+add_action('wordpoints_ranks_register', 'wordpoints_register_core_ranks');
13 13
 
14
-WordPoints_Shortcodes::register( 'wordpoints_user_rank', 'WordPoints_User_Rank_Shortcode' );
14
+WordPoints_Shortcodes::register('wordpoints_user_rank', 'WordPoints_User_Rank_Shortcode');
15 15
 
16 16
 // EOF
Please login to merge, or discard this patch.
src/components/ranks/includes/shortcodes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@
 block discarded – undo
19 19
 	 */
20 20
 	protected function verify_atts() {
21 21
 
22
-		if ( isset( $this->pairs['rank_group'] ) && empty( $this->atts['rank_group'] ) ) {
22
+		if (isset($this->pairs['rank_group']) && empty($this->atts['rank_group'])) {
23 23
 
24 24
 			return sprintf(
25
-				__( 'The “%1$s” attribute of the %2$s shortcode must be a rank group slug.', 'wordpoints' )
25
+				__('The “%1$s” attribute of the %2$s shortcode must be a rank group slug.', 'wordpoints')
26 26
 				,'rank_group'
27 27
 				, "<code>[{$this->shortcode}]</code>"
28 28
 			);
Please login to merge, or discard this patch.
src/components/ranks/includes/deprecated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
  */
18 18
 function wordpoints_ranks_get_db_schema() {
19 19
 
20
-	_deprecated_function( __FUNCTION__, '2.0.0' );
20
+	_deprecated_function(__FUNCTION__, '2.0.0');
21 21
 
22 22
 	global $wpdb;
23 23
 
Please login to merge, or discard this patch.
src/components/ranks/includes/rank-types/points.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
 	 *
39 39
 	 * @since 1.7.0
40 40
 	 */
41
-	public function __construct( array $args ) {
41
+	public function __construct(array $args) {
42 42
 
43
-		parent::__construct( $args );
43
+		parent::__construct($args);
44 44
 
45
-		$this->name = _x( 'Points', 'rank type', 'wordpoints' );
45
+		$this->name = _x('Points', 'rank type', 'wordpoints');
46 46
 
47
-		if ( ! isset( $args['points_type'] ) ) {
47
+		if ( ! isset($args['points_type'])) {
48 48
 			_doing_it_wrong(
49 49
 				__METHOD__
50 50
 				, 'WordPoints Error: The "points_type" argument is required.'
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 			return;
54 54
 		}
55 55
 
56
-		$this->meta_fields['points']['label'] = _x( 'Points', 'form label', 'wordpoints' );
56
+		$this->meta_fields['points']['label'] = _x('Points', 'form label', 'wordpoints');
57 57
 		$this->meta_fields['points_type']['default'] = $args['points_type'];
58 58
 
59
-		add_action( 'wordpoints_points_altered', array( $this, 'hook' ), 10, 3 );
59
+		add_action('wordpoints_points_altered', array($this, 'hook'), 10, 3);
60 60
 	}
61 61
 
62 62
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public function destruct() {
68 68
 
69
-		remove_action( 'wordpoints_points_altered', array( $this, 'hook' ), 10, 3 );
69
+		remove_action('wordpoints_points_altered', array($this, 'hook'), 10, 3);
70 70
 	}
71 71
 
72 72
 	/**
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 	 * @param int    $points      The number of points.
79 79
 	 * @param string $points_type The type of points.
80 80
 	 */
81
-	public function hook( $user_id, $points, $points_type ) {
81
+	public function hook($user_id, $points, $points_type) {
82 82
 
83
-		if ( $points_type !== $this->meta_fields['points_type']['default'] ) {
83
+		if ($points_type !== $this->meta_fields['points_type']['default']) {
84 84
 			return;
85 85
 		}
86 86
 
87
-		$this->maybe_transition_user_ranks( $user_id, $points > 0 );
87
+		$this->maybe_transition_user_ranks($user_id, $points > 0);
88 88
 	}
89 89
 
90 90
 	/**
@@ -96,34 +96,34 @@  discard block
 block discarded – undo
96 96
 	 *
97 97
 	 * @return array|false The validated metadata or false if it should't be saved.
98 98
 	 */
99
-	public function validate_rank_meta( array $meta ) {
99
+	public function validate_rank_meta(array $meta) {
100 100
 
101
-		if ( ! isset( $meta['points'] ) || false === wordpoints_int( $meta['points'] ) ) {
101
+		if ( ! isset($meta['points']) || false === wordpoints_int($meta['points'])) {
102 102
 			return new WP_Error(
103 103
 				'wordpoints_points_rank_type_invalid_points'
104
-				, __( 'The amount of points is required, and must be a valid number.', 'wordpoints' )
105
-				, array( 'field' => 'points' )
104
+				, __('The amount of points is required, and must be a valid number.', 'wordpoints')
105
+				, array('field' => 'points')
106 106
 			);
107 107
 		}
108 108
 
109 109
 		if (
110
-			! isset( $meta['points_type'] )
111
-			|| ! wordpoints_is_points_type( $meta['points_type'] )
110
+			! isset($meta['points_type'])
111
+			|| ! wordpoints_is_points_type($meta['points_type'])
112 112
 		) {
113 113
 			return false;
114 114
 		}
115 115
 
116
-		$minimum = wordpoints_get_points_minimum( $meta['points_type'] );
116
+		$minimum = wordpoints_get_points_minimum($meta['points_type']);
117 117
 
118
-		if ( $meta['points'] < $minimum ) {
118
+		if ($meta['points'] < $minimum) {
119 119
 
120 120
 			return new WP_Error(
121 121
 				'wordpoints_points_rank_type_points_less_than_minimum'
122 122
 				, sprintf(
123
-					__( 'The number of points must be more than the minimum (%s).', 'wordpoints' )
124
-					, wordpoints_format_points( $minimum, $meta['points_type'], 'points_rank_error' )
123
+					__('The number of points must be more than the minimum (%s).', 'wordpoints')
124
+					, wordpoints_format_points($minimum, $meta['points_type'], 'points_rank_error')
125 125
 				)
126
-				, array( 'field' => 'points' )
126
+				, array('field' => 'points')
127 127
 			);
128 128
 		}
129 129
 
@@ -146,15 +146,15 @@  discard block
 block discarded – undo
146 146
 	 *
147 147
 	 * @return bool Whether the user meets the requirements for this rank.
148 148
 	 */
149
-	protected function can_transition_user_rank( $user_id, $rank, array $args ) {
149
+	protected function can_transition_user_rank($user_id, $rank, array $args) {
150 150
 
151
-		if ( $rank->points_type !== $this->meta_fields['points_type']['default'] ) {
151
+		if ($rank->points_type !== $this->meta_fields['points_type']['default']) {
152 152
 			return false;
153 153
 		}
154 154
 
155
-		$user_points = wordpoints_get_points( $user_id, $rank->points_type );
155
+		$user_points = wordpoints_get_points($user_id, $rank->points_type);
156 156
 
157
-		if ( $rank->points > $user_points ) {
157
+		if ($rank->points > $user_points) {
158 158
 			return false;
159 159
 		}
160 160
 
Please login to merge, or discard this patch.
src/components/ranks/includes/rank-types/base.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @return array|false The validated metadata or false if it should't be saved.
34 34
 	 */
35
-	public function validate_rank_meta( array $meta ) {
35
+	public function validate_rank_meta(array $meta) {
36 36
 		return $meta;
37 37
 	}
38 38
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 *
53 53
 	 * @return bool Whether the user meets the requirements for this rank.
54 54
 	 */
55
-	protected function can_transition_user_rank( $user_id, $rank, array $args ) {
55
+	protected function can_transition_user_rank($user_id, $rank, array $args) {
56 56
 		return true;
57 57
 	}
58 58
 }
Please login to merge, or discard this patch.
src/components/ranks/includes/class-wordpoints-rank.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -75,17 +75,17 @@  discard block
 block discarded – undo
75 75
 	 *
76 76
 	 * @param int|WordPoints_Rank $id The ID of a rank.
77 77
 	 */
78
-	public function __construct( $id ) {
78
+	public function __construct($id) {
79 79
 
80
-		if ( is_a( $id, __CLASS__ ) ) {
81
-			$this->init( $id->data );
80
+		if (is_a($id, __CLASS__)) {
81
+			$this->init($id->data);
82 82
 			return;
83 83
 		}
84 84
 
85
-		$id = wordpoints_int( $id );
85
+		$id = wordpoints_int($id);
86 86
 
87
-		if ( $id ) {
88
-			$this->init( self::get_data( $id ) );
87
+		if ($id) {
88
+			$this->init(self::get_data($id));
89 89
 		}
90 90
 	}
91 91
 
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
 	 *
95 95
 	 * @since 1.7.0
96 96
 	 */
97
-	public function __isset( $key ) {
97
+	public function __isset($key) {
98 98
 
99
-		if ( isset( $this->data->$key ) ) {
99
+		if (isset($this->data->$key)) {
100 100
 			return true;
101 101
 		}
102 102
 
103
-		return metadata_exists( 'wordpoints_rank', $this->ID, $key );
103
+		return metadata_exists('wordpoints_rank', $this->ID, $key);
104 104
 	}
105 105
 
106 106
 	/**
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 	 *
109 109
 	 * @since 1.7.0
110 110
 	 */
111
-	public function __get( $key ) {
111
+	public function __get($key) {
112 112
 
113
-		if ( 'ID' === $key ) {
113
+		if ('ID' === $key) {
114 114
 			return $this->ID;
115
-		} elseif ( isset( $this->data->$key ) ) {
115
+		} elseif (isset($this->data->$key)) {
116 116
 			$value = $this->data->$key;
117 117
 		} else {
118
-			$value = wordpoints_get_rank_meta( $this->ID, $key, true );
118
+			$value = wordpoints_get_rank_meta($this->ID, $key, true);
119 119
 		}
120 120
 
121 121
 		return $value;
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
 	 *
127 127
 	 * @since 1.7.0
128 128
 	 */
129
-	public function __set( $key, $value ) {
129
+	public function __set($key, $value) {
130 130
 
131
-		if ( 'ID' !== $key && 'data' !== $key ) {
131
+		if ('ID' !== $key && 'data' !== $key) {
132 132
 
133 133
 			_doing_it_wrong(
134 134
 				__METHOD__
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 	 *
146 146
 	 * @param object $data The data for a rank.
147 147
 	 */
148
-	public function init( $data ) {
148
+	public function init($data) {
149 149
 
150
-		if ( ! isset( $data->id ) ) {
150
+		if ( ! isset($data->id)) {
151 151
 			return;
152 152
 		}
153 153
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 */
165 165
 	public function exists() {
166 166
 
167
-		return ! empty( $this->ID );
167
+		return ! empty($this->ID);
168 168
 	}
169 169
 
170 170
 	/**
@@ -181,23 +181,23 @@  discard block
 block discarded – undo
181 181
 	 *
182 182
 	 * @return WordPoints_Rank|false The adjacent rank, or false.
183 183
 	 */
184
-	public function get_adjacent( $relative_position ) {
184
+	public function get_adjacent($relative_position) {
185 185
 
186
-		if ( 0 === wordpoints_int( $relative_position ) ) {
186
+		if (0 === wordpoints_int($relative_position)) {
187 187
 			return $this;
188 188
 		}
189 189
 
190
-		$group = WordPoints_Rank_Groups::get_group( $this->rank_group );
190
+		$group = WordPoints_Rank_Groups::get_group($this->rank_group);
191 191
 
192
-		$position = $group->get_rank_position( $this->ID );
192
+		$position = $group->get_rank_position($this->ID);
193 193
 
194
-		$adjacent_rank_id = $group->get_rank( $position + $relative_position );
194
+		$adjacent_rank_id = $group->get_rank($position + $relative_position);
195 195
 
196
-		if ( ! $adjacent_rank_id ) {
196
+		if ( ! $adjacent_rank_id) {
197 197
 			return false;
198 198
 		}
199 199
 
200
-		return new WordPoints_Rank( $adjacent_rank_id );
200
+		return new WordPoints_Rank($adjacent_rank_id);
201 201
 	}
202 202
 
203 203
 	//
@@ -213,11 +213,11 @@  discard block
 block discarded – undo
213 213
 	 *
214 214
 	 * @return object|false The rank's data, or false if not found.
215 215
 	 */
216
-	public static function get_data( $id ) {
216
+	public static function get_data($id) {
217 217
 
218
-		$rank_data = wp_cache_get( $id, 'wordpoints_ranks' );
218
+		$rank_data = wp_cache_get($id, 'wordpoints_ranks');
219 219
 
220
-		if ( false !== $rank_data ) {
220
+		if (false !== $rank_data) {
221 221
 			return $rank_data;
222 222
 		}
223 223
 
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 			)
235 235
 		);
236 236
 
237
-		if ( null === $rank_data ) {
237
+		if (null === $rank_data) {
238 238
 			return false;
239 239
 		}
240 240
 
241
-		wp_cache_add( $rank_data->id, $rank_data, 'wordpoints_ranks' );
241
+		wp_cache_add($rank_data->id, $rank_data, 'wordpoints_ranks');
242 242
 
243 243
 		return $rank_data;
244 244
 	}
Please login to merge, or discard this patch.
src/components/ranks/includes/class-un-installer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	protected $updates = array(
30 30
 		'1.8.0' => array( /*      -      */ 'site' => true, /*      -      */ ),
31
-		'2.0.0' => array( 'single' => true, /*     -     */ 'network' => true ),
31
+		'2.0.0' => array('single' => true, /*     -     */ 'network' => true),
32 32
 	);
33 33
 
34 34
 	/**
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	protected function before_update() {
81 81
 
82
-		if ( $this->network_wide ) {
83
-			unset( $this->updates['1_8_0'] );
82
+		if ($this->network_wide) {
83
+			unset($this->updates['1_8_0']);
84 84
 		}
85 85
 	}
86 86
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	protected function load_dependencies() {
98 98
 
99
-		include_once( WORDPOINTS_DIR . 'components/ranks/includes/constants.php' );
99
+		include_once(WORDPOINTS_DIR . 'components/ranks/includes/constants.php');
100 100
 	}
101 101
 
102 102
 	/**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			"
128 128
 		); // WPCS: cache pass.
129 129
 
130
-		$this->maybe_update_tables_to_utf8mb4( 'global' );
130
+		$this->maybe_update_tables_to_utf8mb4('global');
131 131
 	}
132 132
 
133 133
 	/**
Please login to merge, or discard this patch.
src/components/ranks/includes/class-wordpoints-rank-type.php 2 patches
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 *        @type string $slug The slug of this rank type.
76 76
 	 * }
77 77
 	 */
78
-	public function __construct( array $args ) {
78
+	public function __construct(array $args) {
79 79
 
80 80
 		$this->slug = $args['slug'];
81 81
 	}
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * @return array|WP_Error|false The validated metadata, or false or a WP_Error
110 110
 	 *                              if it should't be saved.
111 111
 	 */
112
-	abstract public function validate_rank_meta( array $meta );
112
+	abstract public function validate_rank_meta(array $meta);
113 113
 
114 114
 	/**
115 115
 	 * Determine if a user meets the requirements for a rank of this type.
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 *
127 127
 	 * @return bool Whether the user meets the requirements for this rank.
128 128
 	 */
129
-	abstract protected function can_transition_user_rank( $user_id, $rank, array $args );
129
+	abstract protected function can_transition_user_rank($user_id, $rank, array $args);
130 130
 
131 131
 	//
132 132
 	// Final Public Methods.
@@ -185,47 +185,47 @@  discard block
 block discarded – undo
185 185
 		array $args = array()
186 186
 	) {
187 187
 
188
-		$args = array_merge( array( 'placeholders' => false ), $args );
188
+		$args = array_merge(array('placeholders' => false), $args);
189 189
 
190
-		foreach ( $this->meta_fields as $name => $field ) {
190
+		foreach ($this->meta_fields as $name => $field) {
191 191
 
192 192
 			// If we aren't using placeholders, calculate the value. Hidden fields
193 193
 			// never use placeholders.
194
-			if ( ! $args['placeholders'] || 'hidden' === $field['type'] ) {
194
+			if ( ! $args['placeholders'] || 'hidden' === $field['type']) {
195 195
 
196 196
 				// Default to the default value.
197 197
 				$value = $field['default'];
198 198
 
199 199
 				// If the value is set use that instead.
200
-				if ( isset( $meta[ $name ] ) ) {
201
-					$value = $meta[ $name ];
200
+				if (isset($meta[$name])) {
201
+					$value = $meta[$name];
202 202
 				}
203 203
 			}
204 204
 
205
-			switch ( $field['type'] ) {
205
+			switch ($field['type']) {
206 206
 
207 207
 				case 'hidden':
208 208
 				case 'number':
209 209
 				case 'text':
210
-					if ( isset( $field['label'] ) ) {
210
+					if (isset($field['label'])) {
211 211
 						?><p class="description description-thin"><label><?php
212
-						echo esc_html( $field['label'] );
212
+						echo esc_html($field['label']);
213 213
 					}
214 214
 
215 215
 					?>
216 216
 					<input
217
-						type="<?php echo esc_attr( $field['type'] ); ?>"
218
-						name="<?php echo esc_attr( $name ); ?>"
219
-						<?php if ( $args['placeholders'] && 'hidden' !== $field['type'] ) : ?>
220
-						value="<% if ( typeof <?php echo preg_replace( '/[^a-z0-9_]/i', '', $name ); // WPCS: XSS OK ?> !== "undefined" ) { print( <?php echo preg_replace( '/[^a-z0-9_]/i', '', $name ); // WPCS: XSS OK ?> ); } %>"
217
+						type="<?php echo esc_attr($field['type']); ?>"
218
+						name="<?php echo esc_attr($name); ?>"
219
+						<?php if ($args['placeholders'] && 'hidden' !== $field['type']) : ?>
220
+						value="<% if ( typeof <?php echo preg_replace('/[^a-z0-9_]/i', '', $name); // WPCS: XSS OK ?> !== "undefined" ) { print( <?php echo preg_replace('/[^a-z0-9_]/i', '', $name); // WPCS: XSS OK ?> ); } %>"
221 221
 						<?php else : ?>
222
-						value="<?php echo esc_attr( $value ); ?>"
222
+						value="<?php echo esc_attr($value); ?>"
223 223
 						<?php endif; ?>
224 224
 						class="widefat"
225 225
 					/>
226 226
 					<?php
227 227
 
228
-					if ( isset( $field['label'] ) ) {
228
+					if (isset($field['label'])) {
229 229
 						?></label></p><?php
230 230
 					}
231 231
 				break;
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 						__METHOD__
236 236
 						, sprintf(
237 237
 							'WordPoints Error: Unknown field type "%s".'
238
-							, esc_html( $field['type'] )
238
+							, esc_html($field['type'])
239 239
 						)
240 240
 						, '1.7.0'
241 241
 					);
@@ -256,21 +256,21 @@  discard block
 block discarded – undo
256 256
 	 *
257 257
 	 * @return WordPoints_Rank The highest rank that the user can be increased to.
258 258
 	 */
259
-	final public function maybe_increase_user_rank( $user_id, $rank, array $args = array() ) {
259
+	final public function maybe_increase_user_rank($user_id, $rank, array $args = array()) {
260 260
 
261
-		$next_rank = $rank->get_adjacent( 1 );
261
+		$next_rank = $rank->get_adjacent(1);
262 262
 
263
-		if ( ! $next_rank ) {
263
+		if ( ! $next_rank) {
264 264
 			return $rank;
265 265
 		}
266 266
 
267
-		$rank_type = WordPoints_Rank_Types::get_type( $next_rank->type );
267
+		$rank_type = WordPoints_Rank_Types::get_type($next_rank->type);
268 268
 
269
-		if ( ! $rank_type->can_transition_user_rank( $user_id, $next_rank, $args ) ) {
269
+		if ( ! $rank_type->can_transition_user_rank($user_id, $next_rank, $args)) {
270 270
 			return $rank;
271 271
 		}
272 272
 
273
-		return $this->maybe_increase_user_rank( $user_id, $next_rank, $args );
273
+		return $this->maybe_increase_user_rank($user_id, $next_rank, $args);
274 274
 	}
275 275
 
276 276
 	/**
@@ -284,21 +284,21 @@  discard block
 block discarded – undo
284 284
 	 *
285 285
 	 * @return WordPoints_Rank The highest rank that the user can have.
286 286
 	 */
287
-	final public function maybe_decrease_user_rank( $user_id, $rank, array $args = array() ) {
287
+	final public function maybe_decrease_user_rank($user_id, $rank, array $args = array()) {
288 288
 
289
-		$rank_type = WordPoints_Rank_Types::get_type( $rank->type );
289
+		$rank_type = WordPoints_Rank_Types::get_type($rank->type);
290 290
 
291
-		if ( $rank_type->can_transition_user_rank( $user_id, $rank, $args ) ) {
291
+		if ($rank_type->can_transition_user_rank($user_id, $rank, $args)) {
292 292
 			return $rank;
293 293
 		}
294 294
 
295 295
 		$previous_rank = $rank->get_adjacent( -1 );
296 296
 
297
-		if ( ! $previous_rank ) {
297
+		if ( ! $previous_rank) {
298 298
 			return $rank;
299 299
 		}
300 300
 
301
-		return $this->maybe_decrease_user_rank( $user_id, $previous_rank, $args );
301
+		return $this->maybe_decrease_user_rank($user_id, $previous_rank, $args);
302 302
 	}
303 303
 
304 304
 	//
@@ -322,28 +322,28 @@  discard block
 block discarded – undo
322 322
 
323 323
 		$groups = WordPoints_Rank_Groups::get();
324 324
 
325
-		foreach ( $groups as $group_slug => $group ) {
325
+		foreach ($groups as $group_slug => $group) {
326 326
 
327
-			if ( ! WordPoints_Rank_Groups::is_type_registered_for_group( $this->slug, $group_slug ) ) {
327
+			if ( ! WordPoints_Rank_Groups::is_type_registered_for_group($this->slug, $group_slug)) {
328 328
 				continue;
329 329
 			}
330 330
 
331
-			$rank_id = wordpoints_get_user_rank( $user_id, $group_slug );
331
+			$rank_id = wordpoints_get_user_rank($user_id, $group_slug);
332 332
 
333
-			$rank = wordpoints_get_rank( $rank_id );
333
+			$rank = wordpoints_get_rank($rank_id);
334 334
 
335
-			if ( ! $rank ) {
335
+			if ( ! $rank) {
336 336
 				continue;
337 337
 			}
338 338
 
339
-			if ( $increase ) {
340
-				$new_rank = $this->maybe_increase_user_rank( $user_id, $rank, $args );
339
+			if ($increase) {
340
+				$new_rank = $this->maybe_increase_user_rank($user_id, $rank, $args);
341 341
 			} else {
342
-				$new_rank = $this->maybe_decrease_user_rank( $user_id, $rank, $args );
342
+				$new_rank = $this->maybe_decrease_user_rank($user_id, $rank, $args);
343 343
 			}
344 344
 
345
-			if ( $new_rank !== $rank ) {
346
-				wordpoints_update_user_rank( $user_id, $new_rank->ID );
345
+			if ($new_rank !== $rank) {
346
+				wordpoints_update_user_rank($user_id, $new_rank->ID);
347 347
 			}
348 348
 		}
349 349
 	}
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -218,8 +218,11 @@
 block discarded – undo
218 218
 						name="<?php echo esc_attr( $name ); ?>"
219 219
 						<?php if ( $args['placeholders'] && 'hidden' !== $field['type'] ) : ?>
220 220
 						value="<% if ( typeof <?php echo preg_replace( '/[^a-z0-9_]/i', '', $name ); // WPCS: XSS OK ?> !== "undefined" ) { print( <?php echo preg_replace( '/[^a-z0-9_]/i', '', $name ); // WPCS: XSS OK ?> ); } %>"
221
-						<?php else : ?>
222
-						value="<?php echo esc_attr( $value ); ?>"
221
+						<?php else {
222
+	: ?>
223
+						value="<?php echo esc_attr( $value );
224
+}
225
+?>"
223 226
 						<?php endif; ?>
224 227
 						class="widefat"
225 228
 					/>
Please login to merge, or discard this patch.
src/components/ranks/includes/integration/points.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@
 block discarded – undo
12 12
  *
13 13
  * @since 2.1.0
14 14
  */
15
-include_once( WORDPOINTS_DIR . '/components/ranks/includes/integration/points/functions.php' );
15
+include_once(WORDPOINTS_DIR . '/components/ranks/includes/integration/points/functions.php');
16 16
 
17 17
 /**
18 18
  * Actions and filters to integrate with the points component.
19 19
  *
20 20
  * @since 2.1.0
21 21
  */
22
-include_once( WORDPOINTS_DIR . '/components/ranks/includes/integration/points/filters.php' );
22
+include_once(WORDPOINTS_DIR . '/components/ranks/includes/integration/points/filters.php');
23 23
 
24 24
 // EOF
Please login to merge, or discard this patch.