@@ -69,7 +69,7 @@ |
||
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 | /** |
@@ -32,7 +32,7 @@ discard block |
||
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 |
||
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 | /** |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $setting_tabs = parent::get_app_settings_tabs(); |
119 | 119 | |
120 | 120 | foreach ( $setting_tabs as &$tab ) { |
121 | - if ( 'uninstall' !== $tab['name'] ) { |
|
121 | + if ( 'uninstall' !== $tab[ 'name' ] ) { |
|
122 | 122 | continue; |
123 | 123 | } |
124 | 124 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | // Add trash can icon to resemble the look and feel of the GF Settings page |
132 | - $tab['icon'] = 'dashicons-trash'; |
|
132 | + $tab[ 'icon' ] = 'dashicons-trash'; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | return array_filter( $setting_tabs ); |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function register_no_conflict( $items ) { |
146 | 146 | |
147 | - $items[] = 'gform_settings'; |
|
148 | - $items[] = 'gv-admin-edd-license'; |
|
147 | + $items[ ] = 'gform_settings'; |
|
148 | + $items[ ] = 'gv-admin-edd-license'; |
|
149 | 149 | |
150 | 150 | return $items; |
151 | 151 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | $href = add_query_arg( array( 'post_type' => 'gravityview', 'page' => 'gravityview_settings', 'view' => 'uninstall' ), admin_url( 'edit.php' ) ); |
198 | 198 | |
199 | - $uninstall_button = '<a href="' . esc_url( $href ) . '" class="' . gravityview_sanitize_html_class( $html_class ). '">' . esc_html__( 'Uninstall GravityView', 'gravityview' ) . '</a>'; |
|
199 | + $uninstall_button = '<a href="' . esc_url( $href ) . '" class="' . gravityview_sanitize_html_class( $html_class ) . '">' . esc_html__( 'Uninstall GravityView', 'gravityview' ) . '</a>'; |
|
200 | 200 | |
201 | 201 | $html .= $uninstall_button; |
202 | 202 | |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function settings_save( $field, $echo = true ) { |
217 | 217 | |
218 | - $field['type'] = 'submit'; |
|
219 | - $field['name'] = 'gform-settings-save'; |
|
220 | - $field['class'] = 'button button-primary primary button-hero'; |
|
221 | - $field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
218 | + $field[ 'type' ] = 'submit'; |
|
219 | + $field[ 'name' ] = 'gform-settings-save'; |
|
220 | + $field[ 'class' ] = 'button button-primary primary button-hero'; |
|
221 | + $field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
222 | 222 | |
223 | 223 | $html = $this->as_html( $field, false ); |
224 | 224 | |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function modify_app_settings_menu_title( $setting_tabs ) { |
242 | 242 | |
243 | - $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' ); |
|
244 | - $setting_tabs[0]['icon'] = 'dashicons-admin-settings'; |
|
243 | + $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
244 | + $setting_tabs[ 0 ][ 'icon' ] = 'dashicons-admin-settings'; |
|
245 | 245 | |
246 | 246 | return $setting_tabs; |
247 | 247 | } |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $i = 0; |
490 | 490 | while ( $i < 11 ) { |
491 | 491 | echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>'; |
492 | - $i ++; |
|
492 | + $i++; |
|
493 | 493 | } |
494 | 494 | ?> |
495 | 495 | </ul> |
@@ -693,14 +693,14 @@ discard block |
||
693 | 693 | */ |
694 | 694 | public function as_html( $field, $echo = true ) { |
695 | 695 | |
696 | - $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit', 'reset', 'button' ) ) ) ? $field['type'] : 'submit'; |
|
696 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
697 | 697 | |
698 | 698 | $attributes = $this->get_field_attributes( $field ); |
699 | 699 | $default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
700 | - $value = $this->get( $field['name'], $default_value ); |
|
700 | + $value = $this->get( $field[ 'name' ], $default_value ); |
|
701 | 701 | |
702 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary primary gfbutton'; |
|
703 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
702 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary primary gfbutton'; |
|
703 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
704 | 704 | |
705 | 705 | if ( empty( $value ) ) { |
706 | 706 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | $attributes = $this->get_field_attributes( $field ); |
710 | 710 | |
711 | 711 | $html = '<input |
712 | - type="' . $field['type'] . '" |
|
712 | + type="' . $field[ 'type' ] . '" |
|
713 | 713 | name="' . esc_attr( $name ) . '" |
714 | 714 | value="' . $value . '" ' . |
715 | 715 | implode( ' ', $attributes ) . |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | */ |
744 | 744 | public function is_save_postback() { |
745 | 745 | |
746 | - return isset( $_POST['gform-settings-save'] ) && isset( $_POST['_gravityview_save_settings_nonce'] ); |
|
746 | + return isset( $_POST[ 'gform-settings-save' ] ) && isset( $_POST[ '_gravityview_save_settings_nonce' ] ); |
|
747 | 747 | } |
748 | 748 | |
749 | 749 | /** |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | |
856 | 856 | $scripts = parent::scripts(); |
857 | 857 | |
858 | - $scripts[] = array( |
|
858 | + $scripts[ ] = array( |
|
859 | 859 | 'handle' => 'gform_tooltip_init', |
860 | 860 | 'enqueue' => array( |
861 | 861 | array( |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | |
877 | 877 | $styles = parent::styles(); |
878 | 878 | |
879 | - $styles[] = array( |
|
879 | + $styles[ ] = array( |
|
880 | 880 | 'handle' => 'gravityview_settings', |
881 | 881 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
882 | 882 | 'version' => Plugin::$version, |
@@ -967,7 +967,7 @@ discard block |
||
967 | 967 | 'name' => 'support-email', |
968 | 968 | 'type' => 'text', |
969 | 969 | 'validate' => 'email', |
970 | - 'default_value' => $default_settings['support-email'], |
|
970 | + 'default_value' => $default_settings[ 'support-email' ], |
|
971 | 971 | 'label' => __( 'Support Email', 'gravityview' ), |
972 | 972 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
973 | 973 | 'class' => 'code regular-text', |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | 'name' => 'support_port', |
980 | 980 | 'type' => 'radio', |
981 | 981 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
982 | - 'default_value' => $default_settings['support_port'], |
|
982 | + 'default_value' => $default_settings[ 'support_port' ], |
|
983 | 983 | 'horizontal' => 1, |
984 | 984 | 'choices' => array( |
985 | 985 | array( |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | 'name' => 'no-conflict-mode', |
999 | 999 | 'type' => 'radio', |
1000 | 1000 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
1001 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
1001 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
1002 | 1002 | 'horizontal' => 1, |
1003 | 1003 | 'choices' => array( |
1004 | 1004 | array( |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | 'name' => 'rest_api', |
1021 | 1021 | 'type' => 'radio', |
1022 | 1022 | 'label' => __( 'REST API', 'gravityview' ), |
1023 | - 'default_value' => $default_settings['rest_api'], |
|
1023 | + 'default_value' => $default_settings[ 'rest_api' ], |
|
1024 | 1024 | 'horizontal' => 1, |
1025 | 1025 | 'choices' => array( |
1026 | 1026 | array( |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | 'name' => 'powered_by', |
1040 | 1040 | 'type' => 'checkbox', |
1041 | 1041 | 'label' => __( 'Display "Powered By" Link', 'gravityview' ), |
1042 | - 'default_value' => $default_settings['powered_by'], |
|
1042 | + 'default_value' => $default_settings[ 'powered_by' ], |
|
1043 | 1043 | 'choices' => array( |
1044 | 1044 | array( |
1045 | 1045 | 'label' => esc_html__( 'Display a "Powered by GravityView" link', 'gravityview' ), |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | 'name' => 'beta', |
1065 | 1065 | 'type' => 'checkbox', |
1066 | 1066 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
1067 | - 'default_value' => $default_settings['beta'], |
|
1067 | + 'default_value' => $default_settings[ 'beta' ], |
|
1068 | 1068 | 'horizontal' => 1, |
1069 | 1069 | 'choices' => array( |
1070 | 1070 | array( |
@@ -1098,17 +1098,17 @@ discard block |
||
1098 | 1098 | * @since 1.7.4 |
1099 | 1099 | */ |
1100 | 1100 | foreach ( $fields as &$field ) { |
1101 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
1102 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
1103 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
1104 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
1101 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
1102 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
1103 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
1104 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
1105 | 1105 | |
1106 | 1106 | if ( $disabled_attribute ) { |
1107 | - $field['disabled'] = $disabled_attribute; |
|
1107 | + $field[ 'disabled' ] = $disabled_attribute; |
|
1108 | 1108 | } |
1109 | 1109 | |
1110 | - if ( empty( $field['disabled'] ) ) { |
|
1111 | - unset( $field['disabled'] ); |
|
1110 | + if ( empty( $field[ 'disabled' ] ) ) { |
|
1111 | + unset( $field[ 'disabled' ] ); |
|
1112 | 1112 | } |
1113 | 1113 | } |
1114 | 1114 | |
@@ -1120,23 +1120,23 @@ discard block |
||
1120 | 1120 | 'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ), |
1121 | 1121 | 'type' => 'edd_license', |
1122 | 1122 | 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
1123 | - 'default_value' => $default_settings['license_key'], |
|
1123 | + 'default_value' => $default_settings[ 'license_key' ], |
|
1124 | 1124 | 'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
1125 | 1125 | ), |
1126 | 1126 | array( |
1127 | 1127 | 'name' => 'license_key_response', |
1128 | - 'default_value' => $default_settings['license_key_response'], |
|
1128 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
1129 | 1129 | 'type' => 'hidden', |
1130 | 1130 | ), |
1131 | 1131 | array( |
1132 | 1132 | 'name' => 'license_key_status', |
1133 | - 'default_value' => $default_settings['license_key_status'], |
|
1133 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
1134 | 1134 | 'type' => 'hidden', |
1135 | 1135 | ), |
1136 | 1136 | ); |
1137 | 1137 | |
1138 | 1138 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
1139 | - $license_fields[0] = array_merge( $license_fields[0], array( |
|
1139 | + $license_fields[ 0 ] = array_merge( $license_fields[ 0 ], array( |
|
1140 | 1140 | 'disabled' => true, |
1141 | 1141 | 'title' => __( 'The license key is defined by your site\'s configuration file.', 'gravityview' ), |
1142 | 1142 | ) ); |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | |
1148 | 1148 | if ( \gravityview()->plugin->is_GF_25() ) { |
1149 | 1149 | |
1150 | - $sections[] = array( |
|
1150 | + $sections[ ] = array( |
|
1151 | 1151 | 'title' => __( 'GravityView License', 'gravityview' ), |
1152 | 1152 | 'class' => 'gform-settings-panel--full gv-settings-panel--license', |
1153 | 1153 | 'description' => $version_info, |
@@ -1165,7 +1165,7 @@ discard block |
||
1165 | 1165 | ) ); |
1166 | 1166 | } |
1167 | 1167 | |
1168 | - $sections[] = array( |
|
1168 | + $sections[ ] = array( |
|
1169 | 1169 | 'title' => ( gravityview()->plugin->is_GF_25() ? __( 'GravityView Settings', 'gravityview' ) : null ), |
1170 | 1170 | 'class' => 'gform-settings-panel--full gv-settings-panel--core', |
1171 | 1171 | 'fields' => $fields, |
@@ -1189,8 +1189,8 @@ discard block |
||
1189 | 1189 | |
1190 | 1190 | if ( $disabled_attribute ) { |
1191 | 1191 | foreach ( $extension_sections as &$section ) { |
1192 | - foreach ( $section['fields'] as &$field ) { |
|
1193 | - $field['disabled'] = $disabled_attribute; |
|
1192 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
1193 | + $field[ 'disabled' ] = $disabled_attribute; |
|
1194 | 1194 | } |
1195 | 1195 | } |
1196 | 1196 | } |
@@ -1256,7 +1256,7 @@ discard block |
||
1256 | 1256 | public function settings_edd_license( $field, $echo = true ) { |
1257 | 1257 | |
1258 | 1258 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
1259 | - $field['input_type'] = 'password'; |
|
1259 | + $field[ 'input_type' ] = 'password'; |
|
1260 | 1260 | } |
1261 | 1261 | |
1262 | 1262 | $text = $this->settings_text( $field, false ); |
@@ -1308,7 +1308,7 @@ discard block |
||
1308 | 1308 | |
1309 | 1309 | ?> |
1310 | 1310 | |
1311 | - <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>"> |
|
1311 | + <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>"> |
|
1312 | 1312 | <td colspan="2"> |
1313 | 1313 | <?php $this->single_setting( $field ); ?> |
1314 | 1314 | </td> |
@@ -1334,8 +1334,8 @@ discard block |
||
1334 | 1334 | */ |
1335 | 1335 | public function single_setting_row( $field ) { |
1336 | 1336 | |
1337 | - $field['gv_description'] = Utils::get( $field, 'description' ); |
|
1338 | - $field['description'] = Utils::get( $field, 'subtitle' ); |
|
1337 | + $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
1338 | + $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
1339 | 1339 | parent::single_setting_row( $field ); |
1340 | 1340 | } |
1341 | 1341 | |
@@ -1396,8 +1396,8 @@ discard block |
||
1396 | 1396 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
1397 | 1397 | if ( ! $added_message && ( $local_key !== $response_key ) ) { |
1398 | 1398 | |
1399 | - unset( $posted_settings['license_key_response'] ); |
|
1400 | - unset( $posted_settings['license_key_status'] ); |
|
1399 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
1400 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
1401 | 1401 | |
1402 | 1402 | \GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
1403 | 1403 |