Completed
Pull Request — develop (#1504)
by Zack
17:49
created
future/includes/class-gv-collection-entry-sort.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 		if ( $this->field ) {
79 79
 			return array(
80 80
 				'key' => $this->field->ID,
81
-				'direction' => $this->direction ? : self::ASC,
81
+				'direction' => $this->direction ?: self::ASC,
82 82
 				'is_numeric' => self::ALPHA ? true : false,
83 83
 			);
84 84
 		}
Please login to merge, or discard this patch.
future/includes/class-gv-wrappers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@
 block discarded – undo
50 50
 		/**
51 51
 		 * By array.
52 52
 		 */
53
-		if ( is_array( $view ) && ! empty( $view['id'] ) ) {
54
-			return $this->get( $view['id'] );
53
+		if ( is_array( $view ) && ! empty( $view[ 'id' ] ) ) {
54
+			return $this->get( $view[ 'id' ] );
55 55
 		}
56 56
 
57 57
 		/**
Please login to merge, or discard this patch.
future/includes/rest/class-gv-rest-core.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 		require_once gravityview()->plugin->dir( 'future/includes/rest/class-gv-rest-route.php' );
22 22
 		require_once gravityview()->plugin->dir( 'future/includes/rest/class-gv-rest-views-route.php' );
23 23
 
24
-		self::$routes['views'] = $views = new Views_Route();
24
+		self::$routes[ 'views' ] = $views = new Views_Route();
25 25
 		$views->register_routes();
26 26
 	}
27 27
 
Please login to merge, or discard this patch.
future/includes/class-gv-shortcode-gvfield.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		$atts = apply_filters( 'gravityview/shortcodes/gvfield/atts', $atts );
45 45
 
46
-		if ( ! $view = \GV\View::by_id( $atts['view_id'] ) ) {
47
-			gravityview()->log->error( 'View #{view_id} not found', array( 'view_id' => $atts['view_id'] ) );
46
+		if ( ! $view = \GV\View::by_id( $atts[ 'view_id' ] ) ) {
47
+			gravityview()->log->error( 'View #{view_id} not found', array( 'view_id' => $atts[ 'view_id' ] ) );
48 48
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, null, null, $atts );
49 49
 		}
50 50
 
51
-		switch( $atts['entry_id'] ):
51
+		switch ( $atts[ 'entry_id' ] ):
52 52
 			case 'last':
53 53
 				if ( gravityview()->plugin->supports( \GV\Plugin::FEATURE_GFQUERY ) ) {
54 54
 					/**
@@ -57,17 +57,17 @@  discard block
 block discarded – undo
57 57
 					 * Since we're using \GF_Query shorthand initialization we have to reverse the order parameters here.
58 58
 					 */
59 59
 					add_filter( 'gravityview_get_entries', $filter = function( $parameters, $args, $form_id ) {
60
-						if ( ! empty( $parameters['sorting'] ) ) {
60
+						if ( ! empty( $parameters[ 'sorting' ] ) ) {
61 61
 							/**
62 62
 							 * Reverse existing sorts.
63 63
 							 */
64
-							$sort = &$parameters['sorting'];
65
-							$sort['direction'] = $sort['direction'] == 'RAND' ? : ( $sort['direction'] == 'ASC' ? 'DESC' : 'ASC' );
64
+							$sort = &$parameters[ 'sorting' ];
65
+							$sort[ 'direction' ] = $sort[ 'direction' ] == 'RAND' ?: ( $sort[ 'direction' ] == 'ASC' ? 'DESC' : 'ASC' );
66 66
 						} else {
67 67
 							/**
68 68
 							 * Otherwise, sort by date_created.
69 69
 							 */
70
-							$parameters['sorting'] = array(
70
+							$parameters[ 'sorting' ] = array(
71 71
 								'key' => 'id',
72 72
 								'direction' => 'ASC',
73 73
 								'is_numeric' => true
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 					/** If a sort already exists, reverse it. */
84 84
 					if ( $sort = end( $entries->sorts ) ) {
85
-						$entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ? : ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode );
85
+						$entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ?: ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode );
86 86
 					} else {
87 87
 						/** Otherwise, sort by date_created */
88 88
 						$entries = $entries->sort( new \GV\Entry_Sort( \GV\Internal_Field::by_id( 'id' ), \GV\Entry_Sort::ASC ), \GV\Entry_Sort::NUMERIC );
@@ -99,20 +99,20 @@  discard block
 block discarded – undo
99 99
 				}
100 100
 				break;
101 101
 			default:
102
-				if ( ! $entry = \GV\GF_Entry::by_id( $atts['entry_id'] ) ) {
103
-					gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts['view_id'] ) );
102
+				if ( ! $entry = \GV\GF_Entry::by_id( $atts[ 'entry_id' ] ) ) {
103
+					gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts[ 'view_id' ] ) );
104 104
 					return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, null, $atts );
105 105
 				}
106 106
 		endswitch;
107 107
 
108
-		$field = is_numeric( $atts['field_id'] ) ? \GV\GF_Field::by_id( $view->form, $atts['field_id'] ) : \GV\Internal_Field::by_id( $atts['field_id'] );
108
+		$field = is_numeric( $atts[ 'field_id' ] ) ? \GV\GF_Field::by_id( $view->form, $atts[ 'field_id' ] ) : \GV\Internal_Field::by_id( $atts[ 'field_id' ] );
109 109
 
110 110
 		if ( ! $field ) {
111
-			gravityview()->log->error( 'Field #{field_id} not found', array( 'view_id' => $atts['field_id'] ) );
111
+			gravityview()->log->error( 'Field #{field_id} not found', array( 'view_id' => $atts[ 'field_id' ] ) );
112 112
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, $field, $atts );
113 113
 		}
114 114
 
115
-		if ( $view->form->ID != $entry['form_id'] ) {
115
+		if ( $view->form->ID != $entry[ 'form_id' ] ) {
116 116
 			gravityview()->log->error( 'Entry does not belong to view (form mismatch)' );
117 117
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, $atts );
118 118
 		}
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', get_the_password_form( $view->ID ), $view, $entry, $atts );
123 123
 		}
