@@ -102,7 +102,7 @@ discard block |
||
| 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 |
||
| 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 | ?> |
@@ -533,15 +533,15 @@ discard block |
||
| 533 | 533 | * @return string The HTML |
| 534 | 534 | */ |
| 535 | 535 | public function as_html( $field, $echo = true ) { |
| 536 | - $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit','reset','button' ) ) ) ? $field['type'] : 'submit'; |
|
| 536 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
| 537 | 537 | |
| 538 | 538 | $attributes = $this->get_field_attributes( $field ); |
| 539 | 539 | $default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
| 540 | - $value = $this->get( $field['name'], $default_value ); |
|
| 540 | + $value = $this->get( $field[ 'name' ], $default_value ); |
|
| 541 | 541 | |
| 542 | 542 | |
| 543 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton'; |
|
| 544 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
| 543 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton'; |
|
| 544 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
| 545 | 545 | |
| 546 | 546 | if ( empty( $value ) ) { |
| 547 | 547 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | $attributes = $this->get_field_attributes( $field ); |
| 551 | 551 | |
| 552 | 552 | $html = '<input |
| 553 | - type="' . $field['type'] . '" |
|
| 553 | + type="' . $field[ 'type' ] . '" |
|
| 554 | 554 | name="' . esc_attr( $name ) . '" |
| 555 | 555 | value="' . $value . '" ' . |
| 556 | 556 | implode( ' ', $attributes ) . |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | * @return bool |
| 582 | 582 | */ |
| 583 | 583 | public function is_save_postback() { |
| 584 | - return isset( $_POST['gform-settings-save'] ) && isset( $_POST['_gravityview_save_settings_nonce'] ); |
|
| 584 | + return isset( $_POST[ 'gform-settings-save' ] ) && isset( $_POST[ '_gravityview_save_settings_nonce' ] ); |
|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | /** |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | */ |
| 592 | 592 | public function license_key_notice() { |
| 593 | 593 | |
| 594 | - if( $this->is_save_postback() ) { |
|
| 594 | + if ( $this->is_save_postback() ) { |
|
| 595 | 595 | $settings = $this->get_posted_settings(); |
| 596 | 596 | $license_key = \GV\Utils::get( $settings, 'license_key' ); |
| 597 | 597 | $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' ); |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | * but didn't want to mess up the translation strings for the translators. |
| 613 | 613 | */ |
| 614 | 614 | $message = mb_substr( $message, 0, mb_strlen( $message ) - 1 ); |
| 615 | - $title = __( 'Inactive License', 'gravityview'); |
|
| 615 | + $title = __( 'Inactive License', 'gravityview' ); |
|
| 616 | 616 | $status = ''; |
| 617 | 617 | $update_below = false; |
| 618 | 618 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | $update_below = __( 'Activate your license key below.', 'gravityview' ); |
| 643 | 643 | break; |
| 644 | 644 | } |
| 645 | - $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice'; |
|
| 645 | + $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice'; |
|
| 646 | 646 | |
| 647 | 647 | // Show a different notice on settings page for inactive licenses (hide the buttons) |
| 648 | 648 | if ( $update_below && gravityview()->request->is_admin( '', 'settings' ) ) { |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | public function scripts() { |
| 687 | 687 | $scripts = parent::scripts(); |
| 688 | 688 | |
| 689 | - $scripts[] = array( |
|
| 689 | + $scripts[ ] = array( |
|
| 690 | 690 | 'handle' => 'gform_tooltip_init', |
| 691 | 691 | 'enqueue' => array( |
| 692 | 692 | array( |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | public function styles() { |
| 706 | 706 | $styles = parent::styles(); |
| 707 | 707 | |
| 708 | - $styles[] = array( |
|
| 708 | + $styles[ ] = array( |
|
| 709 | 709 | 'handle' => 'gravityview_settings', |
| 710 | 710 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
| 711 | 711 | 'version' => Plugin::$version, |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | * If multisite and not network admin, we don't want the settings to show. |
| 737 | 737 | * @since 1.7.6 |
| 738 | 738 | */ |
| 739 | - $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
| 739 | + $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
| 740 | 740 | |
| 741 | 741 | /** |
| 742 | 742 | * Override whether to show the Settings menu on a per-blog basis. |
@@ -784,26 +784,26 @@ discard block |
||
| 784 | 784 | 'label' => __( 'License Key', 'gravityview' ), |
| 785 | 785 | 'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ) . $this->get_license_handler()->license_details( $this->get_app_setting( 'license_key_response' ) ), |
| 786 | 786 | 'type' => 'edd_license', |
| 787 | - 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
| 787 | + 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
| 788 | 788 | 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
| 789 | - 'default_value' => $default_settings['license_key'], |
|
| 789 | + 'default_value' => $default_settings[ 'license_key' ], |
|
| 790 | 790 | 'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
| 791 | 791 | ), |
| 792 | 792 | array( |
| 793 | 793 | 'name' => 'license_key_response', |
| 794 | - 'default_value' => $default_settings['license_key_response'], |
|
| 794 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
| 795 | 795 | 'type' => 'hidden', |
| 796 | 796 | ), |
| 797 | 797 | array( |
| 798 | 798 | 'name' => 'license_key_status', |
| 799 | - 'default_value' => $default_settings['license_key_status'], |
|
| 799 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
| 800 | 800 | 'type' => 'hidden', |
| 801 | 801 | ), |
| 802 | 802 | array( |
| 803 | 803 | 'name' => 'support-email', |
| 804 | 804 | 'type' => 'text', |
| 805 | 805 | 'validate' => 'email', |
| 806 | - 'default_value' => $default_settings['support-email'], |
|
| 806 | + 'default_value' => $default_settings[ 'support-email' ], |
|
| 807 | 807 | 'label' => __( 'Support Email', 'gravityview' ), |
| 808 | 808 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
| 809 | 809 | 'class' => 'code regular-text', |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | 'name' => 'support_port', |
| 816 | 816 | 'type' => 'radio', |
| 817 | 817 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
| 818 | - 'default_value' => $default_settings['support_port'], |
|
| 818 | + 'default_value' => $default_settings[ 'support_port' ], |
|
| 819 | 819 | 'horizontal' => 1, |
| 820 | 820 | 'choices' => array( |
| 821 | 821 | array( |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | 'name' => 'no-conflict-mode', |
| 835 | 835 | 'type' => 'radio', |
| 836 | 836 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
| 837 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
| 837 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
| 838 | 838 | 'horizontal' => 1, |
| 839 | 839 | 'choices' => array( |
| 840 | 840 | array( |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | 'name' => 'rest_api', |
| 857 | 857 | 'type' => 'radio', |
| 858 | 858 | 'label' => __( 'REST API', 'gravityview' ), |
| 859 | - 'default_value' => $default_settings['rest_api'], |
|
| 859 | + 'default_value' => $default_settings[ 'rest_api' ], |
|
| 860 | 860 | 'horizontal' => 1, |
| 861 | 861 | 'choices' => array( |
| 862 | 862 | array( |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | 'name' => 'beta', |
| 876 | 876 | 'type' => 'checkbox', |
| 877 | 877 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
| 878 | - 'default_value' => $default_settings['beta'], |
|
| 878 | + 'default_value' => $default_settings[ 'beta' ], |
|
| 879 | 879 | 'horizontal' => 1, |
| 880 | 880 | 'choices' => array( |
| 881 | 881 | array( |
@@ -908,17 +908,17 @@ discard block |
||
| 908 | 908 | * @since 1.7.4 |
| 909 | 909 | */ |
| 910 | 910 | foreach ( $fields as &$field ) { |
| 911 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
| 912 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
| 913 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
| 914 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
| 911 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
| 912 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
| 913 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
| 914 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
| 915 | 915 | |
| 916 | 916 | if ( $disabled_attribute ) { |
| 917 | - $field['disabled'] = $disabled_attribute; |
|
| 917 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 918 | 918 | } |
| 919 | 919 | |
| 920 | - if ( empty( $field['disabled'] ) ) { |
|
| 921 | - unset( $field['disabled'] ); |
|
| 920 | + if ( empty( $field[ 'disabled' ] ) ) { |
|
| 921 | + unset( $field[ 'disabled' ] ); |
|
| 922 | 922 | } |
| 923 | 923 | } |
| 924 | 924 | |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | ); |
| 937 | 937 | |
| 938 | 938 | if ( $disabled_attribute ) { |
| 939 | - $button['disabled'] = $disabled_attribute; |
|
| 939 | + $button[ 'disabled' ] = $disabled_attribute; |
|
| 940 | 940 | } |
| 941 | 941 | |
| 942 | 942 | /** |
@@ -955,20 +955,20 @@ discard block |
||
| 955 | 955 | // If there are extensions, add a section for them |
| 956 | 956 | if ( ! empty( $extension_sections ) ) { |
| 957 | 957 | |
| 958 | - if( $disabled_attribute ) { |
|
| 958 | + if ( $disabled_attribute ) { |
|
| 959 | 959 | foreach ( $extension_sections as &$section ) { |
| 960 | - foreach ( $section['fields'] as &$field ) { |
|
| 961 | - $field['disabled'] = $disabled_attribute; |
|
| 960 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
| 961 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 962 | 962 | } |
| 963 | 963 | } |
| 964 | 964 | } |
| 965 | 965 | |
| 966 | - $k = count( $extension_sections ) - 1 ; |
|
| 967 | - $extension_sections[ $k ]['fields'][] = $button; |
|
| 966 | + $k = count( $extension_sections ) - 1; |
|
| 967 | + $extension_sections[ $k ][ 'fields' ][ ] = $button; |
|
| 968 | 968 | $sections = array_merge( $sections, $extension_sections ); |
| 969 | 969 | } else { |
| 970 | 970 | // add the 'update settings' button to the general section |
| 971 | - $sections[0]['fields'][] = $button; |
|
| 971 | + $sections[ 0 ][ 'fields' ][ ] = $button; |
|
| 972 | 972 | } |
| 973 | 973 | |
| 974 | 974 | return $sections; |
@@ -1024,7 +1024,7 @@ discard block |
||
| 1024 | 1024 | protected function settings_edd_license( $field, $echo = true ) { |
| 1025 | 1025 | |
| 1026 | 1026 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
| 1027 | - $field['input_type'] = 'password'; |
|
| 1027 | + $field[ 'input_type' ] = 'password'; |
|
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | 1030 | $text = $this->settings_text( $field, false ); |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | public function single_setting_row_html( $field ) { |
| 1074 | 1074 | ?> |
| 1075 | 1075 | |
| 1076 | - <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>"> |
|
| 1076 | + <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>"> |
|
| 1077 | 1077 | <td colspan="2"> |
| 1078 | 1078 | <?php $this->single_setting( $field ); ?> |
| 1079 | 1079 | </td> |
@@ -1091,10 +1091,10 @@ discard block |
||
| 1091 | 1091 | * @return string |
| 1092 | 1092 | */ |
| 1093 | 1093 | public function settings_save( $field, $echo = true ) { |
| 1094 | - $field['type'] = 'submit'; |
|
| 1095 | - $field['name'] = 'gform-settings-save'; |
|
| 1096 | - $field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton'; |
|
| 1097 | - $field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 1094 | + $field[ 'type' ] = 'submit'; |
|
| 1095 | + $field[ 'name' ] = 'gform-settings-save'; |
|
| 1096 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton'; |
|
| 1097 | + $field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 1098 | 1098 | |
| 1099 | 1099 | $output = $this->settings_submit( $field, false ); |
| 1100 | 1100 | |
@@ -1125,8 +1125,8 @@ discard block |
||
| 1125 | 1125 | * @return void |
| 1126 | 1126 | */ |
| 1127 | 1127 | public function single_setting_row( $field ) { |
| 1128 | - $field['gv_description'] = Utils::get( $field, 'description' ); |
|
| 1129 | - $field['description'] = Utils::get( $field, 'subtitle' ); |
|
| 1128 | + $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
| 1129 | + $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
| 1130 | 1130 | parent::single_setting_row( $field ); |
| 1131 | 1131 | } |
| 1132 | 1132 | |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | public function single_setting_label( $field ) { |
| 1139 | 1139 | parent::single_setting_label( $field ); |
| 1140 | 1140 | if ( $description = Utils::get( $field, 'gv_description' ) ) { |
| 1141 | - echo '<span class="description">'. $description .'</span>'; |
|
| 1141 | + echo '<span class="description">' . $description . '</span>'; |
|
| 1142 | 1142 | } |
| 1143 | 1143 | } |
| 1144 | 1144 | |
@@ -1175,9 +1175,9 @@ discard block |
||
| 1175 | 1175 | // If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response), |
| 1176 | 1176 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
| 1177 | 1177 | if ( $local_key !== $response_key ) { |
| 1178 | - unset( $posted_settings['license_key_response'] ); |
|
| 1179 | - unset( $posted_settings['license_key_status'] ); |
|
| 1180 | - \GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
| 1178 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
| 1179 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
| 1180 | + \GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
| 1181 | 1181 | } |
| 1182 | 1182 | return $posted_settings; |
| 1183 | 1183 | } |
@@ -134,28 +134,28 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function add_network_menu() { |
| 136 | 136 | |
| 137 | - if ( ! gravityview()->plugin->is_network_activated() ) { |
|
| 137 | + if ( ! gravityview()->plugin->is_network_activated() ) { |
|
| 138 | 138 | return; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - add_menu_page( __( 'Settings', 'gravityview' ), __( 'GravityView', 'gravityview' ), $this->_capabilities_app_settings, "{$this->_slug}_settings", array( $this, 'app_tab_page' ), 'none' ); |
|
| 141 | + add_menu_page( __( 'Settings', 'gravityview' ), __( 'GravityView', 'gravityview' ), $this->_capabilities_app_settings, "{$this->_slug}_settings", array( $this, 'app_tab_page' ), 'none' ); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | - * Uninstall all traces of GravityView |
|
| 146 | - * |
|
| 147 | - * Note: method is public because parent method is public |
|
| 148 | - * |
|
| 145 | + * Uninstall all traces of GravityView |
|
| 146 | + * |
|
| 147 | + * Note: method is public because parent method is public |
|
| 148 | + * |
|
| 149 | 149 | * @return bool |
| 150 | 150 | */ |
| 151 | 151 | public function uninstall() { |
| 152 | 152 | gravityview()->plugin->uninstall(); |
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | - * Set the path so that Gravity Forms can de-activate GravityView |
|
| 156 | - * @see GFAddOn::uninstall_addon |
|
| 157 | - * @uses deactivate_plugins() |
|
| 158 | - */ |
|
| 155 | + * Set the path so that Gravity Forms can de-activate GravityView |
|
| 156 | + * @see GFAddOn::uninstall_addon |
|
| 157 | + * @uses deactivate_plugins() |
|
| 158 | + */ |
|
| 159 | 159 | $this->_path = GRAVITYVIEW_FILE; |
| 160 | 160 | |
| 161 | 161 | return true; |
@@ -185,42 +185,42 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | /** |
| 188 | - * Get an array of reasons why the plugin might be uninstalled |
|
| 189 | - * |
|
| 190 | - * @since 1.17.5 |
|
| 191 | - * |
|
| 188 | + * Get an array of reasons why the plugin might be uninstalled |
|
| 189 | + * |
|
| 190 | + * @since 1.17.5 |
|
| 191 | + * |
|
| 192 | 192 | * @return array Array of reasons with the label and followup questions for each uninstall reason |
| 193 | 193 | */ |
| 194 | 194 | private function get_uninstall_reasons() { |
| 195 | 195 | $reasons = array( |
| 196 | 196 | 'will-continue' => array( |
| 197 | - 'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ), |
|
| 198 | - ), |
|
| 197 | + 'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ), |
|
| 198 | + ), |
|
| 199 | 199 | 'no-longer-need' => array( |
| 200 | - 'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ), |
|
| 201 | - ), |
|
| 200 | + 'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ), |
|
| 201 | + ), |
|
| 202 | 202 | 'doesnt-work' => array( |
| 203 | - 'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ), |
|
| 204 | - ), |
|
| 203 | + 'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ), |
|
| 204 | + ), |
|
| 205 | 205 | 'found-other' => array( |
| 206 | - 'label' => esc_html__( 'I found a better plugin', 'gravityview' ), |
|
| 207 | - 'followup' => esc_attr__( 'What plugin you are using, and why?', 'gravityview' ), |
|
| 208 | - ), |
|
| 206 | + 'label' => esc_html__( 'I found a better plugin', 'gravityview' ), |
|
| 207 | + 'followup' => esc_attr__( 'What plugin you are using, and why?', 'gravityview' ), |
|
| 208 | + ), |
|
| 209 | 209 | 'other' => array( |
| 210 | - 'label' => esc_html__( 'Other', 'gravityview' ), |
|
| 211 | - ), |
|
| 210 | + 'label' => esc_html__( 'Other', 'gravityview' ), |
|
| 211 | + ), |
|
| 212 | 212 | ); |
| 213 | 213 | |
| 214 | 214 | shuffle( $reasons ); |
| 215 | 215 | |
| 216 | 216 | return $reasons; |
| 217 | - } |
|
| 217 | + } |
|
| 218 | 218 | |
| 219 | 219 | /** |
| 220 | - * Display a feedback form when the plugin is uninstalled |
|
| 221 | - * |
|
| 222 | - * @since 1.17.5 |
|
| 223 | - * |
|
| 220 | + * Display a feedback form when the plugin is uninstalled |
|
| 221 | + * |
|
| 222 | + * @since 1.17.5 |
|
| 223 | + * |
|
| 224 | 224 | * @return string HTML of the uninstallation form |
| 225 | 225 | */ |
| 226 | 226 | public function uninstall_form() { |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | <h2><?php esc_html_e( 'Why did you uninstall GravityView?', 'gravityview' ); ?></h2> |
| 301 | 301 | <ul> |
| 302 | 302 | <?php |
| 303 | - $reasons = $this->get_uninstall_reasons(); |
|
| 303 | + $reasons = $this->get_uninstall_reasons(); |
|
| 304 | 304 | foreach ( $reasons as $reason ) { |
| 305 | 305 | printf( '<li><label><input name="reason" type="radio" value="other" data-followup="%s"> %s</label></li>', Utils::get( $reason, 'followup' ), Utils::get( $reason, 'label' ) ); |
| 306 | 306 | } |
@@ -394,12 +394,12 @@ discard block |
||
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | public function app_settings_tab() { |
| 397 | - parent::app_settings_tab(); |
|
| 397 | + parent::app_settings_tab(); |
|
| 398 | 398 | |
| 399 | 399 | if ( $this->maybe_uninstall() ) { |
| 400 | - echo $this->uninstall_form(); |
|
| 400 | + echo $this->uninstall_form(); |
|
| 401 | 401 | } |
| 402 | - } |
|
| 402 | + } |
|
| 403 | 403 | |
| 404 | 404 | /** |
| 405 | 405 | * The Settings title |
@@ -557,8 +557,8 @@ discard block |
||
| 557 | 557 | type="' . $field['type'] . '" |
| 558 | 558 | name="' . esc_attr( $name ) . '" |
| 559 | 559 | value="' . $value . '" ' . |
| 560 | - implode( ' ', $attributes ) . |
|
| 561 | - ' />'; |
|
| 560 | + implode( ' ', $attributes ) . |
|
| 561 | + ' />'; |
|
| 562 | 562 | |
| 563 | 563 | if ( $echo ) { |
| 564 | 564 | echo $html; |
@@ -576,12 +576,12 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | /** |
| 579 | - * Check whether GravityView is being saved |
|
| 580 | - * |
|
| 581 | - * The generic is_save_postback() is true for all addons |
|
| 582 | - * |
|
| 583 | - * @since 2.0.8 |
|
| 584 | - * |
|
| 579 | + * Check whether GravityView is being saved |
|
| 580 | + * |
|
| 581 | + * The generic is_save_postback() is true for all addons |
|
| 582 | + * |
|
| 583 | + * @since 2.0.8 |
|
| 584 | + * |
|
| 585 | 585 | * @return bool |
| 586 | 586 | */ |
| 587 | 587 | public function is_save_postback() { |
@@ -595,16 +595,16 @@ discard block |
||
| 595 | 595 | */ |
| 596 | 596 | public function license_key_notice() { |
| 597 | 597 | |
| 598 | - if( $this->is_save_postback() ) { |
|
| 599 | - $settings = $this->get_posted_settings(); |
|
| 600 | - $license_key = \GV\Utils::get( $settings, 'license_key' ); |
|
| 601 | - $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' ); |
|
| 602 | - } else { |
|
| 603 | - $license_status = $this->get( 'license_key_status', 'inactive' ); |
|
| 604 | - $license_key = $this->get( 'license_key' ); |
|
| 605 | - } |
|
| 598 | + if( $this->is_save_postback() ) { |
|
| 599 | + $settings = $this->get_posted_settings(); |
|
| 600 | + $license_key = \GV\Utils::get( $settings, 'license_key' ); |
|
| 601 | + $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' ); |
|
| 602 | + } else { |
|
| 603 | + $license_status = $this->get( 'license_key_status', 'inactive' ); |
|
| 604 | + $license_key = $this->get( 'license_key' ); |
|
| 605 | + } |
|
| 606 | 606 | |
| 607 | - $license_id = empty( $license_key ) ? 'license' : $license_key; |
|
| 607 | + $license_id = empty( $license_key ) ? 'license' : $license_key; |
|
| 608 | 608 | |
| 609 | 609 | $message = esc_html__( 'Your GravityView license %s. This means you’re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview' ); |
| 610 | 610 | |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | $update_below = false; |
| 622 | 622 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
| 623 | 623 | |
| 624 | - switch ( $license_status ) { |
|
| 624 | + switch ( $license_status ) { |
|
| 625 | 625 | /** @since 1.17 */ |
| 626 | 626 | case 'expired': |
| 627 | 627 | $title = __( 'Expired License', 'gravityview' ); |
@@ -659,13 +659,13 @@ discard block |
||
| 659 | 659 | return; |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | - \GravityView_Admin_Notices::add_notice( array( |
|
| 663 | - 'message' => $message, |
|
| 664 | - 'class' => 'notice notice-warning', |
|
| 665 | - 'title' => $title, |
|
| 666 | - 'cap' => 'gravityview_edit_settings', |
|
| 667 | - 'dismiss' => sha1( $license_status . '_' . $license_id . '_' . date( 'z' ) ), // Show every day, instead of every 8 weeks (which is the default) |
|
| 668 | - ) ); |
|
| 662 | + \GravityView_Admin_Notices::add_notice( array( |
|
| 663 | + 'message' => $message, |
|
| 664 | + 'class' => 'notice notice-warning', |
|
| 665 | + 'title' => $title, |
|
| 666 | + 'cap' => 'gravityview_edit_settings', |
|
| 667 | + 'dismiss' => sha1( $license_status . '_' . $license_id . '_' . date( 'z' ) ), // Show every day, instead of every 8 weeks (which is the default) |
|
| 668 | + ) ); |
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | /** |
@@ -679,12 +679,12 @@ discard block |
||
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | /** |
| 682 | - * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
| 683 | - * |
|
| 684 | - * @since 1.21.5 |
|
| 685 | - * |
|
| 686 | - * @see GFAddOn::scripts() |
|
| 687 | - * |
|
| 682 | + * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
| 683 | + * |
|
| 684 | + * @since 1.21.5 |
|
| 685 | + * |
|
| 686 | + * @see GFAddOn::scripts() |
|
| 687 | + * |
|
| 688 | 688 | * @return array Array of scripts |
| 689 | 689 | */ |
| 690 | 690 | public function scripts() { |
@@ -693,10 +693,10 @@ discard block |
||
| 693 | 693 | $scripts[] = array( |
| 694 | 694 | 'handle' => 'gform_tooltip_init', |
| 695 | 695 | 'enqueue' => array( |
| 696 | - array( |
|
| 697 | - 'admin_page' => array( 'app_settings' ) |
|
| 698 | - ) |
|
| 699 | - ) |
|
| 696 | + array( |
|
| 697 | + 'admin_page' => array( 'app_settings' ) |
|
| 698 | + ) |
|
| 699 | + ) |
|
| 700 | 700 | ); |
| 701 | 701 | |
| 702 | 702 | return $scripts; |
@@ -714,10 +714,10 @@ discard block |
||
| 714 | 714 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
| 715 | 715 | 'version' => Plugin::$version, |
| 716 | 716 | 'deps' => array( |
| 717 | - 'gform_admin', |
|
| 717 | + 'gform_admin', |
|
| 718 | 718 | 'gaddon_form_settings_css', |
| 719 | - 'gform_tooltip', |
|
| 720 | - 'gform_font_awesome', |
|
| 719 | + 'gform_tooltip', |
|
| 720 | + 'gform_font_awesome', |
|
| 721 | 721 | ), |
| 722 | 722 | 'enqueue' => array( |
| 723 | 723 | array( 'admin_page' => array( |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | array( |
| 886 | 886 | 'label' => _x( 'Show me beta versions if they are available.', 'gravityview' ), |
| 887 | 887 | 'value' => '1', |
| 888 | - 'name' => 'beta', |
|
| 888 | + 'name' => 'beta', |
|
| 889 | 889 | ), |
| 890 | 890 | ), |
| 891 | 891 | 'description' => __( 'You will have early access to the latest GravityView features and improvements. There may be bugs! If you encounter an issue, help make GravityView better by reporting it!', 'gravityview' ), |
@@ -923,38 +923,38 @@ discard block |
||
| 923 | 923 | |
| 924 | 924 | if ( empty( $field['disabled'] ) ) { |
| 925 | 925 | unset( $field['disabled'] ); |
| 926 | - } |
|
| 926 | + } |
|
| 927 | 927 | } |
| 928 | 928 | |
| 929 | - $sections = array( |
|
| 930 | - array( |
|
| 931 | - 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), Plugin::$version ) ), |
|
| 932 | - 'fields' => $fields, |
|
| 933 | - ) |
|
| 934 | - ); |
|
| 929 | + $sections = array( |
|
| 930 | + array( |
|
| 931 | + 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), Plugin::$version ) ), |
|
| 932 | + 'fields' => $fields, |
|
| 933 | + ) |
|
| 934 | + ); |
|
| 935 | 935 | |
| 936 | - // custom 'update settings' button |
|
| 937 | - $button = array( |
|
| 938 | - 'class' => 'button button-primary button-hero', |
|
| 939 | - 'type' => 'save', |
|
| 940 | - ); |
|
| 936 | + // custom 'update settings' button |
|
| 937 | + $button = array( |
|
| 938 | + 'class' => 'button button-primary button-hero', |
|
| 939 | + 'type' => 'save', |
|
| 940 | + ); |
|
| 941 | 941 | |
| 942 | 942 | if ( $disabled_attribute ) { |
| 943 | 943 | $button['disabled'] = $disabled_attribute; |
| 944 | 944 | } |
| 945 | 945 | |
| 946 | - /** |
|
| 947 | - * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
| 948 | - * Extensions can tap in here to insert their own section and settings. |
|
| 949 | - * <code> |
|
| 950 | - * $sections[] = array( |
|
| 951 | - * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
| 952 | - * 'fields' => $settings, |
|
| 953 | - * ); |
|
| 954 | - * </code> |
|
| 955 | - * @param array $extension_settings Empty array, ready for extension settings! |
|
| 956 | - */ |
|
| 957 | - $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
| 946 | + /** |
|
| 947 | + * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
| 948 | + * Extensions can tap in here to insert their own section and settings. |
|
| 949 | + * <code> |
|
| 950 | + * $sections[] = array( |
|
| 951 | + * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
| 952 | + * 'fields' => $settings, |
|
| 953 | + * ); |
|
| 954 | + * </code> |
|
| 955 | + * @param array $extension_settings Empty array, ready for extension settings! |
|
| 956 | + */ |
|
| 957 | + $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
| 958 | 958 | |
| 959 | 959 | // If there are extensions, add a section for them |
| 960 | 960 | if ( ! empty( $extension_sections ) ) { |
@@ -967,13 +967,13 @@ discard block |
||
| 967 | 967 | } |
| 968 | 968 | } |
| 969 | 969 | |
| 970 | - $k = count( $extension_sections ) - 1 ; |
|
| 971 | - $extension_sections[ $k ]['fields'][] = $button; |
|
| 970 | + $k = count( $extension_sections ) - 1 ; |
|
| 971 | + $extension_sections[ $k ]['fields'][] = $button; |
|
| 972 | 972 | $sections = array_merge( $sections, $extension_sections ); |
| 973 | 973 | } else { |
| 974 | - // add the 'update settings' button to the general section |
|
| 975 | - $sections[0]['fields'][] = $button; |
|
| 976 | - } |
|
| 974 | + // add the 'update settings' button to the general section |
|
| 975 | + $sections[0]['fields'][] = $button; |
|
| 976 | + } |
|
| 977 | 977 | |
| 978 | 978 | return $sections; |
| 979 | 979 | } |
@@ -1027,9 +1027,9 @@ discard block |
||
| 1027 | 1027 | */ |
| 1028 | 1028 | protected function settings_edd_license( $field, $echo = true ) { |
| 1029 | 1029 | |
| 1030 | - if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
|
| 1031 | - $field['input_type'] = 'password'; |
|
| 1032 | - } |
|
| 1030 | + if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
|
| 1031 | + $field['input_type'] = 'password'; |
|
| 1032 | + } |
|
| 1033 | 1033 | |
| 1034 | 1034 | $text = $this->settings_text( $field, false ); |
| 1035 | 1035 | |
@@ -1046,9 +1046,9 @@ discard block |
||
| 1046 | 1046 | |
| 1047 | 1047 | /** |
| 1048 | 1048 | * Allow pure HTML settings row |
| 1049 | - * |
|
| 1050 | - * @since 2.0.6 |
|
| 1051 | - * |
|
| 1049 | + * |
|
| 1050 | + * @since 2.0.6 |
|
| 1051 | + * |
|
| 1052 | 1052 | * @param array $field |
| 1053 | 1053 | * @param bool $echo Whether to echo the |
| 1054 | 1054 | * |
@@ -1114,19 +1114,19 @@ discard block |
||
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | 1116 | /** |
| 1117 | - * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
| 1118 | - * |
|
| 1119 | - * Converts `$field['description']` to `$field['gv_description']` |
|
| 1120 | - * Converts `$field['subtitle']` to `$field['description']` |
|
| 1121 | - * |
|
| 1122 | - * @see \GV\Addon_Settings::single_setting_label Converts `gv_description` back to `description` |
|
| 1123 | - * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
| 1124 | - * |
|
| 1125 | - * @since 1.21.5.2 |
|
| 1126 | - * |
|
| 1117 | + * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
| 1118 | + * |
|
| 1119 | + * Converts `$field['description']` to `$field['gv_description']` |
|
| 1120 | + * Converts `$field['subtitle']` to `$field['description']` |
|
| 1121 | + * |
|
| 1122 | + * @see \GV\Addon_Settings::single_setting_label Converts `gv_description` back to `description` |
|
| 1123 | + * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
| 1124 | + * |
|
| 1125 | + * @since 1.21.5.2 |
|
| 1126 | + * |
|
| 1127 | 1127 | * @param array $field |
| 1128 | - * |
|
| 1129 | - * @return void |
|
| 1128 | + * |
|
| 1129 | + * @return void |
|
| 1130 | 1130 | */ |
| 1131 | 1131 | public function single_setting_row( $field ) { |
| 1132 | 1132 | $field['gv_description'] = Utils::get( $field, 'description' ); |