@@ -138,20 +138,20 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | - * Uninstall all traces of GravityView |
|
| 142 | - * |
|
| 143 | - * Note: method is public because parent method is public |
|
| 144 | - * |
|
| 141 | + * Uninstall all traces of GravityView |
|
| 142 | + * |
|
| 143 | + * Note: method is public because parent method is public |
|
| 144 | + * |
|
| 145 | 145 | * @return bool |
| 146 | 146 | */ |
| 147 | 147 | public function uninstall() { |
| 148 | 148 | gravityview()->plugin->uninstall(); |
| 149 | 149 | |
| 150 | 150 | /** |
| 151 | - * Set the path so that Gravity Forms can de-activate GravityView |
|
| 152 | - * @see GFAddOn::uninstall_addon |
|
| 153 | - * @uses deactivate_plugins() |
|
| 154 | - */ |
|
| 151 | + * Set the path so that Gravity Forms can de-activate GravityView |
|
| 152 | + * @see GFAddOn::uninstall_addon |
|
| 153 | + * @uses deactivate_plugins() |
|
| 154 | + */ |
|
| 155 | 155 | $this->_path = GRAVITYVIEW_FILE; |
| 156 | 156 | |
| 157 | 157 | return true; |
@@ -181,42 +181,42 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
| 184 | - * Get an array of reasons why the plugin might be uninstalled |
|
| 185 | - * |
|
| 186 | - * @since 1.17.5 |
|
| 187 | - * |
|
| 184 | + * Get an array of reasons why the plugin might be uninstalled |
|
| 185 | + * |
|
| 186 | + * @since 1.17.5 |
|
| 187 | + * |
|
| 188 | 188 | * @return array Array of reasons with the label and followup questions for each uninstall reason |
| 189 | 189 | */ |
| 190 | 190 | private function get_uninstall_reasons() { |
| 191 | 191 | $reasons = array( |
| 192 | 192 | 'will-continue' => array( |
| 193 | - 'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ), |
|
| 194 | - ), |
|
| 193 | + 'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ), |
|
| 194 | + ), |
|
| 195 | 195 | 'no-longer-need' => array( |
| 196 | - 'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ), |
|
| 197 | - ), |
|
| 196 | + 'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ), |
|
| 197 | + ), |
|
| 198 | 198 | 'doesnt-work' => array( |
| 199 | - 'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ), |
|
| 200 | - ), |
|
| 199 | + 'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ), |
|
| 200 | + ), |
|
| 201 | 201 | 'found-other' => array( |
| 202 | - 'label' => esc_html__( 'I found a better plugin', 'gravityview' ), |
|
| 203 | - 'followup' => esc_attr__( 'What plugin you are using, and why?', 'gravityview' ), |
|
| 204 | - ), |
|
| 202 | + 'label' => esc_html__( 'I found a better plugin', 'gravityview' ), |
|
| 203 | + 'followup' => esc_attr__( 'What plugin you are using, and why?', 'gravityview' ), |
|
| 204 | + ), |
|
| 205 | 205 | 'other' => array( |
| 206 | - 'label' => esc_html__( 'Other', 'gravityview' ), |
|
| 207 | - ), |
|
| 206 | + 'label' => esc_html__( 'Other', 'gravityview' ), |
|
| 207 | + ), |
|
| 208 | 208 | ); |
| 209 | 209 | |
| 210 | 210 | shuffle( $reasons ); |
| 211 | 211 | |
| 212 | 212 | return $reasons; |
| 213 | - } |
|
| 213 | + } |
|
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | - * Display a feedback form when the plugin is uninstalled |
|
| 217 | - * |
|
| 218 | - * @since 1.17.5 |
|
| 219 | - * |
|
| 216 | + * Display a feedback form when the plugin is uninstalled |
|
| 217 | + * |
|
| 218 | + * @since 1.17.5 |
|
| 219 | + * |
|
| 220 | 220 | * @return string HTML of the uninstallation form |
| 221 | 221 | */ |
| 222 | 222 | public function uninstall_form() { |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | <h2><?php esc_html_e( 'Why did you uninstall GravityView?', 'gravityview' ); ?></h2> |
| 297 | 297 | <ul> |
| 298 | 298 | <?php |
| 299 | - $reasons = $this->get_uninstall_reasons(); |
|
| 299 | + $reasons = $this->get_uninstall_reasons(); |
|
| 300 | 300 | foreach ( $reasons as $reason ) { |
| 301 | 301 | printf( '<li><label><input name="reason" type="radio" value="other" data-followup="%s"> %s</label></li>', Utils::get( $reason, 'followup' ), Utils::get( $reason, 'label' ) ); |
| 302 | 302 | } |
@@ -390,12 +390,12 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | public function app_settings_tab() { |
| 393 | - parent::app_settings_tab(); |
|
| 393 | + parent::app_settings_tab(); |
|
| 394 | 394 | |
| 395 | 395 | if ( $this->maybe_uninstall() ) { |
| 396 | - echo $this->uninstall_form(); |
|
| 396 | + echo $this->uninstall_form(); |
|
| 397 | 397 | } |
| 398 | - } |
|
| 398 | + } |
|
| 399 | 399 | |
| 400 | 400 | /** |
| 401 | 401 | * The Settings title |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | * @return array The settings. |
| 481 | 481 | */ |
| 482 | 482 | public function all() { |
| 483 | - return wp_parse_args( get_option( 'gravityformsaddon_' . $this->_slug . '_app_settings', array() ), $this->defaults() ); |
|
| 483 | + return wp_parse_args( get_option( 'gravityformsaddon_' . $this->_slug . '_app_settings', array() ), $this->defaults() ); |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /** |
@@ -549,8 +549,8 @@ discard block |
||
| 549 | 549 | type="' . $field['type'] . '" |
| 550 | 550 | name="' . esc_attr( $name ) . '" |
| 551 | 551 | value="' . $value . '" ' . |
| 552 | - implode( ' ', $attributes ) . |
|
| 553 | - ' />'; |
|
| 552 | + implode( ' ', $attributes ) . |
|
| 553 | + ' />'; |
|
| 554 | 554 | |
| 555 | 555 | if ( $echo ) { |
| 556 | 556 | echo $html; |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | $license_key = $this->get( 'license_key' ); |
| 578 | 578 | if( '' === $license_key ) { |
| 579 | 579 | $license_status = 'inactive'; |
| 580 | - } |
|
| 580 | + } |
|
| 581 | 581 | $license_id = empty( $license_key ) ? 'license' : $license_key; |
| 582 | 582 | |
| 583 | 583 | $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' ); |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | $update_below = false; |
| 593 | 593 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
| 594 | 594 | |
| 595 | - switch ( $license_status ) { |
|
| 595 | + switch ( $license_status ) { |
|
| 596 | 596 | /** @since 1.17 */ |
| 597 | 597 | case 'expired': |
| 598 | 598 | $title = __( 'Expired License', 'gravityview' ); |
@@ -648,12 +648,12 @@ discard block |
||
| 648 | 648 | } |
| 649 | 649 | |
| 650 | 650 | /** |
| 651 | - * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
| 652 | - * |
|
| 653 | - * @since 1.21.5 |
|
| 654 | - * |
|
| 655 | - * @see GFAddOn::scripts() |
|
| 656 | - * |
|
| 651 | + * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
| 652 | + * |
|
| 653 | + * @since 1.21.5 |
|
| 654 | + * |
|
| 655 | + * @see GFAddOn::scripts() |
|
| 656 | + * |
|
| 657 | 657 | * @return array Array of scripts |
| 658 | 658 | */ |
| 659 | 659 | public function scripts() { |
@@ -662,10 +662,10 @@ discard block |
||
| 662 | 662 | $scripts[] = array( |
| 663 | 663 | 'handle' => 'gform_tooltip_init', |
| 664 | 664 | 'enqueue' => array( |
| 665 | - array( |
|
| 666 | - 'admin_page' => array( 'app_settings' ) |
|
| 667 | - ) |
|
| 668 | - ) |
|
| 665 | + array( |
|
| 666 | + 'admin_page' => array( 'app_settings' ) |
|
| 667 | + ) |
|
| 668 | + ) |
|
| 669 | 669 | ); |
| 670 | 670 | |
| 671 | 671 | return $scripts; |
@@ -683,10 +683,10 @@ discard block |
||
| 683 | 683 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
| 684 | 684 | 'version' => Plugin::$version, |
| 685 | 685 | 'deps' => array( |
| 686 | - 'gform_admin', |
|
| 686 | + 'gform_admin', |
|
| 687 | 687 | 'gaddon_form_settings_css', |
| 688 | - 'gform_tooltip', |
|
| 689 | - 'gform_font_awesome', |
|
| 688 | + 'gform_tooltip', |
|
| 689 | + 'gform_font_awesome', |
|
| 690 | 690 | ), |
| 691 | 691 | 'enqueue' => array( |
| 692 | 692 | array( 'admin_page' => array( |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | array( |
| 855 | 855 | 'label' => _x( 'Show me beta versions if they are available.', 'gravityview' ), |
| 856 | 856 | 'value' => '1', |
| 857 | - 'name' => 'beta', |
|
| 857 | + 'name' => 'beta', |
|
| 858 | 858 | ), |
| 859 | 859 | ), |
| 860 | 860 | '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' ), |
@@ -892,38 +892,38 @@ discard block |
||
| 892 | 892 | |
| 893 | 893 | if ( empty( $field['disabled'] ) ) { |
| 894 | 894 | unset( $field['disabled'] ); |
| 895 | - } |
|
| 895 | + } |
|
| 896 | 896 | } |
| 897 | 897 | |
| 898 | - $sections = array( |
|
| 899 | - array( |
|
| 900 | - 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), Plugin::$version ) ), |
|
| 901 | - 'fields' => $fields, |
|
| 902 | - ) |
|
| 903 | - ); |
|
| 898 | + $sections = array( |
|
| 899 | + array( |
|
| 900 | + 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), Plugin::$version ) ), |
|
| 901 | + 'fields' => $fields, |
|
| 902 | + ) |
|
| 903 | + ); |
|
| 904 | 904 | |
| 905 | - // custom 'update settings' button |
|
| 906 | - $button = array( |
|
| 907 | - 'class' => 'button button-primary button-hero', |
|
| 908 | - 'type' => 'save', |
|
| 909 | - ); |
|
| 905 | + // custom 'update settings' button |
|
| 906 | + $button = array( |
|
| 907 | + 'class' => 'button button-primary button-hero', |
|
| 908 | + 'type' => 'save', |
|
| 909 | + ); |
|
| 910 | 910 | |
| 911 | 911 | if ( $disabled_attribute ) { |
| 912 | 912 | $button['disabled'] = $disabled_attribute; |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | - /** |
|
| 916 | - * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
| 917 | - * Extensions can tap in here to insert their own section and settings. |
|
| 918 | - * <code> |
|
| 919 | - * $sections[] = array( |
|
| 920 | - * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
| 921 | - * 'fields' => $settings, |
|
| 922 | - * ); |
|
| 923 | - * </code> |
|
| 924 | - * @param array $extension_settings Empty array, ready for extension settings! |
|
| 925 | - */ |
|
| 926 | - $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
| 915 | + /** |
|
| 916 | + * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
| 917 | + * Extensions can tap in here to insert their own section and settings. |
|
| 918 | + * <code> |
|
| 919 | + * $sections[] = array( |
|
| 920 | + * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
| 921 | + * 'fields' => $settings, |
|
| 922 | + * ); |
|
| 923 | + * </code> |
|
| 924 | + * @param array $extension_settings Empty array, ready for extension settings! |
|
| 925 | + */ |
|
| 926 | + $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
| 927 | 927 | |
| 928 | 928 | // If there are extensions, add a section for them |
| 929 | 929 | if ( ! empty( $extension_sections ) ) { |
@@ -936,13 +936,13 @@ discard block |
||
| 936 | 936 | } |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | - $k = count( $extension_sections ) - 1 ; |
|
| 940 | - $extension_sections[ $k ]['fields'][] = $button; |
|
| 939 | + $k = count( $extension_sections ) - 1 ; |
|
| 940 | + $extension_sections[ $k ]['fields'][] = $button; |
|
| 941 | 941 | $sections = array_merge( $sections, $extension_sections ); |
| 942 | 942 | } else { |
| 943 | - // add the 'update settings' button to the general section |
|
| 944 | - $sections[0]['fields'][] = $button; |
|
| 945 | - } |
|
| 943 | + // add the 'update settings' button to the general section |
|
| 944 | + $sections[0]['fields'][] = $button; |
|
| 945 | + } |
|
| 946 | 946 | |
| 947 | 947 | return $sections; |
| 948 | 948 | } |
@@ -996,9 +996,9 @@ discard block |
||
| 996 | 996 | */ |
| 997 | 997 | protected function settings_edd_license( $field, $echo = true ) { |
| 998 | 998 | |
| 999 | - if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
|
| 1000 | - $field['input_type'] = 'password'; |
|
| 1001 | - } |
|
| 999 | + if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
|
| 1000 | + $field['input_type'] = 'password'; |
|
| 1001 | + } |
|
| 1002 | 1002 | |
| 1003 | 1003 | $text = $this->settings_text( $field, false ); |
| 1004 | 1004 | |
@@ -1015,9 +1015,9 @@ discard block |
||
| 1015 | 1015 | |
| 1016 | 1016 | /** |
| 1017 | 1017 | * Allow pure HTML settings row |
| 1018 | - * |
|
| 1019 | - * @since 2.0.6 |
|
| 1020 | - * |
|
| 1018 | + * |
|
| 1019 | + * @since 2.0.6 |
|
| 1020 | + * |
|
| 1021 | 1021 | * @param array $field |
| 1022 | 1022 | * @param bool $echo Whether to echo the |
| 1023 | 1023 | * |
@@ -1083,19 +1083,19 @@ discard block |
||
| 1083 | 1083 | } |
| 1084 | 1084 | |
| 1085 | 1085 | /** |
| 1086 | - * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
| 1087 | - * |
|
| 1088 | - * Converts `$field['description']` to `$field['gv_description']` |
|
| 1089 | - * Converts `$field['subtitle']` to `$field['description']` |
|
| 1090 | - * |
|
| 1091 | - * @see \GV\Addon_Settings::single_setting_label Converts `gv_description` back to `description` |
|
| 1092 | - * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
| 1093 | - * |
|
| 1094 | - * @since 1.21.5.2 |
|
| 1095 | - * |
|
| 1086 | + * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
| 1087 | + * |
|
| 1088 | + * Converts `$field['description']` to `$field['gv_description']` |
|
| 1089 | + * Converts `$field['subtitle']` to `$field['description']` |
|
| 1090 | + * |
|
| 1091 | + * @see \GV\Addon_Settings::single_setting_label Converts `gv_description` back to `description` |
|
| 1092 | + * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
| 1093 | + * |
|
| 1094 | + * @since 1.21.5.2 |
|
| 1095 | + * |
|
| 1096 | 1096 | * @param array $field |
| 1097 | - * |
|
| 1098 | - * @return void |
|
| 1097 | + * |
|
| 1098 | + * @return void |
|
| 1099 | 1099 | */ |
| 1100 | 1100 | public function single_setting_row( $field ) { |
| 1101 | 1101 | $field['gv_description'] = Utils::get( $field, 'description' ); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @return array |
| 102 | 102 | */ |
| 103 | 103 | public function modify_app_settings_menu_title( $setting_tabs ) { |
| 104 | - $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' ); |
|
| 104 | + $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
| 105 | 105 | return $setting_tabs; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -304,15 +304,15 @@ discard block |
||
| 304 | 304 | </ul> |
| 305 | 305 | <div class="gv-followup widefat"> |
| 306 | 306 | <p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p> |
| 307 | - <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> |
|
| 307 | + <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> |
|
| 308 | 308 | </div> |
| 309 | 309 | <div class="scale-description"> |
| 310 | 310 | <p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p> |
| 311 | 311 | <ul class="inline"> |
| 312 | 312 | <?php |
| 313 | 313 | $i = 0; |
| 314 | - while( $i < 11 ) { |
|
| 315 | - echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>'; |
|
| 314 | + while ( $i < 11 ) { |
|
| 315 | + echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>'; |
|
| 316 | 316 | $i++; |
| 317 | 317 | } |
| 318 | 318 | ?> |
@@ -529,15 +529,15 @@ discard block |
||
| 529 | 529 | * @return string The HTML |
| 530 | 530 | */ |
| 531 | 531 | public function as_html( $field, $echo = true ) { |
| 532 | - $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit','reset','button' ) ) ) ? $field['type'] : 'submit'; |
|
| 532 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
| 533 | 533 | |
| 534 | 534 | $attributes = $this->get_field_attributes( $field ); |
| 535 | 535 | $default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
| 536 | - $value = $this->get( $field['name'], $default_value ); |
|
| 536 | + $value = $this->get( $field[ 'name' ], $default_value ); |
|
| 537 | 537 | |
| 538 | 538 | |
| 539 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton'; |
|
| 540 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
| 539 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton'; |
|
| 540 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
| 541 | 541 | |
| 542 | 542 | if ( empty( $value ) ) { |
| 543 | 543 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $attributes = $this->get_field_attributes( $field ); |
| 547 | 547 | |
| 548 | 548 | $html = '<input |
| 549 | - type="' . $field['type'] . '" |
|
| 549 | + type="' . $field[ 'type' ] . '" |
|
| 550 | 550 | name="' . esc_attr( $name ) . '" |
| 551 | 551 | value="' . $value . '" ' . |
| 552 | 552 | implode( ' ', $attributes ) . |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | public function license_key_notice() { |
| 576 | 576 | $license_status = $this->get( 'license_key_status' ); |
| 577 | 577 | $license_key = $this->get( 'license_key' ); |
| 578 | - if( '' === $license_key ) { |
|
| 578 | + if ( '' === $license_key ) { |
|
| 579 | 579 | $license_status = 'inactive'; |
| 580 | 580 | } |
| 581 | 581 | $license_id = empty( $license_key ) ? 'license' : $license_key; |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | * but didn't want to mess up the translation strings for the translators. |
| 588 | 588 | */ |
| 589 | 589 | $message = mb_substr( $message, 0, mb_strlen( $message ) - 1 ); |
| 590 | - $title = __ ( 'Inactive License', 'gravityview'); |
|
| 590 | + $title = __( 'Inactive License', 'gravityview' ); |
|
| 591 | 591 | $status = ''; |
| 592 | 592 | $update_below = false; |
| 593 | 593 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $update_below = __( 'Activate your license key below.', 'gravityview' ); |
| 618 | 618 | break; |
| 619 | 619 | } |
| 620 | - $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice'; |
|
| 620 | + $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice'; |
|
| 621 | 621 | |
| 622 | 622 | // Show a different notice on settings page for inactive licenses (hide the buttons) |
| 623 | 623 | if ( $update_below && gravityview_is_admin_page( '', 'settings' ) ) { |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | public function scripts() { |
| 660 | 660 | $scripts = parent::scripts(); |
| 661 | 661 | |
| 662 | - $scripts[] = array( |
|
| 662 | + $scripts[ ] = array( |
|
| 663 | 663 | 'handle' => 'gform_tooltip_init', |
| 664 | 664 | 'enqueue' => array( |
| 665 | 665 | array( |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | public function styles() { |
| 679 | 679 | $styles = parent::styles(); |
| 680 | 680 | |
| 681 | - $styles[] = array( |
|
| 681 | + $styles[ ] = array( |
|
| 682 | 682 | 'handle' => 'gravityview_settings', |
| 683 | 683 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
| 684 | 684 | 'version' => Plugin::$version, |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | * If multisite and not network admin, we don't want the settings to show. |
| 710 | 710 | * @since 1.7.6 |
| 711 | 711 | */ |
| 712 | - $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
| 712 | + $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
| 713 | 713 | |
| 714 | 714 | /** |
| 715 | 715 | * Override whether to show the Settings menu on a per-blog basis. |
@@ -757,26 +757,26 @@ discard block |
||
| 757 | 757 | 'label' => __( 'License Key', 'gravityview' ), |
| 758 | 758 | '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' ) ), |
| 759 | 759 | 'type' => 'edd_license', |
| 760 | - 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
| 760 | + 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
| 761 | 761 | 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
| 762 | - 'default_value' => $default_settings['license_key'], |
|
| 762 | + 'default_value' => $default_settings[ 'license_key' ], |
|
| 763 | 763 | 'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
| 764 | 764 | ), |
| 765 | 765 | array( |
| 766 | 766 | 'name' => 'license_key_response', |
| 767 | - 'default_value' => $default_settings['license_key_response'], |
|
| 767 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
| 768 | 768 | 'type' => 'hidden', |
| 769 | 769 | ), |
| 770 | 770 | array( |
| 771 | 771 | 'name' => 'license_key_status', |
| 772 | - 'default_value' => $default_settings['license_key_status'], |
|
| 772 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
| 773 | 773 | 'type' => 'hidden', |
| 774 | 774 | ), |
| 775 | 775 | array( |
| 776 | 776 | 'name' => 'support-email', |
| 777 | 777 | 'type' => 'text', |
| 778 | 778 | 'validate' => 'email', |
| 779 | - 'default_value' => $default_settings['support-email'], |
|
| 779 | + 'default_value' => $default_settings[ 'support-email' ], |
|
| 780 | 780 | 'label' => __( 'Support Email', 'gravityview' ), |
| 781 | 781 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
| 782 | 782 | 'class' => 'code regular-text', |
@@ -788,7 +788,7 @@ discard block |
||
| 788 | 788 | 'name' => 'support_port', |
| 789 | 789 | 'type' => 'radio', |
| 790 | 790 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
| 791 | - 'default_value' => $default_settings['support_port'], |
|
| 791 | + 'default_value' => $default_settings[ 'support_port' ], |
|
| 792 | 792 | 'horizontal' => 1, |
| 793 | 793 | 'choices' => array( |
| 794 | 794 | array( |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | 'name' => 'no-conflict-mode', |
| 808 | 808 | 'type' => 'radio', |
| 809 | 809 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
| 810 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
| 810 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
| 811 | 811 | 'horizontal' => 1, |
| 812 | 812 | 'choices' => array( |
| 813 | 813 | array( |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | 'name' => 'rest_api', |
| 830 | 830 | 'type' => 'radio', |
| 831 | 831 | 'label' => __( 'REST API', 'gravityview' ), |
| 832 | - 'default_value' => $default_settings['rest_api'], |
|
| 832 | + 'default_value' => $default_settings[ 'rest_api' ], |
|
| 833 | 833 | 'horizontal' => 1, |
| 834 | 834 | 'choices' => array( |
| 835 | 835 | array( |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | 'name' => 'beta', |
| 849 | 849 | 'type' => 'checkbox', |
| 850 | 850 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
| 851 | - 'default_value' => $default_settings['beta'], |
|
| 851 | + 'default_value' => $default_settings[ 'beta' ], |
|
| 852 | 852 | 'horizontal' => 1, |
| 853 | 853 | 'choices' => array( |
| 854 | 854 | array( |
@@ -881,17 +881,17 @@ discard block |
||
| 881 | 881 | * @since 1.7.4 |
| 882 | 882 | */ |
| 883 | 883 | foreach ( $fields as &$field ) { |
| 884 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
| 885 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
| 886 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
| 887 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
| 884 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
| 885 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
| 886 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
| 887 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
| 888 | 888 | |
| 889 | 889 | if ( $disabled_attribute ) { |
| 890 | - $field['disabled'] = $disabled_attribute; |
|
| 890 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 891 | 891 | } |
| 892 | 892 | |
| 893 | - if ( empty( $field['disabled'] ) ) { |
|
| 894 | - unset( $field['disabled'] ); |
|
| 893 | + if ( empty( $field[ 'disabled' ] ) ) { |
|
| 894 | + unset( $field[ 'disabled' ] ); |
|
| 895 | 895 | } |
| 896 | 896 | } |
| 897 | 897 | |
@@ -909,7 +909,7 @@ discard block |
||
| 909 | 909 | ); |
| 910 | 910 | |
| 911 | 911 | if ( $disabled_attribute ) { |
| 912 | - $button['disabled'] = $disabled_attribute; |
|
| 912 | + $button[ 'disabled' ] = $disabled_attribute; |
|
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | /** |
@@ -928,20 +928,20 @@ discard block |
||
| 928 | 928 | // If there are extensions, add a section for them |
| 929 | 929 | if ( ! empty( $extension_sections ) ) { |
| 930 | 930 | |
| 931 | - if( $disabled_attribute ) { |
|
| 931 | + if ( $disabled_attribute ) { |
|
| 932 | 932 | foreach ( $extension_sections as &$section ) { |
| 933 | - foreach ( $section['fields'] as &$field ) { |
|
| 934 | - $field['disabled'] = $disabled_attribute; |
|
| 933 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
| 934 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 935 | 935 | } |
| 936 | 936 | } |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | - $k = count( $extension_sections ) - 1 ; |
|
| 940 | - $extension_sections[ $k ]['fields'][] = $button; |
|
| 939 | + $k = count( $extension_sections ) - 1; |
|
| 940 | + $extension_sections[ $k ][ 'fields' ][ ] = $button; |
|
| 941 | 941 | $sections = array_merge( $sections, $extension_sections ); |
| 942 | 942 | } else { |
| 943 | 943 | // add the 'update settings' button to the general section |
| 944 | - $sections[0]['fields'][] = $button; |
|
| 944 | + $sections[ 0 ][ 'fields' ][ ] = $button; |
|
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | return $sections; |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | protected function settings_edd_license( $field, $echo = true ) { |
| 998 | 998 | |
| 999 | 999 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
| 1000 | - $field['input_type'] = 'password'; |
|
| 1000 | + $field[ 'input_type' ] = 'password'; |
|
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | 1003 | $text = $this->settings_text( $field, false ); |
@@ -1046,7 +1046,7 @@ discard block |
||
| 1046 | 1046 | public function single_setting_row_html( $field ) { |
| 1047 | 1047 | ?> |
| 1048 | 1048 | |
| 1049 | - <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>"> |
|
| 1049 | + <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>"> |
|
| 1050 | 1050 | <td colspan="2"> |
| 1051 | 1051 | <?php $this->single_setting( $field ); ?> |
| 1052 | 1052 | </td> |
@@ -1064,10 +1064,10 @@ discard block |
||
| 1064 | 1064 | * @return string |
| 1065 | 1065 | */ |
| 1066 | 1066 | public function settings_save( $field, $echo = true ) { |
| 1067 | - $field['type'] = 'submit'; |
|
| 1068 | - $field['name'] = 'gform-settings-save'; |
|
| 1069 | - $field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton'; |
|
| 1070 | - $field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 1067 | + $field[ 'type' ] = 'submit'; |
|
| 1068 | + $field[ 'name' ] = 'gform-settings-save'; |
|
| 1069 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton'; |
|
| 1070 | + $field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 1071 | 1071 | |
| 1072 | 1072 | $output = $this->settings_submit( $field, false ); |
| 1073 | 1073 | |
@@ -1098,8 +1098,8 @@ discard block |
||
| 1098 | 1098 | * @return void |
| 1099 | 1099 | */ |
| 1100 | 1100 | public function single_setting_row( $field ) { |
| 1101 | - $field['gv_description'] = Utils::get( $field, 'description' ); |
|
| 1102 | - $field['description'] = Utils::get( $field, 'subtitle' ); |
|
| 1101 | + $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
| 1102 | + $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
| 1103 | 1103 | parent::single_setting_row( $field ); |
| 1104 | 1104 | } |
| 1105 | 1105 | |
@@ -1111,7 +1111,7 @@ discard block |
||
| 1111 | 1111 | public function single_setting_label( $field ) { |
| 1112 | 1112 | parent::single_setting_label( $field ); |
| 1113 | 1113 | if ( $description = Utils::get( $field, 'gv_description' ) ) { |
| 1114 | - echo '<span class="description">'. $description .'</span>'; |
|
| 1114 | + echo '<span class="description">' . $description . '</span>'; |
|
| 1115 | 1115 | } |
| 1116 | 1116 | } |
| 1117 | 1117 | |
@@ -1148,9 +1148,9 @@ discard block |
||
| 1148 | 1148 | // If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response), |
| 1149 | 1149 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
| 1150 | 1150 | if ( $local_key !== $response_key ) { |
| 1151 | - unset( $posted_settings['license_key_response'] ); |
|
| 1152 | - unset( $posted_settings['license_key_status'] ); |
|
| 1153 | - \GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
| 1151 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
| 1152 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
| 1153 | + \GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
| 1154 | 1154 | } |
| 1155 | 1155 | return $posted_settings; |
| 1156 | 1156 | } |