Completed
Pull Request — develop (#1403)
by Zack
06:07
created
includes/class-gravityview-powered-by.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 
70 70
 		$url = add_query_arg( array(
71 71
 			'utm_source' => 'powered_by',
72
-            'utm_term' => get_bloginfo('name' ),
72
+			'utm_term' => get_bloginfo('name' ),
73 73
 		), $url );
74 74
 
75 75
 		/**
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 		$powered_by = gravityview()->plugin->settings->get( 'powered_by', '0' );
34 34
 
35
-		if( empty( $powered_by ) ) {
35
+		if ( empty( $powered_by ) ) {
36 36
 			return;
37 37
 		}
38 38
 
@@ -59,17 +59,17 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	protected function get_url() {
61 61
 
62
-		$url = sprintf( self::url, get_bloginfo('name' ) );
62
+		$url = sprintf( self::url, get_bloginfo( 'name' ) );
63 63
 
64 64
 		$affiliate_id = gravityview()->plugin->settings->get( 'affiliate_id', '' );
65 65
 
66
-		if( $affiliate_id && is_numeric( $affiliate_id ) ) {
66
+		if ( $affiliate_id && is_numeric( $affiliate_id ) ) {
67 67
 			$url = add_query_arg( array( 'ref' => $affiliate_id ), $url );
68 68
 		}
69 69
 
70 70
 		$url = add_query_arg( array(
71 71
 			'utm_source' => 'powered_by',
72
-            'utm_term' => get_bloginfo('name' ),
72
+            'utm_term' => get_bloginfo( 'name' ),
73 73
 		), $url );
74 74
 
75 75
 		/**
Please login to merge, or discard this patch.
future/includes/class-gv-settings-addon.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * @return array
103 103
 	 */
104 104
 	public function modify_app_settings_menu_title( $setting_tabs ) {
105
-		$setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' );
105
+		$setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' );
106 106
 		return $setting_tabs;
107 107
 	}
108 108
 
@@ -308,15 +308,15 @@  discard block
 block discarded – undo
308 308
             </ul>
309 309
             <div class="gv-followup widefat">
310 310
                 <p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p>
311
-                <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview') ?>" placeholder="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview'); ?>" class="large-text"></textarea>
311
+                <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ) ?>" placeholder="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ); ?>" class="large-text"></textarea>
312 312
             </div>
313 313
             <div class="scale-description">
314 314
                 <p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p>
315 315
                 <ul class="inline">
316 316
 					<?php
317 317
 					$i = 0;
318
-					while( $i < 11 ) {
319
-						echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>';
318
+					while ( $i < 11 ) {
319
+						echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>';
320 320
 						$i++;
321 321
 					}
322 322
 					?>
@@ -539,15 +539,15 @@  discard block
 block discarded – undo
539 539
 	 * @return string The HTML
540 540
 	 */
541 541
 	public function as_html( $field, $echo = true ) {
542
-		$field['type']  = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit','reset','button' ) ) ) ? $field['type'] : 'submit';
542
+		$field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit';
543 543
 
544 544
 		$attributes    = $this->get_field_attributes( $field );
545 545
 		$default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) );
546
-		$value         = $this->get( $field['name'], $default_value );
546
+		$value         = $this->get( $field[ 'name' ], $default_value );
547 547
 
548 548
 
549
-		$attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton';
550
-		$name    = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name'];
549
+		$attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton';
550
+		$name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ];
551 551
 
