Completed
Push — master ( 8a7f17...ef3c16 )
by Zack
26:51 queued 23:00
created
includes/class-gravityview-entry-notes.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@
 block discarded – undo
141 141
 		global $wpdb;
142 142
 
143 143
 		if ( version_compare( GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' )
144
-		     && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) {
144
+			 && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) {
145 145
 			$notes_table = GFFormsModel::get_entry_notes_table_name();
146 146
 		} else {
147 147
 			$notes_table = GFFormsModel::get_lead_notes_table_name();
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 		// Make sure the keys are all set
68 68
 		$note = wp_parse_args( $note, $default_note );
69 69
 
70
-		GFFormsModel::add_note( intval( $note['lead_id'] ), intval( $note['user_id'] ), esc_attr( $note['user_name'] ), $note['note'], esc_attr( $note['note_type'] ) );
70
+		GFFormsModel::add_note( intval( $note[ 'lead_id' ] ), intval( $note[ 'user_id' ] ), esc_attr( $note[ 'user_name' ] ), $note[ 'note' ], esc_attr( $note[ 'note_type' ] ) );
71 71
 
72 72
 		// If last_error is empty string, there was no error.
73
-		if( empty( $wpdb->last_error ) ) {
73
+		if ( empty( $wpdb->last_error ) ) {
74 74
 			$return = $wpdb->insert_id;
75 75
 		} else {
76 76
 			$return = new WP_Error( 'gravityview-add-note', $wpdb->last_error );
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public static function delete_notes( $note_ids = array() ) {
98 98
 
99
-		if( !is_array( $note_ids ) ) {
99
+		if ( ! is_array( $note_ids ) ) {
100 100
 
101 101
 			gravityview()->log->error( 'Note IDs not an array. Not processing delete request.', array( 'data' => $note_ids ) );
102 102
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			)
157 157
 		);
158 158
 
159
-		return $results ? $results[0] : false;
159
+		return $results ? $results[ 0 ] : false;
160 160
 	}
161 161
 
162 162
 	/**
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	public static function filter_avatar( $avatar = '', $note ) {
171 171
 
172
-		if( 'gravityview' === $note->note_type && -1 === (int)$note->user_id ) {
173
-			$avatar =  sprintf( '<img src="%s" width="48" height="48" alt="GravityView" class="avatar avatar-48 gravityview-avatar" />', esc_url_raw( plugins_url( 'assets/images/floaty-avatar.png', GRAVITYVIEW_FILE ) ) );
172
+		if ( 'gravityview' === $note->note_type && -1 === (int)$note->user_id ) {
173
+			$avatar = sprintf( '<img src="%s" width="48" height="48" alt="GravityView" class="avatar avatar-48 gravityview-avatar" />', esc_url_raw( plugins_url( 'assets/images/floaty-avatar.png', GRAVITYVIEW_FILE ) ) );
174 174
 		}
175 175
 
176 176
 		return $avatar;
Please login to merge, or discard this patch.
includes/plugin-and-theme-hooks/class-gravityview-theme-hooks-wpml.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 		add_filter( 'icl_ls_languages', array( $this, 'wpml_ls_filter' ) );
66 66
 
67
-		add_filter( 'gravityview_directory_link', array( $this, 'filter_gravityview_back_link') );
67
+		add_filter( 'gravityview_directory_link', array( $this, 'filter_gravityview_back_link' ) );
68 68
 	}
69 69
 
70 70
 	/**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	function filter_gravityview_back_link( $link ) {
85 85
 		global $wpml_url_filters;
86 86
 
87
-		if( $wpml_url_filters ) {
87
+		if ( $wpml_url_filters ) {
88 88
 			$link = $wpml_url_filters->permalink_filter( $link, GravityView_frontend::getInstance()->getPostId() );
89 89
 		}
90 90
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	private function remove_url_hooks() {
102 102
 		global $wpml_url_filters;
103 103
 
104
-		if( ! $wpml_url_filters ) {
104
+		if ( ! $wpml_url_filters ) {
105 105
 			return;
106 106
 		}
107 107
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	private function add_url_hooks() {
130 130
 		global $wpml_url_filters;
131 131
 
132
-		if( ! $wpml_url_filters ) {
132
+		if ( ! $wpml_url_filters ) {
133 133
 			return;
134 134
 		}
135 135
 
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
 
179 179
 			$this->remove_url_hooks();
180 180
 
181
-			if( $translations ) {
181
+			if ( $translations ) {
182 182
 				foreach ( $languages as $lang_code => $language ) {
183 183
 
184
-					if( ! isset( $translations[ $lang_code ] ) || ! is_object( $translations[ $lang_code ] ) ) {
184
+					if ( ! isset( $translations[ $lang_code ] ) || ! is_object( $translations[ $lang_code ] ) ) {
185 185
 						continue;
186 186
 					}
187 187
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 							break;
216 216
 					}
217 217
 
218
-					$languages[ $lang_code ]['url'] = $entry_link;
218
+					$languages[ $lang_code ][ 'url' ] = $entry_link;
219 219
 				}
220 220
 			}
221 221
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-hidden.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	function edit_entry_fix_hidden_fields( $fields ) {
50 50
 
51 51
 		/** @var GF_Field $field */
52
-		foreach( $fields as &$field ) {
52
+		foreach ( $fields as &$field ) {
53 53
 			if ( 'hidden' === $field->type ) {
54 54
 
55 55
 				/**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 				 */
61 61
 				$reveal_hidden_field = apply_filters( 'gravityview/edit_entry/reveal_hidden_field', true, $field );
62 62
 
63
-				if( ! $reveal_hidden_field ) {
63
+				if ( ! $reveal_hidden_field ) {
64 64
 					continue;
65 65
 				}
66 66
 
Please login to merge, or discard this patch.
future/_mocks.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -10,6 +10,7 @@  discard block
 block discarded – undo
10 10
  * @internal
11 11
  * @since 2.0
12 12
  *
13
+ * @param \GravityView_View_Data $_this
13 14
  * @return array|false The old array data, or false on error.
14 15
  */
15 16
 function GravityView_View_Data_add_view( $view_id, $atts, $_this ) {
@@ -62,6 +63,8 @@  discard block
 block discarded – undo
62 63
  * @internal
63 64
  * @since 2.0
64 65
  *
66
+ * @param integer $form_id
67
+ * @param integer $count
65 68
  * @return array The old associative array data as returned by
66 69
  *  \GravityView_frontend::get_view_entries(), the paging parameters
67 70
  *  and a total count of all entries.
@@ -155,6 +158,7 @@  discard block
 block discarded – undo
155 158
  * @internal
156 159
  * @since 2.0
157 160
  *
161
+ * @param string $format
158 162
  * @return null|string The value of a field in an entry.
159 163
  */
160 164
 function GravityView_API_field_value( $entry, $field_settings, $format ) {
Please login to merge, or discard this patch.
Spacing   +43 added lines, -46 removed lines patch added patch discarded remove patch
@@ -101,8 +101,7 @@  discard block
 block discarded – undo
101 101
 			$entries = $view->get_entries( gravityview()->request );
102 102
 		}
103 103
 
104
-		$page = \GV\Utils::get( $parameters['paging'], 'current_page' ) ?
105
-			: ( ( ( $parameters['paging']['offset'] - $view->settings->get( 'offset' ) ) / $parameters['paging']['page_size'] ) + 1 );
104
+		$page = \GV\Utils::get( $parameters[ 'paging' ], 'current_page' ) ?: ( ( ( $parameters[ 'paging' ][ 'offset' ] - $view->settings->get( 'offset' ) ) / $parameters[ 'paging' ][ 'page_size' ] ) + 1 );
106 105
 
107 106
 		/** Set paging, count and unwrap the entries. */
108 107
 		$paging = array(
@@ -141,16 +140,16 @@  discard block
 block discarded – undo
141 140
  * @return null|string The value of a field in an entry.
142 141
  */
143 142
 function GravityView_API_field_value( $entry, $field_settings, $format ) {
144
-	if ( empty( $entry['form_id'] ) || empty( $field_settings['id'] ) ) {
143
+	if ( empty( $entry[ 'form_id' ] ) || empty( $field_settings[ 'id' ] ) ) {
145 144
 		gravityview()->log->error( 'No entry or field_settings[id] supplied', array( 'data' => array( func_get_args() ) ) );
146 145
 		return null;
147 146
 	}
148 147
 
149
-	if ( ! empty( $entry['_multi'] ) && ! empty( $field_settings['form_id'] ) && ! empty( $entry['_multi'][ $field_settings['form_id'] ] ) ) {
150
-		$entry = $entry['_multi'][ $field_settings['form_id'] ];
148
+	if ( ! empty( $entry[ '_multi' ] ) && ! empty( $field_settings[ 'form_id' ] ) && ! empty( $entry[ '_multi' ][ $field_settings[ 'form_id' ] ] ) ) {
149
+		$entry = $entry[ '_multi' ][ $field_settings[ 'form_id' ] ];
151 150
 	}
152 151
 
153
-	if ( empty( $entry['id'] ) || ! $entry = \GV\GF_Entry::by_id( $entry['id'] ) ) {
152
+	if ( empty( $entry[ 'id' ] ) || ! $entry = \GV\GF_Entry::by_id( $entry[ 'id' ] ) ) {
154 153
 		gravityview()->log->error( 'Invalid \GV\GF_Entry supplied', array( 'data' => $entry ) );
155 154
 		return null;
156 155
 	}
@@ -160,18 +159,18 @@  discard block
 block discarded – undo
160 159
 	 *
161 160
 	 * Fields with a numeric ID are Gravity Forms ones.
162 161
 	 */
163
-	$source = is_numeric( $field_settings['id'] ) ? \GV\Source::BACKEND_GRAVITYFORMS : \GV\Source::BACKEND_INTERNAL;;
162
+	$source = is_numeric( $field_settings[ 'id' ] ) ? \GV\Source::BACKEND_GRAVITYFORMS : \GV\Source::BACKEND_INTERNAL; ;
164 163
 
165 164
 	/** Initialize the future field. */
166 165
 	switch ( $source ):
167 166
 		/** The Gravity Forms backend. */
168 167
 		case \GV\Source::BACKEND_GRAVITYFORMS:
169
-			if ( ! $form = \GV\GF_Form::by_id( $entry['form_id'] ) ) {
168
+			if ( ! $form = \GV\GF_Form::by_id( $entry[ 'form_id' ] ) ) {
170 169
 				gravityview()->log->error( 'No form Gravity Form found for entry', array( 'data' => $entry ) );
171 170
 				return null;
172 171
 			}
173 172
 
174
-			if ( ! $field = $form::get_field( $form, $field_settings['id'] ) ) {
173
+			if ( ! $field = $form::get_field( $form, $field_settings[ 'id' ] ) ) {
175 174
 				return null;
176 175
 			}
177 176
 
@@ -179,7 +178,7 @@  discard block
 block discarded – undo
179 178
 
180 179
 		/** Our internal backend. */
181 180
 		case \GV\Source::BACKEND_INTERNAL:
182
-			if ( ! $field = \GV\Internal_Source::get_field( $field_settings['id'] ) ) {
181
+			if ( ! $field = \GV\Internal_Source::get_field( $field_settings[ 'id' ] ) ) {
183 182
 				return null;
184 183
 			}
185 184
 
@@ -213,13 +212,13 @@  discard block
 block discarded – undo
213 212
 
214 213
 	/** A bail condition. */
215 214
 	$bail = function( $label, $field_settings, $entry, $force_show_label, $form ) {
216
-		if ( ! empty( $field_settings['show_label'] ) || $force_show_label ) {
215
+		if ( ! empty( $field_settings[ 'show_label' ] ) || $force_show_label ) {
217 216
 
218
-			$label = isset( $field_settings['label'] ) ? $field_settings['label'] : '';
217
+			$label = isset( $field_settings[ 'label' ] ) ? $field_settings[ 'label' ] : '';
219 218
 
220 219
 			// Use Gravity Forms label by default, but if a custom label is defined in GV, use it.
221
-			if ( ! empty( $field_settings['custom_label'] ) ) {
222
-				$label = \GravityView_API::replace_variables( $field_settings['custom_label'], $form, $entry );
220
+			if ( ! empty( $field_settings[ 'custom_label' ] ) ) {
221
+				$label = \GravityView_API::replace_variables( $field_settings[ 'custom_label' ], $form, $entry );
223 222
 			}
224 223
 
225 224
 			/**
@@ -245,19 +244,19 @@  discard block
 block discarded – undo
245 244
 
246 245
 	$label = '';
247 246
 
248
-	if ( ! empty( $entry['_multi'] ) && ! empty( $field_settings['form_id'] ) && ! empty( $entry['_multi'][ $field_settings['form_id'] ] ) ) {
249
-		$entry = $entry['_multi'][ $field_settings['form_id'] ];
250
-		if ( $_form = \GV\GF_Form::by_id( $field_settings['form_id'] ) ) {
247
+	if ( ! empty( $entry[ '_multi' ] ) && ! empty( $field_settings[ 'form_id' ] ) && ! empty( $entry[ '_multi' ][ $field_settings[ 'form_id' ] ] ) ) {
248
+		$entry = $entry[ '_multi' ][ $field_settings[ 'form_id' ] ];
249
+		if ( $_form = \GV\GF_Form::by_id( $field_settings[ 'form_id' ] ) ) {
251 250
 			$form = $_form->form;
252 251
 		}
253 252
 	}
254 253
 
255
-	if ( empty( $entry['form_id'] ) || empty( $field_settings['id'] ) ) {
254
+	if ( empty( $entry[ 'form_id' ] ) || empty( $field_settings[ 'id' ] ) ) {
256 255
 		gravityview()->log->error( 'No entry or field_settings[id] supplied', array( 'data' => array( func_get_args() ) ) );
257 256
 		return $bail( $label, $field_settings, $entry, $force_show_label, $form );
258 257
 	}
259 258
 
260
-	if ( empty( $entry['id'] ) || ! $gv_entry = \GV\GF_Entry::by_id( $entry['id'] ) ) {
259
+	if ( empty( $entry[ 'id' ] ) || ! $gv_entry = \GV\GF_Entry::by_id( $entry[ 'id' ] ) ) {
261 260
 		gravityview()->log->error( 'Invalid \GV\GF_Entry supplied', array( 'data' => $entry ) );
262 261
 		return $bail( $label, $field_settings, $entry, $force_show_label, $form );
263 262
 	}
@@ -269,31 +268,31 @@  discard block
 block discarded – undo
269 268
 	 *
270 269
 	 * Fields with a numeric ID are Gravity Forms ones.
271 270
 	 */
272
-	$source = is_numeric( $field_settings['id'] ) ? \GV\Source::BACKEND_GRAVITYFORMS : \GV\Source::BACKEND_INTERNAL;
271
+	$source = is_numeric( $field_settings[ 'id' ] ) ? \GV\Source::BACKEND_GRAVITYFORMS : \GV\Source::BACKEND_INTERNAL;
273 272
 
274 273
 	/** Initialize the future field. */
275 274
 	switch ( $source ):
276 275
 		/** The Gravity Forms backend. */
277 276
 		case \GV\Source::BACKEND_GRAVITYFORMS:
278
-			if ( ! $gf_form = \GV\GF_Form::by_id( $entry['form_id'] ) ) {
277
+			if ( ! $gf_form = \GV\GF_Form::by_id( $entry[ 'form_id' ] ) ) {
279 278
 				gravityview()->log->error( 'No form Gravity Form found for entry', array( 'data' => $entry ) );
280 279
 				return $bail( $label, $field_settings, $entry->as_entry(), $force_show_label, $form );
281 280
 			}
282 281
 
283
-			if ( ! $field = $gf_form::get_field( $gf_form, $field_settings['id'] ) ) {
284
-				gravityview()->log->error( 'No field found for specified form and field ID #{field_id}', array( 'field_id' => $field_settings['id'], 'data' => $form ) );
282
+			if ( ! $field = $gf_form::get_field( $gf_form, $field_settings[ 'id' ] ) ) {
283
+				gravityview()->log->error( 'No field found for specified form and field ID #{field_id}', array( 'field_id' => $field_settings[ 'id' ], 'data' => $form ) );
285 284
 				return $bail( $label, $field_settings, $entry->as_entry(), $force_show_label, $gf_form->form );
286 285
 			}
287
-			if ( empty( $field_settings['show_label'] ) ) {
286
+			if ( empty( $field_settings[ 'show_label' ] ) ) {
288 287
 				/** The label never wins... */
289
-				$field_settings['label'] = '';
288
+				$field_settings[ 'label' ] = '';
290 289
 			}
291 290
 
292 291
 			break;
293 292
 
294 293
 		/** Our internal backend. */
295 294
 		case \GV\Source::BACKEND_INTERNAL:
296
-			if ( ! $field = \GV\Internal_Source::get_field( $field_settings['id'] ) ) {
295
+			if ( ! $field = \GV\Internal_Source::get_field( $field_settings[ 'id' ] ) ) {
297 296
 				return $bail( $label, $field_settings, $entry->as_entry(), $force_show_label, $form );
298 297
 			}
299 298
 			break;
@@ -305,8 +304,8 @@  discard block
 block discarded – undo
305 304
 			break;
306 305
 	endswitch;
307 306
 
308
-	if( $force_show_label ) {
309
-		$field_settings['show_label'] = '1';
307
+	if ( $force_show_label ) {
308
+		$field_settings[ 'show_label' ] = '1';
310 309
 	}
311 310
 
312 311
 	/** Add the field settings. */
@@ -440,7 +439,7 @@  discard block
 block discarded – undo
440 439
 			'\GravityView_frontend::entry' => \GravityView_frontend::getInstance()->getEntry(),
441 440
 			'\GravityView_View::_current_entry' => \GravityView_View::getInstance()->getCurrentEntry(),
442 441
 			'\GravityView_View::fields' => \GravityView_View::getInstance()->getFields(),
443
-			'wp_actions[loop_start]' => empty( $wp_actions['loop_start'] ) ? 0 : $wp_actions['loop_start'],
442
+			'wp_actions[loop_start]' => empty( $wp_actions[ 'loop_start' ] ) ? 0 : $wp_actions[ 'loop_start' ],
444 443
 			'wp_query::in_the_loop' => $wp_query->in_the_loop,
445 444
 		);
446 445
 	}
@@ -522,7 +521,7 @@  discard block
 block discarded – undo
522 521
 					break;
523 522
 				case 'wp_actions[loop_start]':
524 523
 					global $wp_actions;
525
-					$wp_actions['loop_start'] = $value;
524
+					$wp_actions[ 'loop_start' ] = $value;
526 525
 					break;
527 526
 				case 'wp_query::in_the_loop':
528 527
 					global $wp_query;
@@ -600,9 +599,7 @@  discard block
 block discarded – undo
600 599
 				case 'request':
601 600
 					self::thaw( array(
602 601
 						'\GravityView_View::context' => (
603
-							$value->is_entry() ? 'single' :
604
-								( $value->is_edit_entry() ? 'edit' :
605
-									( $value->is_view() ? 'directory': null )
602
+							$value->is_entry() ? 'single' : ( $value->is_edit_entry() ? 'edit' : ( $value->is_view() ? 'directory' : null )
606 603
 								)
607 604
 						),
608 605
 						'\GravityView_frontend::is_search' => $value->is_search(),
@@ -656,14 +653,14 @@  discard block
 block discarded – undo
656 653
 		global $wp_query, $wp_actions;
657 654
 
658 655
 		$wp_query->in_the_loop = false;
659
-		$wp_actions['loop_start'] = 0;
656
+		$wp_actions[ 'loop_start' ] = 0;
660 657
 	}
661 658
 }
662 659
 
663 660
 
664 661
 /** Add some global fix for field capability discrepancies. */
665 662
 add_filter( 'gravityview/configuration/fields', function( $fields ) {
666
-	if ( empty( $fields  ) ) {
663
+	if ( empty( $fields ) ) {
667 664
 		return $fields;
668 665
 	}
669 666
 
@@ -690,11 +687,11 @@  discard block
 block discarded – undo
690 687
 		}
691 688
 
692 689
 		foreach ( $_fields as $uid => &$_field ) {
693
-			if ( ! isset( $_field['only_loggedin'] ) ) {
690
+			if ( ! isset( $_field[ 'only_loggedin' ] ) ) {
694 691
 				continue;
695 692
 			}
696 693
 			/** If we do not require login, we don't require a cap. */
697
-			$_field['only_loggedin'] != '1' && ( $_field['only_loggedin_cap'] = '' );
694
+			$_field[ 'only_loggedin' ] != '1' && ( $_field[ 'only_loggedin_cap' ] = '' );
698 695
 		}
699 696
 	}
700 697
 	return $fields;
@@ -725,8 +722,8 @@  discard block
 block discarded – undo
725 722
 		}
726 723
 
727 724
 		foreach ( $_fields as $uid => &$_field ) {
728
-			if ( ! empty( $_field['id'] ) && is_numeric( $_field['id'] ) && empty( $_field['form_id'] ) ) {
729
-				$_field['form_id'] = $view->form->ID;
725
+			if ( ! empty( $_field[ 'id' ] ) && is_numeric( $_field[ 'id' ] ) && empty( $_field[ 'form_id' ] ) ) {
726
+				$_field[ 'form_id' ] = $view->form->ID;
730 727
 			}
731 728
 		}
732 729
 	}
@@ -740,25 +737,25 @@  discard block
 block discarded – undo
740 737
 	if ( class_exists( '\GravityView_frontend' ) ) {
741 738
 		global $wp_filter;
742 739
 
743
-		if ( empty( $wp_filter['gravityview_after'] ) ) {
740
+		if ( empty( $wp_filter[ 'gravityview_after' ] ) ) {
744 741
 			return;
745 742
 		}
746 743
 
747 744
 		/** WordPress 4.6 and lower compatibility, when WP_Hook classes were still absent. */
748
-		if ( is_array( $wp_filter['gravityview_after'] ) ) {
749
-			if ( ! empty( $wp_filter['gravityview_after'][10] ) ) {
750
-				foreach ( $wp_filter['gravityview_after'][10] as $function_key => $callback ) {
745
+		if ( is_array( $wp_filter[ 'gravityview_after' ] ) ) {
746
+			if ( ! empty( $wp_filter[ 'gravityview_after' ][ 10 ] ) ) {
747
+				foreach ( $wp_filter[ 'gravityview_after' ][ 10 ] as $function_key => $callback ) {
751 748
 					if ( strpos( $function_key, 'context_not_configured_warning' ) ) {
752
-						unset( $wp_filter['gravityview_after'][10][ $function_key ] );
749
+						unset( $wp_filter[ 'gravityview_after' ][ 10 ][ $function_key ] );
753 750
 					}
754 751
 				}
755 752
 			}
756 753
 			return;
757 754
 		}
758 755
 
759
-		foreach ( $wp_filter['gravityview_after']->callbacks[10] as $function_key => $callback ) {
756
+		foreach ( $wp_filter[ 'gravityview_after' ]->callbacks[ 10 ] as $function_key => $callback ) {
760 757
 			if ( strpos( $function_key, 'context_not_configured_warning' ) ) {
761
-				unset( $wp_filter['gravityview_after']->callbacks[10][ $function_key ] );
758
+				unset( $wp_filter[ 'gravityview_after' ]->callbacks[ 10 ][ $function_key ] );
762 759
 			}
763 760
 		}
764 761
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-entry-gravityforms.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
 	 *
103 103
 	 * @param array $entry The array ID.
104 104
 	 *
105
-	 * @return \GV\Entry|null An instance of this entry or null if not found.
105
+	 * @return null|GF_Entry An instance of this entry or null if not found.
106 106
 	 */
107 107
 	public static function from_entry( $entry ) {
108 108
 		if ( empty( $entry['id'] ) ) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
 	 * @return \GV\Entry|null An instance of this entry or null if not found.
106 106
 	 */
107 107
 	public static function from_entry( $entry ) {
108
-		if ( empty( $entry['id'] ) ) {
108
+		if ( empty( $entry[ 'id' ] ) ) {
109 109
 			return null;
110 110
 		}
111 111
 
112 112
 		$self = new self();
113 113
 		$self->entry = $entry;
114 114
 
115
-		$self->ID = $self->entry['id'];
115
+		$self->ID = $self->entry[ 'id' ];
116 116
 		$self->slug = \GravityView_API::get_entry_slug( $self->ID, $self->as_entry() );
117 117
 
118 118
 		return $self;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * @return bool Whether the offset exists or not.
128 128
 	 */
129 129
 	public function offsetExists( $offset ) {
130
-		return isset( $this->entry[$offset] );
130
+		return isset( $this->entry[ $offset ] );
131 131
 	}
132 132
 
133 133
 	/**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 * @return mixed The value of the requested entry data.
143 143
 	 */
144 144
 	public function offsetGet( $offset ) {
145
-		return $this->entry[$offset];
145
+		return $this->entry[ $offset ];
146 146
 	}
147 147
 
148 148
 	/**
Please login to merge, or discard this patch.
future/includes/class-gv-extension.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 * - Checks PHP version numbers
208 208
 	 * - Sets self::$is_compatible[__CLASS__] to boolean value
209 209
 	 *
210
-	 * @return boolean Is the extension supported?
210
+	 * @return boolean|null Is the extension supported?
211 211
 	 */
212 212
 	protected function is_extension_supported() {
213 213
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	/**
330 330
 	 * Add a notice to be displayed in the admin.
331 331
 	 *
332
-	 * @param array $notice Array with `class` and `message` keys. The message is not escaped.
332
+	 * @param string $notice Array with `class` and `message` keys. The message is not escaped.
333 333
 	 *
334 334
 	 * @return void
335 335
 	 */
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -244,13 +244,13 @@
 block discarded – undo
244 244
 			$this->_remote_update_url,
245 245
 			$this->_path,
246 246
 			array(
247
-            	'version'	=> $this->_version, // current version number
248
-            	'license'	=> $license['license'],
249
-	            'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
250
-            	'item_name' => $this->_title,  // name of this plugin
251
-            	'author' 	=> strip_tags( $this->_author )  // author of this plugin
252
-          	)
253
-        );
247
+				'version'	=> $this->_version, // current version number
248
+				'license'	=> $license['license'],
249
+				'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
250
+				'item_name' => $this->_title,  // name of this plugin
251
+				'author' 	=> strip_tags( $this->_author )  // author of this plugin
252
+		  	)
253
+		);
254 254
 	}
255 255
 
256 256
 	/**
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
 		$tab = wp_parse_args( $tab_settings, $tab_defaults );
181 181
 
182 182
 		// Force the screen to be GravityView
183
-		$tab['screen'] = 'gravityview';
183
+		$tab[ 'screen' ] = 'gravityview';
184 184
 
185 185
 		if ( class_exists( 'GravityView_Metabox_Tab' ) ) {
186
-			$metabox = new \GravityView_Metabox_Tab( $tab['id'], $tab['title'], $tab['file'], $tab['icon-class'], $tab['callback'], $tab['callback_args'] );
186
+			$metabox = new \GravityView_Metabox_Tab( $tab[ 'id' ], $tab[ 'title' ], $tab[ 'file' ], $tab[ 'icon-class' ], $tab[ 'callback' ], $tab[ 'callback_args' ] );
187 187
 			\GravityView_Metabox_Tabs::add( $metabox );
188 188
 		} else {
189
-			add_meta_box( 'gravityview_' . $tab['id'], $tab['title'], $tab['callback'], $tab['screen'], $tab['context'], $tab['priority'] );
189
+			add_meta_box( 'gravityview_' . $tab[ 'id' ], $tab[ 'title' ], $tab[ 'callback' ], $tab[ 'screen' ], $tab[ 'context' ], $tab[ 'priority' ] );
190 190
 		}
191 191
 	}
192 192
 
@@ -211,14 +211,14 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	protected function is_extension_supported() {
213 213
 
214
-		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool) self::$is_compatible );
214
+		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool)self::$is_compatible );
215 215
 
216 216
 		if ( ! function_exists( 'gravityview' ) ) {
217 217
 			$message = sprintf( __( 'Could not activate the %s Extension; GravityView is not active.', 'gravityview' ), esc_html( $this->_title ) );
218
-		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version , ">=" ) ) {
219
-			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_gravityview_version.'</tt>' );
220
-		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version , ">=" ) ) {
221
-			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_php_version.'</tt>' );
218
+		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version, ">=" ) ) {
219
+			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_gravityview_version . '</tt>' );
220
+		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version, ">=" ) ) {
221
+			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_php_version . '</tt>' );
222 222
 		} else if ( ! empty( $this->_max_gravityview_version ) && false === version_compare( $this->_max_gravityview_version, Plugin::$version, ">" ) ) {
223 223
 			$message = sprintf( __( 'The %s Extension is not compatible with this version of GravityView. Please update the Extension to the latest version.', 'gravityview' ), esc_html( $this->_title ) );
224 224
 		} else {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 		$lang_dir = dirname( plugin_basename( $path ) ) . '/languages/';
258 258
 
259 259
 		// Traditional WordPress plugin locale filter
260
-		$locale = apply_filters( 'plugin_locale',  get_locale(), $this->_text_domain );
260
+		$locale = apply_filters( 'plugin_locale', get_locale(), $this->_text_domain );
261 261
 
262 262
 		$mofile = sprintf( '%1$s-%2$s.mo', $this->_text_domain, $locale );
263 263
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 	 */
285 285
 	public function settings() {
286 286
 		// If doing ajax, get outta here
287
-		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) )  {
287
+		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
288 288
 			return;
289 289
 		}
290 290
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 		}
296 296
 
297 297
 		// Don't update if invalid license.
298
-		if ( false === $license || empty( $license['status'] ) || strtolower( $license['status'] ) !== 'valid' ) {
298
+		if ( false === $license || empty( $license[ 'status' ] ) || strtolower( $license[ 'status' ] ) !== 'valid' ) {
299 299
 			return;
300 300
 		}
301 301
 
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
 			$this->_path,
305 305
 			array(
306 306
             	'version'	=> $this->_version, // current version number
307
-            	'license'	=> $license['license'],
307
+            	'license'	=> $license[ 'license' ],
308 308
 	            'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
309
-            	'item_name' => $this->_title,  // name of this plugin
309
+            	'item_name' => $this->_title, // name of this plugin
310 310
             	'author' 	=> strip_tags( $this->_author )  // author of this plugin
311 311
           	)
312 312
         );
@@ -335,16 +335,16 @@  discard block
 block discarded – undo
335 335
 	 */
336 336
 	public static function add_notice( $notice = array() ) {
337 337
 
338
-		if ( is_array( $notice ) && empty( $notice['message'] ) ) {
338
+		if ( is_array( $notice ) && empty( $notice[ 'message' ] ) ) {
339 339
 			gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) );
340 340
 			return;
341 341
 		} else if ( is_string( $notice ) ) {
342 342
 			$notice = array( 'message' => $notice );
343 343
 		}
344 344
 
345
-		$notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class'];
345
+		$notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ];
346 346
 
347
-		self::$admin_notices []= $notice;
347
+		self::$admin_notices [ ] = $notice;
348 348
 	}
349 349
 
350 350
 	/**
@@ -358,8 +358,8 @@  discard block
 block discarded – undo
358 358
 		}
359 359
 
360 360
 		foreach ( self::$admin_notices as $key => $notice ) {
361
-			echo '<div id="message" class="'. esc_attr( $notice['class'] ).'">';
362
-			echo wpautop( $notice['message'] );
361
+			echo '<div id="message" class="' . esc_attr( $notice[ 'class' ] ) . '">';
362
+			echo wpautop( $notice[ 'message' ] );
363 363
 			echo '<div class="clear"></div>';
364 364
 			echo '</div>';
365 365
 		}
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -284,7 +284,7 @@
 block discarded – undo
284 284
 	 */
285 285
 	public function settings() {
286 286
 		// If doing ajax, get outta here
287
-		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) )  {
287
+		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
288 288
 			return;
289 289
 		}
290 290
 
Please login to merge, or discard this patch.
future/includes/class-gv-field-gravityforms.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 	 * @param \GV\GF_Form $form The Gravity Form form.
55 55
 	 * @param int $field_id The Gravity Form field ID for the $form.
56 56
 	 *
57
-	 * @return \GV\Field|null The requested field or null if not found.
57
+	 * @return null|GF_Field The requested field or null if not found.
58 58
 	 */
59 59
 	public static function by_id( $form, $field_id ) {
60 60
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,17 +27,17 @@  discard block
 block discarded – undo
27 27
 	 * @return \GV\GF_Field|null The field implementation or null on error.
28 28
 	 */
29 29
 	public static function from_configuration( $configuration ) {
30
-		if ( empty( $configuration['id'] ) || ! is_numeric( $configuration['id'] ) ) {
30
+		if ( empty( $configuration[ 'id' ] ) || ! is_numeric( $configuration[ 'id' ] ) ) {
31 31
 			gravityview()->log->error( 'Invalid configuration[id] supplied.' );
32 32
 			return null;
33 33
 		}
34 34
 
35
-		if ( empty( $configuration['form_id'] ) || ! $form = \GV\GF_Form::by_id( $configuration['form_id'] )  ) {
35
+		if ( empty( $configuration[ 'form_id' ] ) || ! $form = \GV\GF_Form::by_id( $configuration[ 'form_id' ] ) ) {
36 36
 			gravityview()->log->error( 'Invalid configuration[form_id] supplied.' );
37 37
 			return null;
38 38
 		}
39 39
 
40
-		$field = self::by_id( $form, $configuration['id'] );
40
+		$field = self::by_id( $form, $configuration[ 'id' ] );
41 41
 
42 42
 		if ( ! $field ) {
43 43
 			gravityview()->log->error( 'Invalid configuration[id] supplied.' );
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
 		/** This is a complex Gravity Forms input. */
113 113
 		if ( $input = \GFFormsModel::get_input( $this->field, $this->ID ) ) {
114
-			$label = ! empty( $input['customLabel'] ) ? $input['customLabel'] : $input['label'];
114
+			$label = ! empty( $input[ 'customLabel' ] ) ? $input[ 'customLabel' ] : $input[ 'label' ];
115 115
 		} else {
116 116
 			/** This is a field with one label. */
117 117
 			$label = $this->field->get_field_label( true, $this->label );
Please login to merge, or discard this patch.
future/includes/class-gv-form-gravityforms.php 2 patches
Doc Comments   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -132,10 +132,8 @@
 block discarded – undo
132 132
 	/**
133 133
 	 * Get a \GV\Field by Form and Field ID for this data source.
134 134
 	 *
135
-	 * @param \GV\GF_Form $form The Gravity Form form ID.
136
-	 * @param int $field_id The Gravity Form field ID for the $form_id.
137 135
 	 *
138
-	 * @return \GV\Field|null The requested field or null if not found.
136
+	 * @return null|GF_Field The requested field or null if not found.
139 137
 	 */
140 138
 	public static function get_field( /** varargs */ ) {
141 139
 		$args = func_get_args();
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		$self = new self();
56 56
 		$self->form = $form;
57 57
 
58
-		$self->ID = $self->form['id'];
58
+		$self->ID = $self->form[ 'id' ];
59 59
 
60 60
 		return $self;
61 61
 	}
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
 
99 99
 			/** The offset and limit */
100 100
 			if ( ! empty( $offset->limit ) ) {
101
-				$paging['page_size'] = $offset->limit;
101
+				$paging[ 'page_size' ] = $offset->limit;
102 102
 			}
103 103
 
104 104
 			if ( ! empty( $offset->offset ) ) {
105
-				$paging['offset'] = $offset->offset;
105
+				$paging[ 'offset' ] = $offset->offset;
106 106
 			}
107 107
 
108 108
 			foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) {
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	public function get_fields() {
161 161
 		$fields = array();
162
-		foreach ( $this['fields'] as $field ) {
163
-			foreach ( empty( $field['inputs'] ) ? array( $field['id'] ) : wp_list_pluck( $field['inputs'], 'id' ) as $id ) {
162
+		foreach ( $this[ 'fields' ] as $field ) {
163
+			foreach ( empty( $field[ 'inputs' ] ) ? array( $field[ 'id' ] ) : wp_list_pluck( $field[ 'inputs' ], 'id' ) as $id ) {
164 164
 				if ( is_numeric( $id ) ) {
165 165
 					$fields[ $id ] = self::get_field( $this, $id );
166 166
 				} else {
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 * @return bool Whether the offset exists or not.
198 198
 	 */
199 199
 	public function offsetExists( $offset ) {
200
-		return isset( $this->form[$offset] );
200
+		return isset( $this->form[ $offset ] );
201 201
 	}
202 202
 
203 203
 	/**
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 * @return mixed The value of the requested form data.
213 213
 	 */
214 214
 	public function offsetGet( $offset ) {
215
-		return $this->form[$offset];
215
+		return $this->form[ $offset ];
216 216
 	}
217 217
 
218 218
 	/**
Please login to merge, or discard this patch.
future/includes/class-gv-license-handler.php 4 patches
Doc Comments   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 * Generate the status message box HTML based on the current status
351 351
 	 *
352 352
 	 * @since 1.7.4
353
-	 * @param $message
353
+	 * @param string $message
354 354
 	 * @param string $class
355 355
 	 *
356 356
 	 * @return string
@@ -470,6 +470,9 @@  discard block
 block discarded – undo
470 470
 		$this->settings->update( $settings );
471 471
 	}
472 472
 
473
+	/**
474
+	 * @param boolean $echo
475
+	 */
473 476
 	public function settings_edd_license_activation( $field, $echo ) {
474 477
 		$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
475 478
 
@@ -569,7 +572,6 @@  discard block
 block discarded – undo
569 572
 	 * Check the GravityView license information
570 573
 	 *
571 574
 	 * @since 1.19.3
572
-	 * @param bool $force Whether to force checking license, even if AJAX
573 575
 	 *
574 576
 	 * @return void
575 577
 	 */
Please login to merge, or discard this patch.
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.
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		);
101 101
 
102 102
 		if ( ! empty( $action ) ) {
103
-			$settings['edd_action'] = esc_attr( $action );
103
+			$settings[ 'edd_action' ] = esc_attr( $action );
104 104
 		}
105 105
 
106 106
 		return array_map( 'urlencode', $settings );
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			'format' => 'json',
157 157
 		) );
158 158
 
159
-		if ( $is_ajax && empty( $data['license'] ) ) {
159
+		if ( $is_ajax && empty( $data[ 'license' ] ) ) {
160 160
 			die( -1 );
161 161
 		}
162 162
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 			// most likely a mistake.
198 198
 			} else if ( $license_data->license !== 'failed' && $update_license ) {
199 199
 
200
-				if ( ! empty( $data['field_id'] ) ) {
200
+				if ( ! empty( $data[ 'field_id' ] ) ) {
201 201
 					set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS );
202 202
 				}
203 203
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 		if ( empty( $license_data ) ) {
225 225
 			$message = '';
226 226
 		} else {
227
-			if( ! empty( $license_data->error ) ) {
227
+			if ( ! empty( $license_data->error ) ) {
228 228
 				$class = 'error';
229 229
 				$string_key = $license_data->error;
230 230
 			} else { $class = $license_data->license;
@@ -250,17 +250,17 @@  discard block
 block discarded – undo
250 250
 	 */
251 251
 	public function license_details( $response = array() ) {
252 252
 
253
-		$response = (array) $response;
253
+		$response = (array)$response;
254 254
 
255 255
 		$return = '';
256 256
 		$wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>';
257 257
 
258
-		if ( ! empty( $response['license_key'] ) ) {
258
+		if ( ! empty( $response[ 'license_key' ] ) ) {
259 259
 			$return .= '<h3>' . esc_html__( 'License Details:', 'gravityview' ) . '</h3>';
260 260
 
261 261
 			if ( in_array( Utils::get( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) {
262
-				$return .= $this->strings( $response['license'], $response );
263
-			} elseif ( ! empty( $response['license_name'] ) ) {
262
+				$return .= $this->strings( $response[ 'license' ], $response );
263
+			} elseif ( ! empty( $response[ 'license_name' ] ) ) {
264 264
 				$response_keys = array(
265 265
 					'license_name'   => '',
266 266
 					'license_limit'  => '',
@@ -274,19 +274,19 @@  discard block
 block discarded – undo
274 274
 				// Make sure all the keys are set
275 275
 				$response = wp_parse_args( $response, $response_keys );
276 276
 
277
-				$login_link = sprintf( '<a href="%s" class="howto" 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' ) );
278
-				$local_text = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
277
+				$login_link = sprintf( '<a href="%s" class="howto" 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' ) );
278
+				$local_text = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
279 279
 				$details    = array(
280
-					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response['license_name'] ), esc_html( $response['license_limit'] ) ),
281
-					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . $login_link,
282
-					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response['site_count'] ), esc_html( $response['license_limit'] ) ) . $local_text,
283
-					'expires'     => 'lifetime' === $response['expires'] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ),
284
-					'upgrade'     => $this->get_upgrade_html( $response['upgrades'] ),
280
+					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response[ 'license_name' ] ), esc_html( $response[ 'license_limit' ] ) ),
281
+					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . $login_link,
282
+					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response[ 'site_count' ] ), esc_html( $response[ 'license_limit' ] ) ) . $local_text,
283
+					'expires'     => 'lifetime' === $response[ 'expires' ] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ),
284
+					'upgrade'     => $this->get_upgrade_html( $response[ 'upgrades' ] ),
285 285
 				);
286 286
 
287
-				if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) {
288
-					unset( $details['upgrade'] );
289
-					$details['expires'] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
287
+				if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) {
288
+					unset( $details[ 'upgrade' ] );
289
+					$details[ 'expires' ] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
290 290
 				}
291 291
 
292 292
 				$return .= '<ul><li>' . implode( '</li><li>', array_filter( $details ) ) . '</li></ul>';
@@ -312,20 +312,20 @@  discard block
 block discarded – undo
312 312
 		if ( ! empty( $upgrades ) ) {
313 313
 
314 314
 			$locale_parts = explode( '_', get_locale() );
315
-			$is_english = ( 'en' === $locale_parts[0] );
315
+			$is_english = ( 'en' === $locale_parts[ 0 ] );
316 316
 
317 317
 			$output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>';
318 318
 			$output .= '<ul class="ul-disc">';
319 319
 
320 320
 			foreach ( $upgrades as $upgrade_id => $upgrade ) {
321
-				$upgrade = (object) $upgrade;
321
+				$upgrade = (object)$upgrade;
322 322
 
323 323
 				$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 ) );
324 324
 
325 325
 				if ( $is_english && isset( $upgrade->description ) ) {
326 326
 					$message = esc_html( $upgrade->description );
327 327
 				} else {
328
-					switch( $upgrade->price_id ) {
328
+					switch ( $upgrade->price_id ) {
329 329
 						// Interstellar
330 330
 						case 1:
331 331
 						default:
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 			'invalid' => esc_html__( 'The license key entered is invalid.', 'gravityview' ),
384 384
 			'missing' => esc_html__( 'Invalid license key.', 'gravityview' ),
385 385
 			'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ),
386
-			'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>' ),
386
+			'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>' ),
387 387
 			'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ),
388 388
 
389 389
 			'verifying_license' => esc_html__( 'Verifying license&hellip;', 'gravityview' ),
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
 		if ( ! empty( $license_data->renewal_url ) ) {
408 408
 			$renew_license_url = $license_data->renewal_url;
409
-		} elseif( ! empty( $license_data->license_key ) ) {
409
+		} elseif ( ! empty( $license_data->license_key ) ) {
410 410
 			$renew_license_url = sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s', $license_data->license_key );
411 411
 		} else {
412 412
 			$renew_license_url = 'https://gravityview.co/account/';
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 	 * @return array|WP_Error
424 424
 	 */
425 425
 	private function _license_get_remote_response( $data, $license = '' ) {
426
-		$api_params = $this->_get_edd_settings( $data['edd_action'], $license );
426
+		$api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license );
427 427
 
428 428
 		$url = add_query_arg( $api_params, self::url );
429 429
 
@@ -463,9 +463,9 @@  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'] );
467
-		$settings['license_key_status'] = $license_data->license;
468
-		$settings['license_key_response'] = (array)$license_data;
466
+        $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] );
467
+		$settings[ 'license_key_status' ] = $license_data->license;
468
+		$settings[ 'license_key_response' ] = (array)$license_data;
469 469
 
470 470
 		$this->settings->update( $settings );
471 471
 	}
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 
481 481
 		if ( ! empty( $key ) ) {
482 482
 			$response = $this->settings->get( 'license_key_response' );
483
-			$response = is_array( $response ) ? (object) $response : json_decode( $response );
483
+			$response = is_array( $response ) ? (object)$response : json_decode( $response );
484 484
 		} else {
485 485
 			$response = array();
486 486
 		}
@@ -522,11 +522,11 @@  discard block
 block discarded – undo
522 522
 
523 523
 		$submit = '<div class="gv-edd-button-wrapper">';
524 524
 		foreach ( $fields as $field ) {
525
-			$field['type'] = 'button';
526
-			$field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class;
527
-			$field['style'] = 'margin-left: 10px;';
528
-			if( $disabled_attribute ) {
529
-				$field['disabled'] = $disabled_attribute;
525
+			$field[ 'type' ] = 'button';
526
+			$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class;
527
+			$field[ 'style' ] = 'margin-left: 10px;';
528
+			if ( $disabled_attribute ) {
529
+				$field[ 'disabled' ] = $disabled_attribute;
530 530
 			}
531 531
 			$submit .= $this->settings->as_html( $field, $echo );
532 532
 		}
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 				    'url'        => home_url(),
606 606
 				    'site_data'  => $this->get_site_data(),
607 607
 			    ),
608
-			));
608
+			) );
609 609
 
610 610
 			// make sure the response came back okay
611 611
 			if ( is_wp_error( $response ) ) {
@@ -636,45 +636,45 @@  discard block
 block discarded – undo
636 636
 		$theme_data = wp_get_theme();
637 637
 		$theme      = $theme_data->Name . ' ' . $theme_data->Version;
638 638
 
639
-		$data['gv_version']  = Plugin::$version;
640
-		$data['php_version']  = phpversion();
641
-		$data['wp_version']   = get_bloginfo( 'version' );
642
-		$data['gf_version']  = \GFForms::$version;
643
-		$data['server']       = Utils::get( $_SERVER, 'SERVER_SOFTWARE' );
644
-		$data['multisite']    = is_multisite();
645
-		$data['theme']        = $theme;
646
-		$data['url']          = home_url();
647
-		$data['license_key']  = $this->settings->get( 'license_key' );
648
-		$data['beta']         = $this->settings->get( 'beta' );
639
+		$data[ 'gv_version' ]  = Plugin::$version;
640
+		$data[ 'php_version' ]  = phpversion();
641
+		$data[ 'wp_version' ]   = get_bloginfo( 'version' );
642
+		$data[ 'gf_version' ]  = \GFForms::$version;
643
+		$data[ 'server' ]       = Utils::get( $_SERVER, 'SERVER_SOFTWARE' );
644
+		$data[ 'multisite' ]    = is_multisite();
645
+		$data[ 'theme' ]        = $theme;
646
+		$data[ 'url' ]          = home_url();
647
+		$data[ 'license_key' ]  = $this->settings->get( 'license_key' );
648
+		$data[ 'beta' ]         = $this->settings->get( 'beta' );
649 649
 
650 650
 		// View Data
651 651
 		$gravityview_posts = wp_count_posts( 'gravityview', 'readable' );
652 652
 
653
-		$data['view_count'] = null;
654
-		$data['view_first'] = null;
655
-		$data['view_latest'] = null;
653
+		$data[ 'view_count' ] = null;
654
+		$data[ 'view_first' ] = null;
655
+		$data[ 'view_latest' ] = null;
656 656
 
657 657
 		if ( $gravityview_posts->publish ) {
658
-			$data['view_count'] = $gravityview_posts->publish;
658
+			$data[ 'view_count' ] = $gravityview_posts->publish;
659 659
 
660 660
 			$first = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=ASC' );
661 661
 			$latest = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=DESC' );
662 662
 
663 663
 			if ( $first = array_shift( $first ) ) {
664
-				$data['view_first'] = $first->post_date;
664
+				$data[ 'view_first' ] = $first->post_date;
665 665
 			}
666 666
 			if ( $latest = array_pop( $latest ) ) {
667
-				$data['view_latest'] = $latest->post_date;
667
+				$data[ 'view_latest' ] = $latest->post_date;
668 668
 			}
669 669
 		}
670 670
 
671 671
 		// Form counts
672 672
 		if ( class_exists( 'GFFormsModel' ) ) {
673 673
 			$form_data = \GFFormsModel::get_form_count();
674
-			$data['forms_total'] = Utils::get( $form_data, 'total', 0 );
675
-			$data['forms_active'] = Utils::get( $form_data, 'active', 0 );
676
-			$data['forms_inactive'] = Utils::get( $form_data, 'inactive', 0 );
677
-			$data['forms_trash'] = Utils::get( $form_data, 'inactive', 0 );
674
+			$data[ 'forms_total' ] = Utils::get( $form_data, 'total', 0 );
675
+			$data[ 'forms_active' ] = Utils::get( $form_data, 'active', 0 );
676
+			$data[ 'forms_inactive' ] = Utils::get( $form_data, 'inactive', 0 );
677
+			$data[ 'forms_trash' ] = Utils::get( $form_data, 'inactive', 0 );
678 678
 		}
679 679
 
680 680
 		// Retrieve current plugin information
@@ -682,13 +682,13 @@  discard block
 block discarded – undo
682 682
 			include ABSPATH . '/wp-admin/includes/plugin.php';
683 683
 		}
684 684
 
685
-		$data['integrations']     = self::get_related_plugins_and_extensions();
686
-		$data['active_plugins']   = get_option( 'active_plugins', array() );
687
-		$data['inactive_plugins'] = array();
688
-		$data['locale']           = get_locale();
685
+		$data[ 'integrations' ]     = self::get_related_plugins_and_extensions();
686
+		$data[ 'active_plugins' ]   = get_option( 'active_plugins', array() );
687
+		$data[ 'inactive_plugins' ] = array();
688
+		$data[ 'locale' ]           = get_locale();
689 689
 
690 690
 		// Validate request on the GV server
691
-		$data['hash']             = 'gv_version.url.locale:' . sha1( $data['gv_version'] . $data['url'] . $data['locale'] );
691
+		$data[ 'hash' ]             = 'gv_version.url.locale:' . sha1( $data[ 'gv_version' ] . $data[ 'url' ] . $data[ 'locale' ] );
692 692
 
693 693
 		return $data;
694 694
 	}
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 
719 719
 				$plugin_data = get_plugin_data( $active_plugin );
720 720
 
721
-				$extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] );
721
+				$extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] );
722 722
 			}
723 723
 
724 724
 			if ( ! empty( $extensions ) ) {
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.