124 124
 
125
-		if ( ! $view->form  ) {
125
+		if ( ! $view->form ) {
126 126
 			gravityview()->log->notice( 'View #{id} has no form attached to it.', array( 'id' => $view->ID ) );
127 127
 
128 128
 			/**
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 		}
146 146
 
147 147
 		/** Unapproved entries. */
148
-		if ( $entry['status'] != 'active' ) {
148
+		if ( $entry[ 'status' ] != 'active' ) {
149 149
 			gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) );
150 150
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, $atts );
151 151
 		}
152 152
 
153 153
 		if ( $view->settings->get( 'show_only_approved' ) ) {
154
-			if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
154
+			if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
155 155
 				gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) );
156 156
 				return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, $atts );
157 157
 			}
Please login to merge, or discard this patch.
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,6 @@
 block discarded – undo
18 18
 	/**
19 19
 	 * Process and output the [gvfield] shortcode.
20 20
 	 *
21
-	 * @param array $passed_atts The attributes passed.
22 21
 	 * @param string $content The content inside the shortcode.
23 22
 	 * @param string $tag The shortcode tag.
24 23
 	 *
Please login to merge, or discard this patch.
future/includes/class-gv-template-view.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -108,13 +108,13 @@
 block discarded – undo
108 108
 		global $post;
109 109
 
110 110
 		if ( ! $this->request->is_view() && $post ) {
111
-			$specifics []= sprintf( '%spost-%d-view-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name );
112
-			$specifics []= sprintf( '%spost-%d-%s.php', $slug_dir, $post->ID, $slug_name );
111
+			$specifics [ ] = sprintf( '%spost-%d-view-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name );
112
+			$specifics [ ] = sprintf( '%spost-%d-%s.php', $slug_dir, $post->ID, $slug_name );
113 113
 		}
114 114
 
115 115
 		
116
-		$specifics []= sprintf( '%sview-%d-%s.php', $slug_dir, $this->view->ID, $slug_name );
117
-		$specifics []= sprintf( '%sform-%d-%s.php', $slug_dir, $this->view->form->ID, $slug_name );
116
+		$specifics [ ] = sprintf( '%sview-%d-%s.php', $slug_dir, $this->view->ID, $slug_name );
117
+		$specifics [ ] = sprintf( '%sform-%d-%s.php', $slug_dir, $this->view->form->ID, $slug_name );
118 118
 
119 119
 		return array_merge( $specifics, $templates );
120 120
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-license-handler.php 4 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 			'author'    => self::author,
97 97
 			'language'  => get_locale(),
98 98
 			'url'       => home_url(),
99
-		    'beta'      => $this->settings->get( 'beta' ),
99
+			'beta'      => $this->settings->get( 'beta' ),
100 100
 		);
101 101
 
102 102
 		if ( ! empty( $action ) ) {
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	private function license_call_update_settings( $license_data, $data ) {
464 464
 		$settings = array();
465 465
 
466
-        $settings['license_key'] = $license_data->license_key = trim( $data['license'] );
466
+		$settings['license_key'] = $license_data->license_key = trim( $data['license'] );
467 467
 		$settings['license_key_status'] = $license_data->license;
468 468
 		$settings['license_key_response'] = (array)$license_data;
469 469
 
@@ -597,14 +597,14 @@  discard block
 block discarded – undo
597 597
 			// Call the custom API.
598 598
 			$response = wp_remote_post( self::url, array(
599 599
 				'timeout'   => 15,
600
-			    'sslverify' => false,
601
-			    'body'      =>  array(
602
-				    'edd_action' => 'check_license',
603
-				    'license'    => trim( $this->settings->get( 'license_key' ) ),
604
-				    'item_name'  => self::name,
605
-				    'url'        => home_url(),
606
-				    'site_data'  => $this->get_site_data(),
607
-			    ),
600
+				'sslverify' => false,
601
+				'body'      =>  array(
602
+					'edd_action' => 'check_license',
603
+					'license'    => trim( $this->settings->get( 'license_key' ) ),
604
+					'item_name'  => self::name,
605
+					'url'        => home_url(),
606
+					'site_data'  => $this->get_site_data(),
607
+				),
608 608
 			));
609 609
 
610 610
 			// make sure the response came back okay
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -174,7 +174,8 @@  discard block
 block discarded – undo
174 174
 			if ( empty( $license_data ) ) {
175 175
 				if ( $is_ajax ) {
176 176
 					exit( json_encode( array() ) );
177
-				} else { // Non-ajax call
177
+				} else {
178
+// Non-ajax call
178 179
 					return json_encode( array() );
179 180
 				}
180 181
 			}
@@ -207,7 +208,8 @@  discard block
 block discarded – undo
207 208
 
208 209
 		if ( $is_ajax ) {
209 210
 			exit( $json );
210
-		} else { // Non-ajax call
211
+		} else {
212
+// Non-ajax call
211 213
 			return ( Utils::_GET( 'format', Utils::get( $data, 'format' ) ) === 'object' ) ? $license_data : $json;
212 214
 		}
213 215
 	}
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -510,6 +510,9 @@  discard block
 block discarded – undo
510 510
 		$this->settings->set( $settings );
511 511
 	}
512 512
 
513
+	/**
514
+	 * @param boolean $echo
515
+	 */
513 516
 	public function settings_edd_license_activation( $field, $echo ) {
514 517
 
515 518
 		$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
@@ -617,7 +620,6 @@  discard block
 block discarded – undo
617 620
 	 * Check the GravityView license information
618 621
 	 *
619 622
 	 * @since 1.19.3
620
-	 * @param bool $force Whether to force checking license, even if AJAX
621 623
 	 *
622 624
 	 * @return void
623 625
 	 */
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		);
103 103
 