552 552
 		if ( empty( $value ) ) {
553 553
 			$value = __( 'Update Settings', 'gravityview' );
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 		$attributes = $this->get_field_attributes( $field );
557 557
 
558 558
 		$html = '<input
559
-                    type="' . $field['type'] . '"
559
+                    type="' . $field[ 'type' ] . '"
560 560
                     name="' . esc_attr( $name ) . '"
561 561
                     value="' . $value . '" ' .
562 562
 		        implode( ' ', $attributes ) .
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 	 * @return bool
588 588
 	 */
589 589
 	public function is_save_postback() {
590
-		return isset( $_POST['gform-settings-save'] ) && isset( $_POST['_gravityview_save_settings_nonce'] );
590
+		return isset( $_POST[ 'gform-settings-save' ] ) && isset( $_POST[ '_gravityview_save_settings_nonce' ] );
591 591
 	}
592 592
 
593 593
 	/**
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 	 */
598 598
 	public function license_key_notice() {
599 599
 
600
-	    if( $this->is_save_postback() ) {
600
+	    if ( $this->is_save_postback() ) {
601 601
 		    $settings = $this->get_posted_settings();
602 602
 		    $license_key = \GV\Utils::get( $settings, 'license_key' );
603 603
 		    $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' );
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 		 * but didn't want to mess up the translation strings for the translators.
619 619
 		 */
620 620
 		$message = mb_substr( $message, 0, mb_strlen( $message ) - 1 );
621
-		$title = __( 'Inactive License', 'gravityview');
621
+		$title = __( 'Inactive License', 'gravityview' );
622 622
 		$status = '';
623 623
 		$update_below = false;
624 624
 		$primary_button_link = admin_url( 'edit.php?post_type=gravityview&amp;page=gravityview_settings' );
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 				$update_below = __( 'Activate your license key below.', 'gravityview' );
649 649
 				break;
650 650
 		}
651
-		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice';
651
+		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice';
652 652
 
653 653
 		// Show a different notice on settings page for inactive licenses (hide the buttons)
654 654
 		if ( $update_below && gravityview()->request->is_admin( '', 'settings' ) ) {
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 	public function scripts() {
693 693
 		$scripts = parent::scripts();
694 694
 
695
-		$scripts[] = array(
695
+		$scripts[ ] = array(
696 696
 			'handle'  => 'gform_tooltip_init',
697 697
 			'enqueue' => array(
698 698
                 array(
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 	public function styles() {
712 712
 		$styles = parent::styles();
713 713
 
714
-		$styles[] = array(
714
+		$styles[ ] = array(
715 715
 			'handle'  => 'gravityview_settings',
716 716
 			'src'     => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ),
717 717
 			'version' => Plugin::$version,
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 		 * If multisite and not network admin, we don't want the settings to show.
743 743
 		 * @since 1.7.6
744 744
 		 */
745
-		$show_submenu = ( ! is_multisite() ) ||  is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() );
745
+		$show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() );
746 746
 
747 747
 		/**
748 748
 		 * Override whether to show the Settings menu on a per-blog basis.
@@ -790,26 +790,26 @@  discard block
 block discarded – undo
790 790
 				'label' => __( 'License Key', 'gravityview' ),
791 791
 				'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates &amp; support.', 'gravityview' ) . $this->get_license_handler()->license_details( $this->get_app_setting( 'license_key_response' ) ),
792 792
 				'type' => 'edd_license',
793
-				'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' )  && GRAVITYVIEW_LICENSE_KEY ),
793
+				'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ),
794 794
 				'data-pending-text' => __( 'Verifying license&hellip;', 'gravityview' ),
795
-				'default_value' => $default_settings['license_key'],
795
+				'default_value' => $default_settings[ 'license_key' ],
796 796
 				'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key',
797 797
 			),
798 798
 			array(
799 799
 				'name' => 'license_key_response',
800
-				'default_value' => $default_settings['license_key_response'],
800
+				'default_value' => $default_settings[ 'license_key_response' ],
801 801
 				'type' => 'hidden',
802 802
 			),
803 803
 			array(
804 804
 				'name' => 'license_key_status',
805
-				'default_value' => $default_settings['license_key_status'],
805
+				'default_value' => $default_settings[ 'license_key_status' ],
806 806
 				'type' => 'hidden',
807 807
 			),
808 808
 			array(
809 809
 				'name' => 'support-email',
810 810
 				'type' => 'text',
811 811
 				'validate' => 'email',
812
-				'default_value' => $default_settings['support-email'],
812
+				'default_value' => $default_settings[ 'support-email' ],
813 813
 				'label' => __( 'Support Email', 'gravityview' ),
814 814
 				'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ),
815 815
 				'class' => 'code regular-text',
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 				'name' => 'support_port',
822 822
 				'type' => 'radio',
823 823
 				'label' => __( 'Show Support Port?', 'gravityview' ),
824
-				'default_value' => $default_settings['support_port'],
824
+				'default_value' => $default_settings[ 'support_port' ],
825 825
 				'horizontal' => 1,
826 826
 				'choices' => array(
827 827
 					array(
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 				'name' => 'no-conflict-mode',
841 841
 				'type' => 'radio',
842 842
 				'label' => __( 'No-Conflict Mode', 'gravityview' ),
843
-				'default_value' => $default_settings['no-conflict-mode'],
843
+				'default_value' => $default_settings[ 'no-conflict-mode' ],
844 844
 				'horizontal' => 1,
845 845
 				'choices' => array(
846 846
 					array(
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
 					'name' => 'rest_api',
863 863
 					'type' => 'radio',
864 864
 					'label' => __( 'REST API', 'gravityview' ),
865
-					'default_value' => $default_settings['rest_api'],
865
+					'default_value' => $default_settings[ 'rest_api' ],
866 866
 					'horizontal' => 1,
867 867
 					'choices' => array(
868 868
 						array(
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 				'name' => 'beta',
882 882
 				'type' => 'checkbox',
883 883
 				'label' => __( 'Become a Beta Tester', 'gravityview' ),
884
-				'default_value' => $default_settings['beta'],
884
+				'default_value' => $default_settings[ 'beta' ],
885 885
 				'horizontal' => 1,
886 886
 				'choices' => array(
887 887
 					array(
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 				'name' => 'powered_by',
897 897
 				'type' => 'checkbox',
898 898
 				'label' => __( 'Display "Powered By" Link', 'gravityview' ),
899
-				'default_value' => $default_settings['powered_by'],
899
+				'default_value' => $default_settings[ 'powered_by' ],
900 900
 				'horizontal' => 1,
901 901
 				'choices' => array(
902 902
 					array(
@@ -939,17 +939,17 @@  discard block
 block discarded – undo
939 939
 		 * @since 1.7.4
940 940
 		 */
941 941
 		foreach ( $fields as &$field ) {
942
-			$field['name']          = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' );
943
-			$field['label']         = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' );
944
-			$field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' );
945
-			$field['description']   = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' );
942
+			$field[ 'name' ]          = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' );
943
+			$field[ 'label' ]         = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' );
944
+			$field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' );
945
+			$field[ 'description' ]   = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' );
946 946
 
947 947
 			if ( $disabled_attribute ) {
948
-				$field['disabled']  = $disabled_attribute;
948
+				$field[ 'disabled' ] = $disabled_attribute;
949 949
 			}
950 950
 
951
-			if ( empty( $field['disabled'] ) ) {
952
-				unset( $field['disabled'] );
951
+			if ( empty( $field[ 'disabled' ] ) ) {
952
+				unset( $field[ 'disabled' ] );
953 953
             }
954 954
 		}
955 955
 
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
         );
968 968
 
969 969
 		if ( $disabled_attribute ) {
970
-			$button['disabled'] = $disabled_attribute;
970
+			$button[ 'disabled' ] = $disabled_attribute;
971 971
 		}
972 972
 
973 973
         /**
@@ -986,20 +986,20 @@  discard block
 block discarded – undo
986 986
 		// If there are extensions, add a section for them
987 987
 		if ( ! empty( $extension_sections ) ) {
988 988
 
989
-			if( $disabled_attribute ) {
989
+			if ( $disabled_attribute ) {
990 990
 				foreach ( $extension_sections as &$section ) {
991
-					foreach ( $section['fields'] as &$field ) {
992
-						$field['disabled'] = $disabled_attribute;
991
+					foreach ( $section[ 'fields' ] as &$field ) {
992
+						$field[ 'disabled' ] = $disabled_attribute;
993 993
 					}
994 994
 				}
995 995
 			}
996 996
 
997
-            $k = count( $extension_sections ) - 1 ;
998
-            $extension_sections[ $k ]['fields'][] = $button;
997
+            $k = count( $extension_sections ) - 1;
998
+            $extension_sections[ $k ][ 'fields' ][ ] = $button;
999 999
 			$sections = array_merge( $sections, $extension_sections );
1000 1000
 		} else {
1001 1001
             // add the 'update settings' button to the general section
1002
-            $sections[0]['fields'][] = $button;
1002
+            $sections[ 0 ][ 'fields' ][ ] = $button;
1003 1003
         }
1004 1004
 
1005 1005
 		return $sections;
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 	protected function settings_edd_license( $field, $echo = true ) {
1056 1056
 
1057 1057
 	    if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) {
1058
-		    $field['input_type'] = 'password';
1058
+		    $field[ 'input_type' ] = 'password';
1059 1059
         }
1060 1060
 
1061 1061
 		$text = $this->settings_text( $field, false );
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
 	public function single_setting_row_html( $field ) {
1105 1105
 		?>
1106 1106
 
1107
-        <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>">
1107
+        <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>">
1108 1108
             <td colspan="2">
1109 1109
 				<?php $this->single_setting( $field ); ?>
1110 1110
             </td>
@@ -1122,10 +1122,10 @@  discard block
 block discarded – undo
1122 1122
 	 * @return string
1123 1123
 	 */
1124 1124
 	public function settings_save( $field, $echo = true ) {
1125
-		$field['type']  = 'submit';
1126
-		$field['name']  = 'gform-settings-save';
1127
-		$field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton';
1128
-		$field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) );
1125
+		$field[ 'type' ]  = 'submit';
1126
+		$field[ 'name' ]  = 'gform-settings-save';
1127
+		$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton';
1128
+		$field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) );
1129 1129
 
1130 1130
 		$output = $this->settings_submit( $field, false );
1131 1131
 
@@ -1156,8 +1156,8 @@  discard block
 block discarded – undo
1156 1156
      * @return void
1157 1157
 	 */
1158 1158
 	public function single_setting_row( $field ) {
1159
-		$field['gv_description'] = Utils::get( $field, 'description' );
1160
-		$field['description']    = Utils::get( $field, 'subtitle' );
1159
+		$field[ 'gv_description' ] = Utils::get( $field, 'description' );
1160
+		$field[ 'description' ]    = Utils::get( $field, 'subtitle' );
1161 1161
 		parent::single_setting_row( $field );
1162 1162
 	}
1163 1163
 
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
 	public function single_setting_label( $field ) {
1170 1170
 		parent::single_setting_label( $field );
1171 1171
 		if ( $description = Utils::get( $field, 'gv_description' ) ) {
1172
-			echo '<span class="description">'. $description .'</span>';
1172
+			echo '<span class="description">' . $description . '</span>';
1173 1173
 		}
1174 1174
 	}
1175 1175
 
@@ -1206,9 +1206,9 @@  discard block
 block discarded – undo
1206 1206
 		// If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response),
1207 1207
 		// then we assume it's changed. If it's changed, unset the status and the previous response.
1208 1208
 		if ( $local_key !== $response_key ) {
1209
-			unset( $posted_settings['license_key_response'] );
1210
-			unset( $posted_settings['license_key_status'] );
1211
-			\GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
1209
+			unset( $posted_settings[ 'license_key_response' ] );
1210
+			unset( $posted_settings[ 'license_key_status' ] );
1211
+			\GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
1212 1212
 		}
1213 1213
 		return $posted_settings;
1214 1214
 	}
Please login to merge, or discard this patch.