Completed
Push — master ( 5a8fbc...eea109 )
by Mike
02:59
created
uninstall.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 use DummyPress as test;
4 4
 
5 5
 // If uninstall is not called from WordPress, exit
6
-if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
6
+if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
7 7
     exit();
8 8
 }
9 9
 
Please login to merge, or discard this patch.
views/users.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
  * @subpackage Test Content
12 12
  * @author     Old Town Media
13 13
  */
14
-class Users extends Abs\View{
14
+class Users extends Abs\View {
15 15
 
16 16
 	public function __construct() {
17 17
 
18 18
 		$this->title	= __( 'Users', 'dummybot' );
19 19
 		$this->type		= 'user';
20
-		$this->priority	= 4;
20
+		$this->priority = 4;
21 21
 
22 22
 	}
23 23
 
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 
41 41
 				$html .= "<h3>";
42 42
 
43
-					$html .= "<span class='label'>" . esc_html( $role['name'] ) . "</span>";
44
-					$html .= $this->build_button( 'create', $role['slug'], esc_html__( 'Create Users', 'dummybot' ) );
45
-					$html .= $this->build_button( 'delete', $role['slug'], esc_html__( 'Delete Users', 'dummybot' ) );
43
+					$html .= "<span class='label'>" . esc_html( $role[ 'name' ] ) . "</span>";
44
+					$html .= $this->build_button( 'create', $role[ 'slug' ], esc_html__( 'Create Users', 'dummybot' ) );
45
+					$html .= $this->build_button( 'delete', $role[ 'slug' ], esc_html__( 'Delete Users', 'dummybot' ) );
46 46
 
47 47
 				$html .= "</h3>";
48 48
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @subpackage Test Content
12 12
  * @author     Old Town Media
13 13
  */
14
-class Users extends Abs\View{
14
+class Users extends Abs\View {
15 15
 
16 16
 	public function __construct() {
17 17
 
Please login to merge, or discard this patch.
views/posts.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
  * @subpackage Test Content
11 11
  * @author     Old Town Media
12 12
  */
13
-class Posts extends Abs\View{
13
+class Posts extends Abs\View {
14 14
 
15 15
 	public function __construct() {
16 16
 
17 17
 		$this->title	= __( 'Posts', 'dummybot' );
18 18
 		$this->type		= 'post';
19
-		$this->priority	= 1;
19
+		$this->priority = 1;
20 20
 
21 21
 	}
22 22
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
  * @subpackage Test Content
11 11
  * @author     Old Town Media
12 12
  */
13
-class Posts extends Abs\View{
13
+class Posts extends Abs\View {
14 14
 
15 15
 	public function __construct() {
16 16
 
Please login to merge, or discard this patch.
views/various.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
  * @subpackage Test Content
11 11
  * @author     Old Town Media
12 12
  */
13
-class Various extends Abs\View{
13
+class Various extends Abs\View {
14 14
 
15 15
 	public function __construct() {
16 16
 
17 17
 		$this->title	= __( 'Various', 'dummybot' );
18 18
 		$this->type		= 'all';
19
-		$this->priority	= 10;
19
+		$this->priority = 10;
20 20
 
21 21
 	}
22 22
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
  * @subpackage Test Content
11 11
  * @author     Old Town Media
12 12
  */
13
-class Various extends Abs\View{
13
+class Various extends Abs\View {
14 14
 
15 15
 	public function __construct() {
16 16
 
Please login to merge, or discard this patch.
views/terms.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  * @subpackage Test Content
11 11
  * @author     Old Town Media
12 12
  */
13
-class Terms extends Abs\View{
13
+class Terms extends Abs\View {
14 14
 
15 15
 	public function __construct() {
16 16
 
17 17
 		$this->title	= __( 'Terms', 'dummybot' );
18 18
 		$this->type		= 'term';
19
-		$this->priority	= 2;
19
+		$this->priority = 2;
20 20
 
21 21
 	}
22 22
 
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 		foreach ( $taxonomies as $tax ) :
37 37
 
38 38
 			$skipped_taxonomies = array(
39
-				'post_format',				// We shouldn't be making random post format classes
40
-				'product_shipping_class',	// These aren't used visually and are therefore skipped
41
-				'nav_menu',					// Menus are handled seperately of taxonomies
39
+				'post_format', // We shouldn't be making random post format classes
40
+				'product_shipping_class', // These aren't used visually and are therefore skipped
41
+				'nav_menu', // Menus are handled seperately of taxonomies
42 42
 			);
43 43
 
44 44
 			// Skip banned taxonomies
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
  * @subpackage Test Content
11 11
  * @author     Old Town Media
12 12
  */
13
-class Terms extends Abs\View{
13
+class Terms extends Abs\View {
14 14
 
15 15
 	public function __construct() {
16 16
 
Please login to merge, or discard this patch.
dummybot.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 function dummypress_autoloader( $class ) {
25 25
 	$namespace = explode( '\\', $class );
26 26
 
27
- 	if ( __NAMESPACE__ !== $namespace[0] ) {
27
+ 	if ( __NAMESPACE__ !== $namespace[ 0 ] ) {
28 28
  		return;
29 29
  	}
30 30
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		'Views'
37 37
 	);
38 38
 
39
-	if ( in_array( $namespace[1], $nss ) ) {
39
+	if ( in_array( $namespace[ 1 ], $nss ) ) {
40 40
         $class = strtolower( preg_replace( '/(?<!^)([A-Z])/', '/\1', $class ) );
41 41
         $class = str_replace( '\\', '', $class );
42 42
      	$file  = dirname( __FILE__ ) . '/' . $class . '.php';
Please login to merge, or discard this patch.
types/user.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * @subpackage Evans
14 14
  * @author     Old Town Media
15 15
  */
16
-class User extends Abs\Type{
16
+class User extends Abs\Type {
17 17
 
18 18
 	/**
19 19
 	 * type
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		}
56 56
 
57 57
 		// Create test posts
58
-		for( $i = 0; $i < $num; $i++ ) {
58
+		for ( $i = 0; $i < $num; $i++ ) {
59 59
 
60 60
 			$return = $this->create_test_object( $slug );
61 61
 
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 		// First, insert our post
91 91
 		$userdata = array(
92 92
 			'user_pass'			=> wp_generate_password( 12, true, true ),
93
-			'user_login'		=> strtolower( $name['first'] . $name['last'] ) . rand( 10, 100 ),
93
+			'user_login'		=> strtolower( $name[ 'first' ] . $name[ 'last' ] ) . rand( 10, 100 ),
94 94
 			'user_email'		=> apply_filters( "tc_{$slug}_user_email", TestContent::email( true ) ),
95
-			'display_name'		=> strtolower( $name['first'] . $name['last'] ),
96
-			'first_name'		=> $name['first'],
97
-			'last_name'			=> $name['last'],
95
+			'display_name'		=> strtolower( $name[ 'first' ] . $name[ 'last' ] ),
96
+			'first_name'		=> $name[ 'first' ],
97
+			'last_name'			=> $name[ 'last' ],
98 98
 			'description'		=> TestContent::title(),
99 99
 			'user_registered'	=> date( 'Y-m-d H:i:s' ),
100 100
 			'role'				=> $slug,
@@ -149,13 +149,13 @@  discard block
 block discarded – undo
149 149
 
150 150
 		foreach ( $roles as $role ) {
151 151
 
152
-			if ( in_array( $role['name'], $skipped_roles ) ) {
152
+			if ( in_array( $role[ 'name' ], $skipped_roles ) ) {
153 153
 				continue;
154 154
 			}
155 155
 
156
-			$clean_roles[] = array(
157
-				'name'	=> $role['name'],
158
-				'slug'	=> $flipped[ $role['name'] ]
156
+			$clean_roles[ ] = array(
157
+				'name'	=> $role[ 'name' ],
158
+				'slug'	=> $flipped[ $role[ 'name' ] ]
159 159
 			);
160 160
 
161 161
 		}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	public function delete_all() {
174 174
 
175
-		$delete =  new Delete;
175
+		$delete = new Delete;
176 176
 
177 177
 		// Make sure that the current user is logged in & has full permissions.
178 178
 		if ( ! $delete->user_can_delete() ) {
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		// Loop through all user roles and remove any data
191 191
 		foreach ( $this->get_roles() as $role ) :
192 192
 
193
-			$this->delete( $role['slug'] );
193
+			$this->delete( $role[ 'slug' ] );
194 194
 
195 195
 		endforeach;
196 196
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 		);
243 243
 
244 244
 		$objects = new \WP_User_Query( $query );
245
-		$users	 = $objects->get_results();
245
+		$users = $objects->get_results();
246 246
 
247 247
 		if ( ! empty( $users ) ) {
248 248
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 					continue;
261 261
 				}
262 262
 
263
-				$events[] = array(
263
+				$events[ ] = array(
264 264
 					'action'	=> 'deleted',
265 265
 					'oid'		=> $user->ID,
266 266
 					'type'		=> $slug,
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
 			}
274 274
 
275
-			$events[] = array(
275
+			$events[ ] = array(
276 276
 				'action'	=> 'general',
277 277
 				'message'	=> __( 'Deleted', 'dummybot' ) . ' ' . $slug
278 278
 			);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
  * @subpackage Evans
14 14
  * @author     Old Town Media
15 15
  */
16
-class User extends Abs\Type{
16
+class User extends Abs\Type {
17 17
 
18 18
 	/**
19 19
 	 * type
Please login to merge, or discard this patch.
types/post.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * @subpackage Evans
14 14
  * @author     Old Town Media
15 15
  */
16
-class Post extends Abs\Type{
16
+class Post extends Abs\Type {
17 17
 
18 18
 	/**
19 19
 	 * metabox_types
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		}
90 90
 
91 91
 		// Create test posts
92
-		for( $i = 0; $i < $num; $i++ ) {
92
+		for ( $i = 0; $i < $num; $i++ ) {
93 93
 
94 94
 			$return = $this->create_test_object( $slug, $supports, $metaboxes );
95 95
 
@@ -131,18 +131,18 @@  discard block
 block discarded – undo
131 131
 		);
132 132
 
133 133
 		// Add title if supported
134
-		if ( $supports['title'] === true ) {
135
-			$post['post_title'] = $title;
134
+		if ( $supports[ 'title' ] === true ) {
135
+			$post[ 'post_title' ] = $title;
136 136
 		}
137 137
 
138 138
 		// Add main content if supported
139
-		if ( $supports['editor'] === true ) {
140
-			$post['post_content'] = apply_filters( "tc_{$slug}_post_content", TestContent::paragraphs() );
139
+		if ( $supports[ 'editor' ] === true ) {
140
+			$post[ 'post_content' ] = apply_filters( "tc_{$slug}_post_content", TestContent::paragraphs() );
141 141
 		}
142 142
 
143 143
 		// Add excerpt content if supported
144
-		if ( $supports['excerpt'] === true ) {
145
-			$post['post_excerpt'] = apply_filters( "tc_{$slug}_post_excerpt", TestContent::plain_text() );
144
+		if ( $supports[ 'excerpt' ] === true ) {
145
+			$post[ 'post_excerpt' ] = apply_filters( "tc_{$slug}_post_excerpt", TestContent::plain_text() );
146 146
 		}
147 147
 
148 148
 		// Insert then post object
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 		add_post_meta( $post_id, 'dummypress_test_data', '__test__', true );
153 153
 
154 154
 		// Add thumbnail if supported
155
-		if ( $this->connected == true && ( $supports['thumbnail'] === true || in_array( $slug, array( 'post', 'page' ) ) ) ) {
155
+		if ( $this->connected == true && ( $supports[ 'thumbnail' ] === true || in_array( $slug, array( 'post', 'page' ) ) ) ) {
156 156
 			 update_post_meta( $post_id, '_thumbnail_id', TestContent::image( $post_id ) );
157 157
 		}
158 158
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 				'object'	=> 'post',
181 181
 				'oid'		=> $post_id,
182 182
 				'type'		=> get_post_type( $post_id ),
183
-				'link_edit'	=> admin_url( '/post.php?post='.$post_id.'&action=edit' ),
183
+				'link_edit'	=> admin_url( '/post.php?post=' . $post_id . '&action=edit' ),
184 184
 				'link_view'	=> get_permalink( $post_id ),
185 185
 			);
186 186
 		}
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 			);
253 253
 
254 254
 			// Set the term data to update
255
-			$post_data['tax_input'][ $tax ] = array( $terms[$index]->term_id );
255
+			$post_data[ 'tax_input' ][ $tax ] = array( $terms[ $index ]->term_id );
256 256
 
257 257
 			// Update the post with the taxonomy info
258 258
 			$return = wp_update_post( $post_data );
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 	 */
276 276
 	public function delete_all() {
277 277
 
278
-		$delete =  new Delete;
278
+		$delete = new Delete;
279 279
 
280 280
 		// Make sure that the current user is logged in & has full permissions.
281 281
 		if ( ! $delete->user_can_delete() ) {
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 */
307 307
 	public function delete( $slug ) {
308 308
 
309
-		$delete =  new Delete;
309
+		$delete = new Delete;
310 310
 
311 311
 		// Make sure that the current user is logged in & has full permissions.
312 312
 		if ( ! $delete->user_can_delete() ) {
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 					continue;
354 354
 				}
355 355
 
356
-				$events[] = array(
356
+				$events[ ] = array(
357 357
 					'action'	=> 'deleted',
358 358
 					'oid'		=> get_the_id(),
359 359
 					'type'		=> get_post_type( get_the_id() ),
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 
368 368
 			$obj = get_post_type_object( $slug );
369 369
 
370
-			$events[] = array(
370
+			$events[ ] = array(
371 371
 				'action'	=> 'general',
372 372
 				'message'	=> __( 'Deleted', 'dummybot' ) . ' ' . $obj->labels->all_items
373 373
 			);
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 	 */
395 395
 	private function delete_associated_media( $pid ) {
396 396
 
397
-		$delete =  new Delete;
397
+		$delete = new Delete;
398 398
 
399 399
 		// Make sure that the current user is logged in & has full permissions.
400 400
 		if ( ! $delete->user_can_delete() ) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
  * @subpackage Evans
14 14
  * @author     Old Town Media
15 15
  */
16
-class Post extends Abs\Type{
16
+class Post extends Abs\Type {
17 17
 
18 18
 	/**
19 19
 	 * metabox_types
Please login to merge, or discard this patch.
types/term.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  * @subpackage Evans
13 13
  * @author     Old Town Media
14 14
  */
15
-class Term extends Abs\Type{
15
+class Term extends Abs\Type {
16 16
 
17 17
 	/**
18 18
 	 * type
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		}
54 54
 
55 55
 		// Create test terms
56
-		for( $i = 0; $i < $num; $i++ ) {
56
+		for ( $i = 0; $i < $num; $i++ ) {
57 57
 
58 58
 			$return = $this->create_test_object( $slug );
59 59
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		);
94 94
 
95 95
 		// Then, set a test content flag on the new post for later deletion
96
-		add_term_meta( $return['term_id'], 'dummypress_test_data', '__test__', true );
96
+		add_term_meta( $return[ 'term_id' ], 'dummypress_test_data', '__test__', true );
97 97
 
98 98
 		// Check if we have errors and return them or created message
99 99
 		if ( is_wp_error( $return ) ) {
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
 			return array(
104 104
 				'action'	=> 'created',
105 105
 				'object'	=> 'term',
106
-				'oid'		=> $return['term_id'],
106
+				'oid'		=> $return[ 'term_id' ],
107 107
 				'type'		=> $slug,
108
-				'link_edit'	=> admin_url( '/edit-tags.php?action=edit&taxonomy='.$slug.'&tag_ID='.$return['term_id'] ),
109
-				'link_view'	=> get_term_link( $return['term_id'] )
108
+				'link_edit'	=> admin_url( '/edit-tags.php?action=edit&taxonomy=' . $slug . '&tag_ID=' . $return[ 'term_id' ] ),
109
+				'link_view'	=> get_term_link( $return[ 'term_id' ] )
110 110
 			);
111 111
 		}
112 112
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function delete_all() {
123 123
 
124
-		$delete =  new Delete;
124
+		$delete = new Delete;
125 125
 
126 126
 		// Make sure that the current user is logged in & has full permissions.
127 127
 		if ( ! $delete->user_can_delete() ) {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public function delete( $slug ) {
154 154
 
155
-		$delete =  new Delete;
155
+		$delete = new Delete;
156 156
 
157 157
 		// Make sure that the current user is logged in & has full permissions.
158 158
 		if ( ! $delete->user_can_delete() ) {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 					continue;
196 196
 				}
197 197
 
198
-				$events[] = array(
198
+				$events[ ] = array(
199 199
 					'action'	=> 'deleted',
200 200
 					'oid'		=> $term->term_id,
201 201
 					'type'		=> $slug,
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
 			$taxonomy = get_taxonomy( $slug );
211 211
 
212
-			$events[] = array(
212
+			$events[ ] = array(
213 213
 				'action'	=> 'general',
214 214
 				'message'	=> __( 'Deleted', 'dummybot' ) . ' ' . $taxonomy->labels->name
215 215
 			);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
  * @subpackage Evans
13 13
  * @author     Old Town Media
14 14
  */
15
-class Term extends Abs\Type{
15
+class Term extends Abs\Type {
16 16
 
17 17
 	/**
18 18
 	 * type
Please login to merge, or discard this patch.