104 104
 		if ( ! empty( $action ) ) {
105
-			$settings['edd_action'] = esc_attr( $action );
105
+			$settings[ 'edd_action' ] = esc_attr( $action );
106 106
 		}
107 107
 
108 108
 		return array_map( 'urlencode', $settings );
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 			'format' => 'json',
159 159
 		) );
160 160
 
161
-		if ( $is_ajax && empty( $data['license'] ) ) {
161
+		if ( $is_ajax && empty( $data[ 'license' ] ) ) {
162 162
 			die( -1 );
163 163
 		}
164 164
 
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
 
187 187
 			$json = json_encode( $license_data );
188 188
 
189
-			$update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST('action');
189
+			$update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST( 'action' );
190 190
 
191 191
 			$is_check_action_button = ( 'check_license' === Utils::get( $data, 'edd_action' ) && defined( 'DOING_AJAX' ) && DOING_AJAX );
192 192
 
193
-			do_action('gravityview/admin_installer/delete_downloads_data', true );
193
+			do_action( 'gravityview/admin_installer/delete_downloads_data', true );
194 194
 
195 195
 			if ( $is_check_action_button ) {
196 196
 				delete_transient( self::status_transient_key );
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			// most likely a mistake.
202 202
 			} else if ( $license_data->license !== 'failed' && $update_license ) {
203 203
 
204
-				if ( ! empty( $data['field_id'] ) ) {
204
+				if ( ! empty( $data[ 'field_id' ] ) ) {
205 205
 					set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS );
206 206
 				}
207 207
 
@@ -227,11 +227,11 @@  discard block
 block discarded – undo
227 227
 	private function get_license_message( $license_data ) {
228 228
 		if ( empty( $license_data ) ) {
229 229
 			$message = '';
230
-			if (gravityview()->plugin->is_GF_25()) {
230
+			if ( gravityview()->plugin->is_GF_25() ) {
231 231
 				$message = $this->generate_license_box( $message, 'hide' );
232 232
 			}
233 233
 		} else {
234
-			if( ! empty( $license_data->error ) ) {
234
+			if ( ! empty( $license_data->error ) ) {
235 235
 				$class = 'error';
236 236
 				$string_key = $license_data->error;
237 237
 			} else { $class = $license_data->license;
@@ -257,12 +257,12 @@  discard block
 block discarded – undo
257 257
 	 */
258 258
 	public function license_details( $response = array() ) {
259 259
 
260
-		$response = (array) $response;
260
+		$response = (array)$response;
261 261
 
262 262
 		$return = '';
263 263
 		$wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>';
264 264
 
265
-		if ( ! empty( $response['license_key'] ) ) {
265
+		if ( ! empty( $response[ 'license_key' ] ) ) {
266 266
 			$return .= '<h3>' . rtrim( esc_html__( 'License Details:', 'gravityview' ), ':' ) . '</h3>';
267 267
 
268 268
 			if ( in_array( Utils::get( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) {
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
 					return sprintf( $wrapper, '' ); // Do not show redundant information - invalid/deactivated notice will be displayed by generate_license_box()
271 271
 				}
272 272
 
273
-				$return .= $this->strings( $response['license'], $response );
274
-			} elseif ( ! empty( $response['license_name'] ) ) {
273
+				$return .= $this->strings( $response[ 'license' ], $response );
274
+			} elseif ( ! empty( $response[ 'license_name' ] ) ) {
275 275
 				$response_keys = array(
276 276
 					'license_name'   => '',
277 277
 					'license_limit'  => '',
@@ -286,21 +286,21 @@  discard block
 block discarded – undo
286 286
 				$response = wp_parse_args( $response, $response_keys );
287 287
 
288 288
 				$login_link_class = gravityview()->plugin->is_GF_25() ? 'button button-outline outline' : 'text-link';
289
-				$login_link    = sprintf( '<a href="%s" class="gv-access-account ' . $login_link_class . '" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response['customer_email'] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
290
-				$local_text    = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
291
-				$license_limit = empty( $response['license_limit'] ) ? __( 'Unlimited', 'gravityview' ) : (int) $response['license_limit'];
292
-
293
-				$details    = array(
294
-					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), '<span class="gv-license-detail">' . esc_html( $response['license_name'] ) . '</span>' ),
295
-					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ),  '<span class="gv-license-detail">' . esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . $login_link . '</span>',
296
-					'activations' => sprintf( str_replace( '%d', '%s', esc_html__( 'Activations: %d of %s sites', 'gravityview' ) ), '<span class="gv-license-detail">' . intval( $response['site_count'] ), esc_html( $license_limit ) ) . '</span>' . $local_text,
297
-					'expires'     => 'lifetime' === $response['expires'] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ),
298
-					'upgrade'     => $this->get_upgrade_html( $response['upgrades'] ),
289
+				$login_link    = sprintf( '<a href="%s" class="gv-access-account ' . $login_link_class . '" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response[ 'customer_email' ] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
290
+				$local_text    = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
291
+				$license_limit = empty( $response[ 'license_limit' ] ) ? __( 'Unlimited', 'gravityview' ) : (int)$response[ 'license_limit' ];
292
+
293
+				$details = array(
294
+					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), '<span class="gv-license-detail">' . esc_html( $response[ 'license_name' ] ) . '</span>' ),
295
+					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), '<span class="gv-license-detail">' . esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . $login_link . '</span>',
296
+					'activations' => sprintf( str_replace( '%d', '%s', esc_html__( 'Activations: %d of %s sites', 'gravityview' ) ), '<span class="gv-license-detail">' . intval( $response[ 'site_count' ] ), esc_html( $license_limit ) ) . '</span>' . $local_text,
297
+					'expires'     => 'lifetime' === $response[ 'expires' ] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ),
298
+					'upgrade'     => $this->get_upgrade_html( $response[ 'upgrades' ] ),
299 299
 				);
300 300
 
301
-				if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) {
302
-					unset( $details['upgrade'] );
303
-					$details['expires'] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
301
+				if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) {
302
+					unset( $details[ 'upgrade' ] );
303
+					$details[ 'expires' ] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
304 304
 				}
305 305
 
306 306
 				$return .= '<ul><li>' . implode( '</li><li>', array_filter( $details ) ) . '</li></ul>';
@@ -326,20 +326,20 @@  discard block
 block discarded – undo
326 326
 		if ( ! empty( $upgrades ) ) {
327 327
 
328 328
 			$locale_parts = explode( '_', get_locale() );
329
-			$is_english = ( 'en' === $locale_parts[0] );
329
+			$is_english = ( 'en' === $locale_parts[ 0 ] );
330 330
 
331 331
 			$output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>';
332 332
 			$output .= '<ul class="ul-disc">';
333 333
 
334 334
 			foreach ( $upgrades as $upgrade_id => $upgrade ) {
335
-				$upgrade = (object) $upgrade;
335
+				$upgrade = (object)$upgrade;
336 336
 
337 337
 				$anchor_text = sprintf( esc_html_x( 'Upgrade to %1$s for %2$s', '1: GravityView upgrade name, 2: Cost of upgrade', 'gravityview' ), esc_attr( $upgrade->name ), esc_attr( $upgrade->price ) );
338 338
 
339 339
 				if ( $is_english && isset( $upgrade->description ) ) {
340 340
 					$message = esc_html( $upgrade->description );
341 341
 				} else {
342
-					switch( $upgrade->price_id ) {
342
+					switch ( $upgrade->price_id ) {
343 343
 						// Interstellar
344 344
 						case 1:
345 345
 						default:
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 			'invalid_item_id' => esc_html__( 'This license key does not have access to this plugin.', 'gravityview' ),
419 419
 			'missing' => esc_html__( 'The license key entered is invalid.', 'gravityview' ), // Missing is "the license couldn't be found", not "you submitted an empty license"
420 420
 			'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ),
421
-			'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="'. esc_url( $this->get_license_renewal_url( $license_data ) ) .'">', '</a>' ),
421
+			'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="' . esc_url( $this->get_license_renewal_url( $license_data ) ) . '">', '</a>' ),
422 422
 			'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ),
423 423
 			'verifying_license' => esc_html__( 'Verifying license&hellip;', 'gravityview' ),
424 424
 			'activate_license' => esc_html__( 'Activate License', 'gravityview' ),
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 
447 447
 		if ( ! empty( $license_data->renewal_url ) ) {
448 448
 			$renew_license_url = $license_data->renewal_url;
449
-		} elseif( ! empty( $license_data->license_key ) ) {
449
+		} elseif ( ! empty( $license_data->license_key ) ) {
450 450
 			$renew_license_url = sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s', $license_data->license_key );
451 451
 		} else {
452 452
 			$renew_license_url = 'https://gravityview.co/account/';
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	 * @return array|\WP_Error
464 464
 	 */
465 465
 	private function _license_get_remote_response( $data, $license = '' ) {
466
-		$api_params = $this->_get_edd_settings( $data['edd_action'], $license );
466
+		$api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license );
467 467
 
468 468
 		$url = add_query_arg( $api_params, self::url );
469 469
 
@@ -503,9 +503,9 @@  discard block
 block discarded – undo
503 503
 	private function license_call_update_settings( $license_data, $data ) {
504 504
 		$settings = array();
505 505
 
506
-        $settings['license_key'] = $license_data->license_key = trim( $data['license'] );
507
-		$settings['license_key_status'] = $license_data->license;
508
-		$settings['license_key_response'] = (array)$license_data;
506
+        $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] );
507
+		$settings[ 'license_key_status' ] = $license_data->license;
508
+		$settings[ 'license_key_response' ] = (array)$license_data;
509 509
 
510 510
 		$this->settings->set( $settings );
511 511
 	}
@@ -525,9 +525,9 @@  discard block
 block discarded – undo
525 525
 		$status = trim( $this->settings->get( 'license_key_status' ) );
526 526
 		$key = trim( $this->settings->get( 'license_key' ) );
527 527
 
528
-		if (  !empty( $key ) ) {
528
+		if ( ! empty( $key ) ) {
529 529
 			$response = $this->settings->get( 'license_key_response' );
530
-			$response = is_array( $response ) ? (object) $response : json_decode( $response );
530
+			$response = is_array( $response ) ? (object)$response : json_decode( $response );
531 531
 		} else {
532 532
 			$response = array();
533 533
 		}
@@ -570,11 +570,11 @@  discard block
 block discarded – undo
570 570
 
571 571
 		$submit = '<div class="gv-edd-button-wrapper">';
572 572
 		foreach ( $fields as $field ) {
573
-			$field['type'] = 'button';
574
-			$field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class;
575
-			$field['style'] = 'margin-left: 10px;';
576
-			if( $disabled_attribute ) {
577
-				$field['disabled'] = $disabled_attribute;
573
+			$field[ 'type' ] = 'button';
574
+			$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class;
575
+			$field[ 'style' ] = 'margin-left: 10px;';
576
+			if ( $disabled_attribute ) {
577
+				$field[ 'disabled' ] = $disabled_attribute;
578 578
 			}
579 579
 			$submit .= $this->settings->as_html( $field, $echo );
580 580
 		}
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 				    'url'        => home_url(),
654 654
 				    'site_data'  => $this->get_site_data(),
655 655
 			    ),
656
-			));
656
+			) );
657 657
 
658 658
 			// make sure the response came back okay
659 659
 			if ( is_wp_error( $response ) ) {
@@ -683,45 +683,45 @@  discard block
 block discarded – undo
683 683
 		$theme_data = wp_get_theme();
684 684
 		$theme      = $theme_data->Name . ' ' . $theme_data->Version;
685 685
 
686
-		$data['gv_version']  = Plugin::$version;
687
-		$data['php_version']  = phpversion();
688
-		$data['wp_version']   = get_bloginfo( 'version' );
689
-		$data['gf_version']  = \GFForms::$version;
690
-		$data['server']       = Utils::get( $_SERVER, 'SERVER_SOFTWARE' );
691
-		$data['multisite']    = is_multisite();
692
-		$data['theme']        = $theme;
693
-		$data['url']          = home_url();
694
-		$data['license_key']  = $this->settings->get( 'license_key' );
695
-		$data['beta']         = $this->settings->get( 'beta' );
686
+		$data[ 'gv_version' ]  = Plugin::$version;
687
+		$data[ 'php_version' ]  = phpversion();
688
+		$data[ 'wp_version' ]   = get_bloginfo( 'version' );
689
+		$data[ 'gf_version' ]  = \GFForms::$version;
690
+		$data[ 'server' ]       = Utils::get( $_SERVER, 'SERVER_SOFTWARE' );
691
+		$data[ 'multisite' ]    = is_multisite();
692
+		$data[ 'theme' ]        = $theme;
693
+		$data[ 'url' ]          = home_url();
694
+		$data[ 'license_key' ]  = $this->settings->get( 'license_key' );
695
+		$data[ 'beta' ]         = $this->settings->get( 'beta' );
696 696
 
697 697
 		// View Data
698 698
 		$gravityview_posts = wp_count_posts( 'gravityview', 'readable' );
699 699
 
700
-		$data['view_count'] = null;
701
-		$data['view_first'] = null;
702
-		$data['view_latest'] = null;
700
+		$data[ 'view_count' ] = null;
701
+		$data[ 'view_first' ] = null;
702
+		$data[ 'view_latest' ] = null;
703 703
 
704 704
 		if ( $gravityview_posts->publish ) {
705
-			$data['view_count'] = $gravityview_posts->publish;
705
+			$data[ 'view_count' ] = $gravityview_posts->publish;
706 706
 
707 707
 			$first = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=ASC' );
708 708
 			$latest = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=DESC' );
709 709
 
710 710
 			if ( $first = array_shift( $first ) ) {
711
-				$data['view_first'] = $first->post_date;
711
+				$data[ 'view_first' ] = $first->post_date;
712 712
 			}
713 713
 			if ( $latest = array_pop( $latest ) ) {
714
-				$data['view_latest'] = $latest->post_date;
714
+				$data[ 'view_latest' ] = $latest->post_date;
715 715
 			}
716 716
 		}
717 717
 
718 718
 		// Form counts
719 719
 		if ( class_exists( 'GFFormsModel' ) ) {
720 720
 			$form_data = \GFFormsModel::get_form_count();
721
-			$data['forms_total'] = Utils::get( $form_data, 'total', 0 );
722
-			$data['forms_active'] = Utils::get( $form_data, 'active', 0 );
723
-			$data['forms_inactive'] = Utils::get( $form_data, 'inactive', 0 );
724
-			$data['forms_trash'] = Utils::get( $form_data, 'inactive', 0 );
721
+			$data[ 'forms_total' ] = Utils::get( $form_data, 'total', 0 );
722
+			$data[ 'forms_active' ] = Utils::get( $form_data, 'active', 0 );
723
+			$data[ 'forms_inactive' ] = Utils::get( $form_data, 'inactive', 0 );
724
+			$data[ 'forms_trash' ] = Utils::get( $form_data, 'inactive', 0 );
725 725
 		}
726 726
 
727 727
 		// Retrieve current plugin information
@@ -729,13 +729,13 @@  discard block
 block discarded – undo
729 729
 			include ABSPATH . '/wp-admin/includes/plugin.php';
730 730
 		}
731 731
 
732
-		$data['integrations']     = self::get_related_plugins_and_extensions();
733
-		$data['active_plugins']   = get_option( 'active_plugins', array() );
734
-		$data['inactive_plugins'] = array();
735
-		$data['locale']           = get_locale();
732
+		$data[ 'integrations' ]     = self::get_related_plugins_and_extensions();
733
+		$data[ 'active_plugins' ]   = get_option( 'active_plugins', array() );
734
+		$data[ 'inactive_plugins' ] = array();
735
+		$data[ 'locale' ]           = get_locale();
736 736
 
737 737
 		// Validate request on the GV server
738
-		$data['hash']             = 'gv_version.url.locale:' . sha1( $data['gv_version'] . $data['url'] . $data['locale'] );
738
+		$data[ 'hash' ]             = 'gv_version.url.locale:' . sha1( $data[ 'gv_version' ] . $data[ 'url' ] . $data[ 'locale' ] );
739 739
 
740 740
 		return $data;
741 741
 	}
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 
766 766
 				$plugin_data = get_plugin_data( $active_plugin );
767 767
 
768
-				$extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] );
768
+				$extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] );
769 769
 			}
