@@ -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> |
@@ -692,14 +692,14 @@ discard block |
||
| 692 | 692 | */ |
| 693 | 693 | public function as_html( $field, $echo = true ) { |
| 694 | 694 | |
| 695 | - $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit', 'reset', 'button' ) ) ) ? $field['type'] : 'submit'; |
|
| 695 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
| 696 | 696 | |
| 697 | 697 | $attributes = $this->get_field_attributes( $field ); |
| 698 | 698 | $default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
| 699 | - $value = $this->get( $field['name'], $default_value ); |
|
| 699 | + $value = $this->get( $field[ 'name' ], $default_value ); |
|
| 700 | 700 | |
| 701 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary primary gfbutton'; |
|
| 702 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
| 701 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary primary gfbutton'; |
|
| 702 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
| 703 | 703 | |
| 704 | 704 | if ( empty( $value ) ) { |
| 705 | 705 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | $attributes = $this->get_field_attributes( $field ); |
| 709 | 709 | |
| 710 | 710 | $html = '<input |
| 711 | - type="' . $field['type'] . '" |
|
| 711 | + type="' . $field[ 'type' ] . '" |
|
| 712 | 712 | name="' . esc_attr( $name ) . '" |
| 713 | 713 | value="' . $value . '" ' . |
| 714 | 714 | implode( ' ', $attributes ) . |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | */ |
| 743 | 743 | public function is_save_postback() { |
| 744 | 744 | |
| 745 | - return isset( $_POST['gform-settings-save'] ) && isset( $_POST['_gravityview_save_settings_nonce'] ); |
|
| 745 | + return isset( $_POST[ 'gform-settings-save' ] ) && isset( $_POST[ '_gravityview_save_settings_nonce' ] ); |
|
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | /** |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | |
| 855 | 855 | $scripts = parent::scripts(); |
| 856 | 856 | |
| 857 | - $scripts[] = array( |
|
| 857 | + $scripts[ ] = array( |
|
| 858 | 858 | 'handle' => 'gform_tooltip_init', |
| 859 | 859 | 'enqueue' => array( |
| 860 | 860 | array( |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | |
| 876 | 876 | $styles = parent::styles(); |
| 877 | 877 | |
| 878 | - $styles[] = array( |
|
| 878 | + $styles[ ] = array( |
|
| 879 | 879 | 'handle' => 'gravityview_settings', |
| 880 | 880 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
| 881 | 881 | 'version' => Plugin::$version, |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | 'name' => 'support-email', |
| 965 | 965 | 'type' => 'text', |
| 966 | 966 | 'validate' => 'email', |
| 967 | - 'default_value' => $default_settings['support-email'], |
|
| 967 | + 'default_value' => $default_settings[ 'support-email' ], |
|
| 968 | 968 | 'label' => __( 'Support Email', 'gravityview' ), |
| 969 | 969 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
| 970 | 970 | 'class' => 'code regular-text', |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | 'name' => 'support_port', |
| 977 | 977 | 'type' => 'radio', |
| 978 | 978 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
| 979 | - 'default_value' => $default_settings['support_port'], |
|
| 979 | + 'default_value' => $default_settings[ 'support_port' ], |
|
| 980 | 980 | 'horizontal' => 1, |
| 981 | 981 | 'choices' => array( |
| 982 | 982 | array( |
@@ -995,7 +995,7 @@ discard block |
||
| 995 | 995 | 'name' => 'no-conflict-mode', |
| 996 | 996 | 'type' => 'radio', |
| 997 | 997 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
| 998 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
| 998 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
| 999 | 999 | 'horizontal' => 1, |
| 1000 | 1000 | 'choices' => array( |
| 1001 | 1001 | array( |
@@ -1017,7 +1017,7 @@ discard block |
||
| 1017 | 1017 | 'name' => 'rest_api', |
| 1018 | 1018 | 'type' => 'radio', |
| 1019 | 1019 | 'label' => __( 'REST API', 'gravityview' ), |
| 1020 | - 'default_value' => $default_settings['rest_api'], |
|
| 1020 | + 'default_value' => $default_settings[ 'rest_api' ], |
|
| 1021 | 1021 | 'horizontal' => 1, |
| 1022 | 1022 | 'choices' => array( |
| 1023 | 1023 | array( |
@@ -1036,7 +1036,7 @@ discard block |
||
| 1036 | 1036 | 'name' => 'beta', |
| 1037 | 1037 | 'type' => 'checkbox', |
| 1038 | 1038 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
| 1039 | - 'default_value' => $default_settings['beta'], |
|
| 1039 | + 'default_value' => $default_settings[ 'beta' ], |
|
| 1040 | 1040 | 'horizontal' => 1, |
| 1041 | 1041 | 'choices' => array( |
| 1042 | 1042 | array( |
@@ -1070,17 +1070,17 @@ discard block |
||
| 1070 | 1070 | * @since 1.7.4 |
| 1071 | 1071 | */ |
| 1072 | 1072 | foreach ( $fields as &$field ) { |
| 1073 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
| 1074 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
| 1075 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
| 1076 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
| 1073 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
| 1074 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
| 1075 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
| 1076 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
| 1077 | 1077 | |
| 1078 | 1078 | if ( $disabled_attribute ) { |
| 1079 | - $field['disabled'] = $disabled_attribute; |
|
| 1079 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 1080 | 1080 | } |
| 1081 | 1081 | |
| 1082 | - if ( empty( $field['disabled'] ) ) { |
|
| 1083 | - unset( $field['disabled'] ); |
|
| 1082 | + if ( empty( $field[ 'disabled' ] ) ) { |
|
| 1083 | + unset( $field[ 'disabled' ] ); |
|
| 1084 | 1084 | } |
| 1085 | 1085 | } |
| 1086 | 1086 | |
@@ -1092,23 +1092,23 @@ discard block |
||
| 1092 | 1092 | 'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ), |
| 1093 | 1093 | 'type' => 'edd_license', |
| 1094 | 1094 | 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
| 1095 | - 'default_value' => $default_settings['license_key'], |
|
| 1095 | + 'default_value' => $default_settings[ 'license_key' ], |
|
| 1096 | 1096 | 'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
| 1097 | 1097 | ), |
| 1098 | 1098 | array( |
| 1099 | 1099 | 'name' => 'license_key_response', |
| 1100 | - 'default_value' => $default_settings['license_key_response'], |
|
| 1100 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
| 1101 | 1101 | 'type' => 'hidden', |
| 1102 | 1102 | ), |
| 1103 | 1103 | array( |
| 1104 | 1104 | 'name' => 'license_key_status', |
| 1105 | - 'default_value' => $default_settings['license_key_status'], |
|
| 1105 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
| 1106 | 1106 | 'type' => 'hidden', |
| 1107 | 1107 | ), |
| 1108 | 1108 | ); |
| 1109 | 1109 | |
| 1110 | 1110 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
| 1111 | - $license_fields[0] = array_merge( $license_fields[0], array( |
|
| 1111 | + $license_fields[ 0 ] = array_merge( $license_fields[ 0 ], array( |
|
| 1112 | 1112 | 'disabled' => true, |
| 1113 | 1113 | 'title' => __( 'The license key is defined by your site\'s configuration file.', 'gravityview' ), |
| 1114 | 1114 | ) ); |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | |
| 1120 | 1120 | if ( \gravityview()->plugin->is_GF_25() ) { |
| 1121 | 1121 | |
| 1122 | - $sections[] = array( |
|
| 1122 | + $sections[ ] = array( |
|
| 1123 | 1123 | 'title' => __( 'GravityView License', 'gravityview' ), |
| 1124 | 1124 | 'class' => 'gform-settings-panel--full gv-settings-panel--license', |
| 1125 | 1125 | 'description' => $version_info, |
@@ -1137,7 +1137,7 @@ discard block |
||
| 1137 | 1137 | ) ); |
| 1138 | 1138 | } |
| 1139 | 1139 | |
| 1140 | - $sections[] = array( |
|
| 1140 | + $sections[ ] = array( |
|
| 1141 | 1141 | 'title' => ( gravityview()->plugin->is_GF_25() ? __( 'GravityView Settings', 'gravityview' ) : null ), |
| 1142 | 1142 | 'class' => 'gform-settings-panel--full gv-settings-panel--core', |
| 1143 | 1143 | 'fields' => $fields, |
@@ -1161,8 +1161,8 @@ discard block |
||
| 1161 | 1161 | |
| 1162 | 1162 | if ( $disabled_attribute ) { |
| 1163 | 1163 | foreach ( $extension_sections as &$section ) { |
| 1164 | - foreach ( $section['fields'] as &$field ) { |
|
| 1165 | - $field['disabled'] = $disabled_attribute; |
|
| 1164 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
| 1165 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 1166 | 1166 | } |
| 1167 | 1167 | } |
| 1168 | 1168 | } |
@@ -1228,7 +1228,7 @@ discard block |
||
| 1228 | 1228 | public function settings_edd_license( $field, $echo = true ) { |
| 1229 | 1229 | |
| 1230 | 1230 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
| 1231 | - $field['input_type'] = 'password'; |
|
| 1231 | + $field[ 'input_type' ] = 'password'; |
|
| 1232 | 1232 | } |
| 1233 | 1233 | |
| 1234 | 1234 | $text = $this->settings_text( $field, false ); |
@@ -1280,7 +1280,7 @@ discard block |
||
| 1280 | 1280 | |
| 1281 | 1281 | ?> |
| 1282 | 1282 | |
| 1283 | - <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>"> |
|
| 1283 | + <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>"> |
|
| 1284 | 1284 | <td colspan="2"> |
| 1285 | 1285 | <?php $this->single_setting( $field ); ?> |
| 1286 | 1286 | </td> |
@@ -1306,8 +1306,8 @@ discard block |
||
| 1306 | 1306 | */ |
| 1307 | 1307 | public function single_setting_row( $field ) { |
| 1308 | 1308 | |
| 1309 | - $field['gv_description'] = Utils::get( $field, 'description' ); |
|
| 1310 | - $field['description'] = Utils::get( $field, 'subtitle' ); |
|
| 1309 | + $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
| 1310 | + $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
| 1311 | 1311 | parent::single_setting_row( $field ); |
| 1312 | 1312 | } |
| 1313 | 1313 | |
@@ -1368,8 +1368,8 @@ discard block |
||
| 1368 | 1368 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
| 1369 | 1369 | if ( ! $added_message && ( $local_key !== $response_key ) ) { |
| 1370 | 1370 | |
| 1371 | - unset( $posted_settings['license_key_response'] ); |
|
| 1372 | - unset( $posted_settings['license_key_status'] ); |
|
| 1371 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
| 1372 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
| 1373 | 1373 | |
| 1374 | 1374 | \GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
| 1375 | 1375 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | 104 | if ( ! empty( $action ) ) { |
| 105 | - $settings['edd_action'] = esc_attr( $action ); |
|
| 105 | + $settings[ 'edd_action' ] = esc_attr( $action ); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | return array_map( 'urlencode', $settings ); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | 'format' => 'json', |
| 159 | 159 | ) ); |
| 160 | 160 | |
| 161 | - if ( $is_ajax && empty( $data['license'] ) ) { |
|
| 161 | + if ( $is_ajax && empty( $data[ 'license' ] ) ) { |
|
| 162 | 162 | die( -1 ); |
| 163 | 163 | } |
| 164 | 164 | |
@@ -186,11 +186,11 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | $json = json_encode( $license_data ); |
| 188 | 188 | |
| 189 | - $update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST('action'); |
|
| 189 | + $update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST( 'action' ); |
|
| 190 | 190 | |
| 191 | 191 | $is_check_action_button = ( 'check_license' === Utils::get( $data, 'edd_action' ) && defined( 'DOING_AJAX' ) && DOING_AJAX ); |
| 192 | 192 | |
| 193 | - do_action('gravityview/admin_installer/delete_downloads_data', true ); |
|
| 193 | + do_action( 'gravityview/admin_installer/delete_downloads_data', true ); |
|
| 194 | 194 | |
| 195 | 195 | if ( $is_check_action_button ) { |
| 196 | 196 | delete_transient( self::status_transient_key ); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | // most likely a mistake. |
| 202 | 202 | } else if ( $license_data->license !== 'failed' && $update_license ) { |
| 203 | 203 | |
| 204 | - if ( ! empty( $data['field_id'] ) ) { |
|
| 204 | + if ( ! empty( $data[ 'field_id' ] ) ) { |
|
| 205 | 205 | set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS ); |
| 206 | 206 | } |
| 207 | 207 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | $class = 'hide'; |
| 230 | 230 | $message = ''; |
| 231 | 231 | } else { |
| 232 | - if( ! empty( $license_data->error ) ) { |
|
| 232 | + if ( ! empty( $license_data->error ) ) { |
|
| 233 | 233 | $class = 'error'; |
| 234 | 234 | $string_key = $license_data->error; |
| 235 | 235 | } else { $class = $license_data->license; |
@@ -253,12 +253,12 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | public function license_details( $response = array() ) { |
| 255 | 255 | |
| 256 | - $response = (array) $response; |
|
| 256 | + $response = (array)$response; |
|
| 257 | 257 | |
| 258 | 258 | $return = ''; |
| 259 | 259 | $wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>'; |
| 260 | 260 | |
| 261 | - if ( ! empty( $response['license_key'] ) ) { |
|
| 261 | + if ( ! empty( $response[ 'license_key' ] ) ) { |
|
| 262 | 262 | $return .= '<h3>' . rtrim( esc_html__( 'License Details:', 'gravityview' ), ':' ) . '</h3>'; |
| 263 | 263 | |
| 264 | 264 | if ( in_array( Utils::get( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) { |
@@ -266,8 +266,8 @@ discard block |
||
| 266 | 266 | return sprintf( $wrapper, '' ); // Do not show redundant information - invalid/deactivated notice will be displayed by generate_license_box() |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - $return .= $this->strings( $response['license'], $response ); |
|
| 270 | - } elseif ( ! empty( $response['license_name'] ) ) { |
|
| 269 | + $return .= $this->strings( $response[ 'license' ], $response ); |
|
| 270 | + } elseif ( ! empty( $response[ 'license_name' ] ) ) { |
|
| 271 | 271 | $response_keys = array( |
| 272 | 272 | 'license_name' => '', |
| 273 | 273 | 'license_limit' => '', |
@@ -282,21 +282,21 @@ discard block |
||
| 282 | 282 | $response = wp_parse_args( $response, $response_keys ); |
| 283 | 283 | |
| 284 | 284 | $login_link_class = gravityview()->plugin->is_GF_25() ? 'button button-outline outline' : 'text-link'; |
| 285 | - $login_link = sprintf( '<a href="%s" class="gv-access-account ' . $login_link_class . '" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response['customer_email'] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) ); |
|
| 286 | - $local_text = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' ); |
|
| 287 | - $license_limit = empty( $response['license_limit'] ) ? __( 'Unlimited', 'gravityview' ) : (int) $response['license_limit']; |
|
| 288 | - |
|
| 289 | - $details = array( |
|
| 290 | - 'license' => sprintf( esc_html__( 'License level: %s', 'gravityview' ), '<span class="gv-license-detail">' . esc_html( $response['license_name'] ) . '</span>' ), |
|
| 291 | - 'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), '<span class="gv-license-detail">' . esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . $login_link . '</span>', |
|
| 292 | - 'activations' => sprintf( str_replace( '%d', '%s', esc_html__( 'Activations: %d of %s sites', 'gravityview' ) ), '<span class="gv-license-detail">' . intval( $response['site_count'] ), esc_html( $license_limit ) ) . '</span>' . $local_text, |
|
| 293 | - 'expires' => 'lifetime' === $response['expires'] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ), |
|
| 294 | - 'upgrade' => $this->get_upgrade_html( $response['upgrades'] ), |
|
| 285 | + $login_link = sprintf( '<a href="%s" class="gv-access-account ' . $login_link_class . '" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response[ 'customer_email' ] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) ); |
|
| 286 | + $local_text = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' ); |
|
| 287 | + $license_limit = empty( $response[ 'license_limit' ] ) ? __( 'Unlimited', 'gravityview' ) : (int)$response[ 'license_limit' ]; |
|
| 288 | + |
|
| 289 | + $details = array( |
|
| 290 | + 'license' => sprintf( esc_html__( 'License level: %s', 'gravityview' ), '<span class="gv-license-detail">' . esc_html( $response[ 'license_name' ] ) . '</span>' ), |
|
| 291 | + 'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), '<span class="gv-license-detail">' . esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . $login_link . '</span>', |
|
| 292 | + 'activations' => sprintf( str_replace( '%d', '%s', esc_html__( 'Activations: %d of %s sites', 'gravityview' ) ), '<span class="gv-license-detail">' . intval( $response[ 'site_count' ] ), esc_html( $license_limit ) ) . '</span>' . $local_text, |
|
| 293 | + 'expires' => 'lifetime' === $response[ 'expires' ] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ), |
|
| 294 | + 'upgrade' => $this->get_upgrade_html( $response[ 'upgrades' ] ), |
|
| 295 | 295 | ); |
| 296 | 296 | |
| 297 | - if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) { |
|
| 298 | - unset( $details['upgrade'] ); |
|
| 299 | - $details['expires'] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>'; |
|
| 297 | + if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) { |
|
| 298 | + unset( $details[ 'upgrade' ] ); |
|
| 299 | + $details[ 'expires' ] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>'; |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | $return .= '<ul><li>' . implode( '</li><li>', array_filter( $details ) ) . '</li></ul>'; |
@@ -322,20 +322,20 @@ discard block |
||
| 322 | 322 | if ( ! empty( $upgrades ) ) { |
| 323 | 323 | |
| 324 | 324 | $locale_parts = explode( '_', get_locale() ); |
| 325 | - $is_english = ( 'en' === $locale_parts[0] ); |
|
| 325 | + $is_english = ( 'en' === $locale_parts[ 0 ] ); |
|
| 326 | 326 | |
| 327 | 327 | $output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>'; |
| 328 | 328 | $output .= '<ul class="ul-disc">'; |
| 329 | 329 | |
| 330 | 330 | foreach ( $upgrades as $upgrade_id => $upgrade ) { |
| 331 | - $upgrade = (object) $upgrade; |
|
| 331 | + $upgrade = (object)$upgrade; |
|
| 332 | 332 | |
| 333 | 333 | $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 ) ); |
| 334 | 334 | |
| 335 | 335 | if ( $is_english && isset( $upgrade->description ) ) { |
| 336 | 336 | $message = esc_html( $upgrade->description ); |
| 337 | 337 | } else { |
| 338 | - switch( $upgrade->price_id ) { |
|
| 338 | + switch ( $upgrade->price_id ) { |
|
| 339 | 339 | // Interstellar |
| 340 | 340 | case 1: |
| 341 | 341 | default: |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | 'invalid_item_id' => esc_html__( 'This license key does not have access to this plugin.', 'gravityview' ), |
| 415 | 415 | 'missing' => esc_html__( 'The license key entered is invalid.', 'gravityview' ), // Missing is "the license couldn't be found", not "you submitted an empty license" |
| 416 | 416 | 'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ), |
| 417 | - '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>' ), |
|
| 417 | + '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>' ), |
|
| 418 | 418 | 'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ), |
| 419 | 419 | 'verifying_license' => esc_html__( 'Verifying license…', 'gravityview' ), |
| 420 | 420 | 'activate_license' => esc_html__( 'Activate License', 'gravityview' ), |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | if ( ! empty( $license_data->renewal_url ) ) { |
| 444 | 444 | $renew_license_url = $license_data->renewal_url; |
| 445 | - } elseif( ! empty( $license_data->license_key ) ) { |
|
| 445 | + } elseif ( ! empty( $license_data->license_key ) ) { |
|
| 446 | 446 | $renew_license_url = sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s', $license_data->license_key ); |
| 447 | 447 | } else { |
| 448 | 448 | $renew_license_url = 'https://gravityview.co/account/'; |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | * @return array|\WP_Error |
| 460 | 460 | */ |
| 461 | 461 | private function _license_get_remote_response( $data, $license = '' ) { |
| 462 | - $api_params = $this->_get_edd_settings( $data['edd_action'], $license ); |
|
| 462 | + $api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license ); |
|
| 463 | 463 | |
| 464 | 464 | $url = add_query_arg( $api_params, self::url ); |
| 465 | 465 | |
@@ -499,9 +499,9 @@ discard block |
||
| 499 | 499 | private function license_call_update_settings( $license_data, $data ) { |
| 500 | 500 | $settings = array(); |
| 501 | 501 | |
| 502 | - $settings['license_key'] = $license_data->license_key = trim( $data['license'] ); |
|
| 503 | - $settings['license_key_status'] = $license_data->license; |
|
| 504 | - $settings['license_key_response'] = (array)$license_data; |
|
| 502 | + $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] ); |
|
| 503 | + $settings[ 'license_key_status' ] = $license_data->license; |
|
| 504 | + $settings[ 'license_key_response' ] = (array)$license_data; |
|
| 505 | 505 | |
| 506 | 506 | $this->settings->set( $settings ); |
| 507 | 507 | } |
@@ -521,9 +521,9 @@ discard block |
||
| 521 | 521 | $status = trim( $this->settings->get( 'license_key_status' ) ); |
| 522 | 522 | $key = trim( $this->settings->get( 'license_key' ) ); |
| 523 | 523 | |
| 524 | - if ( !empty( $key ) ) { |
|
| 524 | + if ( ! empty( $key ) ) { |
|
| 525 | 525 | $response = $this->settings->get( 'license_key_response' ); |
| 526 | - $response = is_array( $response ) ? (object) $response : json_decode( $response ); |
|
| 526 | + $response = is_array( $response ) ? (object)$response : json_decode( $response ); |
|
| 527 | 527 | } else { |
| 528 | 528 | $response = array(); |
| 529 | 529 | } |
@@ -566,11 +566,11 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | $submit = '<div class="gv-edd-button-wrapper">'; |
| 568 | 568 | foreach ( $fields as $field ) { |
| 569 | - $field['type'] = 'button'; |
|
| 570 | - $field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class; |
|
| 571 | - $field['style'] = 'margin-left: 10px;'; |
|
| 572 | - if( $disabled_attribute ) { |
|
| 573 | - $field['disabled'] = $disabled_attribute; |
|
| 569 | + $field[ 'type' ] = 'button'; |
|
| 570 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class; |
|
| 571 | + $field[ 'style' ] = 'margin-left: 10px;'; |
|
| 572 | + if ( $disabled_attribute ) { |
|
| 573 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 574 | 574 | } |
| 575 | 575 | $submit .= $this->settings->as_html( $field, $echo ); |
| 576 | 576 | } |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | 'url' => home_url(), |
| 650 | 650 | 'site_data' => $this->get_site_data(), |
| 651 | 651 | ), |
| 652 | - )); |
|
| 652 | + ) ); |
|
| 653 | 653 | |
| 654 | 654 | // make sure the response came back okay |
| 655 | 655 | if ( is_wp_error( $response ) ) { |
@@ -679,45 +679,45 @@ discard block |
||
| 679 | 679 | $theme_data = wp_get_theme(); |
| 680 | 680 | $theme = $theme_data->Name . ' ' . $theme_data->Version; |
| 681 | 681 | |
| 682 | - $data['gv_version'] = Plugin::$version; |
|
| 683 | - $data['php_version'] = phpversion(); |
|
| 684 | - $data['wp_version'] = get_bloginfo( 'version' ); |
|
| 685 | - $data['gf_version'] = \GFForms::$version; |
|
| 686 | - $data['server'] = Utils::get( $_SERVER, 'SERVER_SOFTWARE' ); |
|
| 687 | - $data['multisite'] = is_multisite(); |
|
| 688 | - $data['theme'] = $theme; |
|
| 689 | - $data['url'] = home_url(); |
|
| 690 | - $data['license_key'] = $this->settings->get( 'license_key' ); |
|
| 691 | - $data['beta'] = $this->settings->get( 'beta' ); |
|
| 682 | + $data[ 'gv_version' ] = Plugin::$version; |
|
| 683 | + $data[ 'php_version' ] = phpversion(); |
|
| 684 | + $data[ 'wp_version' ] = get_bloginfo( 'version' ); |
|
| 685 | + $data[ 'gf_version' ] = \GFForms::$version; |
|
| 686 | + $data[ 'server' ] = Utils::get( $_SERVER, 'SERVER_SOFTWARE' ); |
|
| 687 | + $data[ 'multisite' ] = is_multisite(); |
|
| 688 | + $data[ 'theme' ] = $theme; |
|
| 689 | + $data[ 'url' ] = home_url(); |
|
| 690 | + $data[ 'license_key' ] = $this->settings->get( 'license_key' ); |
|
| 691 | + $data[ 'beta' ] = $this->settings->get( 'beta' ); |
|
| 692 | 692 | |
| 693 | 693 | // View Data |
| 694 | 694 | $gravityview_posts = wp_count_posts( 'gravityview', 'readable' ); |
| 695 | 695 | |
| 696 | - $data['view_count'] = null; |
|
| 697 | - $data['view_first'] = null; |
|
| 698 | - $data['view_latest'] = null; |
|
| 696 | + $data[ 'view_count' ] = null; |
|
| 697 | + $data[ 'view_first' ] = null; |
|
| 698 | + $data[ 'view_latest' ] = null; |
|
| 699 | 699 | |
| 700 | 700 | if ( $gravityview_posts->publish ) { |
| 701 | - $data['view_count'] = $gravityview_posts->publish; |
|
| 701 | + $data[ 'view_count' ] = $gravityview_posts->publish; |
|
| 702 | 702 | |
| 703 | 703 | $first = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=ASC' ); |
| 704 | 704 | $latest = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=DESC' ); |
| 705 | 705 | |
| 706 | 706 | if ( $first = array_shift( $first ) ) { |
| 707 | - $data['view_first'] = $first->post_date; |
|
| 707 | + $data[ 'view_first' ] = $first->post_date; |
|
| 708 | 708 | } |
| 709 | 709 | if ( $latest = array_pop( $latest ) ) { |
| 710 | - $data['view_latest'] = $latest->post_date; |
|
| 710 | + $data[ 'view_latest' ] = $latest->post_date; |
|
| 711 | 711 | } |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | // Form counts |
| 715 | 715 | if ( class_exists( 'GFFormsModel' ) ) { |
| 716 | 716 | $form_data = \GFFormsModel::get_form_count(); |
| 717 | - $data['forms_total'] = Utils::get( $form_data, 'total', 0 ); |
|
| 718 | - $data['forms_active'] = Utils::get( $form_data, 'active', 0 ); |
|
| 719 | - $data['forms_inactive'] = Utils::get( $form_data, 'inactive', 0 ); |
|
| 720 | - $data['forms_trash'] = Utils::get( $form_data, 'inactive', 0 ); |
|
| 717 | + $data[ 'forms_total' ] = Utils::get( $form_data, 'total', 0 ); |
|
| 718 | + $data[ 'forms_active' ] = Utils::get( $form_data, 'active', 0 ); |
|
| 719 | + $data[ 'forms_inactive' ] = Utils::get( $form_data, 'inactive', 0 ); |
|
| 720 | + $data[ 'forms_trash' ] = Utils::get( $form_data, 'inactive', 0 ); |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | // Retrieve current plugin information |
@@ -725,13 +725,13 @@ discard block |
||
| 725 | 725 | include ABSPATH . '/wp-admin/includes/plugin.php'; |
| 726 | 726 | } |
| 727 | 727 | |
| 728 | - $data['integrations'] = self::get_related_plugins_and_extensions(); |
|
| 729 | - $data['active_plugins'] = get_option( 'active_plugins', array() ); |
|
| 730 | - $data['inactive_plugins'] = array(); |
|
| 731 | - $data['locale'] = get_locale(); |
|
| 728 | + $data[ 'integrations' ] = self::get_related_plugins_and_extensions(); |
|
| 729 | + $data[ 'active_plugins' ] = get_option( 'active_plugins', array() ); |
|
| 730 | + $data[ 'inactive_plugins' ] = array(); |
|
| 731 | + $data[ 'locale' ] = get_locale(); |
|
| 732 | 732 | |
| 733 | 733 | // Validate request on the GV server |
| 734 | - $data['hash'] = 'gv_version.url.locale:' . sha1( $data['gv_version'] . $data['url'] . $data['locale'] ); |
|
| 734 | + $data[ 'hash' ] = 'gv_version.url.locale:' . sha1( $data[ 'gv_version' ] . $data[ 'url' ] . $data[ 'locale' ] ); |
|
| 735 | 735 | |
| 736 | 736 | return $data; |
| 737 | 737 | } |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | |
| 762 | 762 | $plugin_data = get_plugin_data( $active_plugin ); |
| 763 | 763 | |
| 764 | - $extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] ); |
|
| 764 | + $extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] ); |
|
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | if ( ! empty( $extensions ) ) { |