770 770
 
771 771
 			if ( ! empty( $extensions ) ) {
Please login to merge, or discard this patch.
future/includes/class-gv-context-template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,8 +86,8 @@
 block discarded – undo
86 86
 		 */
87 87
 		$context->view = Utils::get( $template, 'view' );
88 88
 		$context->source = Utils::get( $template, 'source' );
89
-		$context->field = Utils::get( $template, 'field' ) ? : Utils::get( $data, 'field' );
90
-		$context->entry = Utils::get( $template, 'entry' ) ? : Utils::get( $data, 'entry' );
89
+		$context->field = Utils::get( $template, 'field' ) ?: Utils::get( $data, 'field' );
90
+		$context->entry = Utils::get( $template, 'entry' ) ?: Utils::get( $data, 'entry' );
91 91
 		$context->request = Utils::get( $template, 'request' );
92 92
 
93 93
 		$context->entries = Utils::get( $template, 'entries' ) ? $template->entries : null;
Please login to merge, or discard this patch.
future/includes/class-gv-logger-wp-action.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	protected function log( $level, $message, $context ) {
29 29
 
30
-		$php_version = ( ! empty( $GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] ) ) ?
31
-			$GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] : phpversion();
30
+		$php_version = ( ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] ) ) ?
31
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] : phpversion();
32 32
 
33 33
 		if ( version_compare( $php_version, '5.4', '>=' ) ) {
34 34
 			$backtrace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 3 );
35
-			$location = $this->interpolate( "{class}{type}{function}", $backtrace[2] );
35
+			$location = $this->interpolate( "{class}{type}{function}", $backtrace[ 2 ] );
36 36
 			$message = $this->interpolate( "[$level, $location] $message", $context );
37 37
 		} else {
38 38
 			$message = "[$level] $message";
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
 			do_action(
59 59
 				sprintf( 'gravityview_log_%s_test', $action ),
60 60
 				$this->interpolate( $message, $context ),
61
-				empty( $context['data'] ) ? array() : $context['data']
61
+				empty( $context[ 'data' ] ) ? array() : $context[ 'data' ]
62 62
 			);
63 63
 		}
64 64
 		
65 65
 		do_action(
66 66
 			sprintf( 'gravityview_log_%s', $action ),
67 67
 			$this->interpolate( $message, $context ),
68
-			empty( $context['data'] ) ? array() : $context['data']
68
+			empty( $context[ 'data' ] ) ? array() : $context[ 'data' ]
69 69
 		);
70 70
 	}
71 71
 }
Please login to merge, or discard this patch.
gravityview.php 3 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -237,26 +237,26 @@
 block discarded – undo
237 237
 
238 238
 	/** DEBUG */
239 239
 
240
-    /**
241
-     * Logs messages using Gravity Forms logging add-on
242
-     * @param  string $message log message
243
-     * @param mixed $data Additional data to display
240
+	/**
241
+	 * Logs messages using Gravity Forms logging add-on
242
+	 * @param  string $message log message
243
+	 * @param mixed $data Additional data to display
244 244
 	 * @deprecated use gravityview()->log
245
-     * @return void
246
-     */
247
-    public static function log_debug( $message, $data = null ){
245
+	 * @return void
246
+	 */
247
+	public static function log_debug( $message, $data = null ){
248 248
 		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
249 249
 		gravityview()->log->debug( $message, $data );
250
-    }
250
+	}
251 251
 
252
-    /**
253
-     * Logs messages using Gravity Forms logging add-on
254
-     * @param  string $message log message
252
+	/**
253
+	 * Logs messages using Gravity Forms logging add-on
254
+	 * @param  string $message log message
255 255
 	 * @deprecated use gravityview()->log
256
-     * @return void
257
-     */
258
-    public static function log_error( $message, $data = null ){
256
+	 * @return void
257
+	 */
258
+	public static function log_error( $message, $data = null ){
259 259
 		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
260 260
 		gravityview()->log->error( $message, $data );
261
-    }
261
+	}
262 262
 } // end class GravityView_Plugin
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	 * @deprecated use gravityview()->log
245 245
      * @return void
246 246
      */
247
-    public static function log_debug( $message, $data = null ){
247
+    public static function log_debug( $message, $data = null ) {
248 248
 		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
249 249
 		gravityview()->log->debug( $message, $data );
250 250
     }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 * @deprecated use gravityview()->log
256 256
      * @return void
257 257
      */
258
-    public static function log_error( $message, $data = null ){
258
+    public static function log_error( $message, $data = null ) {
259 259
 		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
260 260
 		gravityview()->log->error( $message, $data );
261 261
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	 * @deprecated use gravityview()->log
245 245
      * @return void
246 246
      */
247
-    public static function log_debug( $message, $data = null ){
247
+    public static function log_debug( $message, $data = null ) {
248 248
 		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
249 249
 		gravityview()->log->debug( $message, $data );
250 250
     }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 * @deprecated use gravityview()->log
256 256
      * @return void
257 257
      */
258
-    public static function log_error( $message, $data = null ){
258
+    public static function log_error( $message, $data = null ) {
259 259
 		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
260 260
 		gravityview()->log->error( $message, $data );
261 261
     }
Please login to merge, or discard this patch.