@@ -49,7 +49,7 @@ |
||
| 49 | 49 | * |
| 50 | 50 | * @param array $items Scripts or styles to exclude from no-conflict |
| 51 | 51 | * |
| 52 | - * @return array |
|
| 52 | + * @return string[] |
|
| 53 | 53 | */ |
| 54 | 54 | public function register_noconflict( $items ) { |
| 55 | 55 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function add_admin_menu() { |
| 97 | 97 | |
| 98 | - $menu_text = _x( 'Extensions', 'Extensions are WordPress plugins that add functionality to GravityView and Gravity Forms', 'gravityview' ); |
|
| 98 | + $menu_text = _x( 'Extensions', 'Extensions are WordPress plugins that add functionality to GravityView and Gravity Forms', 'gravityview' ); |
|
| 99 | 99 | |
| 100 | 100 | $menu_text = sprintf( '<span title="%s">%s</span>', esc_attr__( 'Plugins that extend GravityView and Gravity Forms functionality.', 'gravityview' ), $menu_text ); |
| 101 | 101 | |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | - * When on the Installer page, show a different notice than on the Settings page |
|
| 114 | - * |
|
| 113 | + * When on the Installer page, show a different notice than on the Settings page |
|
| 114 | + * |
|
| 115 | 115 | * @param array $notice |
| 116 | 116 | * |
| 117 | 117 | * @return string License notice |
@@ -119,10 +119,10 @@ discard block |
||
| 119 | 119 | public function maybe_modify_license_notice( $notice = '' ) { |
| 120 | 120 | |
| 121 | 121 | if ( ! gravityview()->request->is_admin( '', 'downloads' ) ) { |
| 122 | - return $notice; |
|
| 123 | - } |
|
| 122 | + return $notice; |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | - return esc_html__( 'Your license %s. Do you want access to these plugins? %sActivate your license%s or %sget a license here%s.', 'gravityview' ); |
|
| 125 | + return esc_html__( 'Your license %s. Do you want access to these plugins? %sActivate your license%s or %sget a license here%s.', 'gravityview' ); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -160,43 +160,43 @@ discard block |
||
| 160 | 160 | * Get downloads data from transient or from API; save transient after getting data from API |
| 161 | 161 | * |
| 162 | 162 | * @return WP_Error|array If error, returns WP_Error. If not valid JSON, empty array. Otherwise, this structure: { |
| 163 | - * @type array $info { |
|
| 164 | - * @type string $id int 17 |
|
| 165 | - * @type string $slug Extension slug |
|
| 166 | - * @type string $title Extension title |
|
| 167 | - * @type string $create_date in '2018-07-19 20:03:10' format |
|
| 168 | - * @type string $modified_date |
|
| 169 | - * @type string $status |
|
| 170 | - * @type string $link URL to public plugin page |
|
| 171 | - * @type string $content |
|
| 172 | - * @type string $excerpt |
|
| 173 | - * @type string $thumbnail URL to thumbnail |
|
| 174 | - * @type array $category Taxonomy details for the plugin's category { |
|
| 175 | - * @type int $term_id => int 30 |
|
| 176 | - * @type string $name => string 'Plugins' (length=7) |
|
| 177 | - * @type string $slug => string 'plugins' (length=7) |
|
| 178 | - * @type int $term_group => int 0 |
|
| 179 | - * @type int $term_taxonomy_id => int 30 |
|
| 180 | - * @type string $taxonomy => string 'download_category' (length=17) |
|
| 181 | - * @type string $description => string '' (length=0) |
|
| 182 | - * @type int $parent => int 0 |
|
| 183 | - * @type int $count => int 4 |
|
| 184 | - * @type string $filter => string 'raw' (length=3) |
|
| 185 | - * } |
|
| 186 | - * @type array $tags {see $category above} |
|
| 187 | - * @type string $textdomain string 'gravityview' (length=11) |
|
| 188 | - * } |
|
| 189 | - * @type array $pricing array of `price_name_slugs` => '00.00' values, if price options exist |
|
| 190 | - * @type array $licensing { |
|
| 191 | - * @type bool $enabled Is licensing enabled for the extension |
|
| 192 | - * @type string $version Version number |
|
| 193 | - * @type string $exp_unit Expiration unit ('years') |
|
| 194 | - * @type string $exp_length Expiration length ('1') |
|
| 195 | - * } |
|
| 196 | - * @type array $files Array of files. Empty if user has no access to the file. { |
|
| 197 | - * @type string $file string URL of the file download |
|
| 198 | - * } |
|
| 199 | - * } |
|
| 163 | + * @type array $info { |
|
| 164 | + * @type string $id int 17 |
|
| 165 | + * @type string $slug Extension slug |
|
| 166 | + * @type string $title Extension title |
|
| 167 | + * @type string $create_date in '2018-07-19 20:03:10' format |
|
| 168 | + * @type string $modified_date |
|
| 169 | + * @type string $status |
|
| 170 | + * @type string $link URL to public plugin page |
|
| 171 | + * @type string $content |
|
| 172 | + * @type string $excerpt |
|
| 173 | + * @type string $thumbnail URL to thumbnail |
|
| 174 | + * @type array $category Taxonomy details for the plugin's category { |
|
| 175 | + * @type int $term_id => int 30 |
|
| 176 | + * @type string $name => string 'Plugins' (length=7) |
|
| 177 | + * @type string $slug => string 'plugins' (length=7) |
|
| 178 | + * @type int $term_group => int 0 |
|
| 179 | + * @type int $term_taxonomy_id => int 30 |
|
| 180 | + * @type string $taxonomy => string 'download_category' (length=17) |
|
| 181 | + * @type string $description => string '' (length=0) |
|
| 182 | + * @type int $parent => int 0 |
|
| 183 | + * @type int $count => int 4 |
|
| 184 | + * @type string $filter => string 'raw' (length=3) |
|
| 185 | + * } |
|
| 186 | + * @type array $tags {see $category above} |
|
| 187 | + * @type string $textdomain string 'gravityview' (length=11) |
|
| 188 | + * } |
|
| 189 | + * @type array $pricing array of `price_name_slugs` => '00.00' values, if price options exist |
|
| 190 | + * @type array $licensing { |
|
| 191 | + * @type bool $enabled Is licensing enabled for the extension |
|
| 192 | + * @type string $version Version number |
|
| 193 | + * @type string $exp_unit Expiration unit ('years') |
|
| 194 | + * @type string $exp_length Expiration length ('1') |
|
| 195 | + * } |
|
| 196 | + * @type array $files Array of files. Empty if user has no access to the file. { |
|
| 197 | + * @type string $file string URL of the file download |
|
| 198 | + * } |
|
| 199 | + * } |
|
| 200 | 200 | */ |
| 201 | 201 | public function get_downloads_data() { |
| 202 | 202 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | ) ); |
| 225 | 225 | |
| 226 | 226 | if ( is_wp_error( $response ) ) { |
| 227 | - gravityview()->log->error( "Extension data response is an error", array( 'data' => $response ) ); |
|
| 227 | + gravityview()->log->error( "Extension data response is an error", array( 'data' => $response ) ); |
|
| 228 | 228 | return $response; |
| 229 | 229 | } |
| 230 | 230 | |
@@ -277,10 +277,10 @@ discard block |
||
| 277 | 277 | <div class="gv-admin-installer-notice notice inline error"> |
| 278 | 278 | <h3><?php esc_html_e( 'Extensions and plugins data cannot be loaded at the moment. Please try again later.', 'gravityview' ); ?></h3> |
| 279 | 279 | <?php |
| 280 | - if ( is_wp_error( $downloads_data ) ) { |
|
| 281 | - echo wpautop( '<pre>' . esc_html( $downloads_data->get_error_message() ) . '</pre>' ); |
|
| 282 | - } |
|
| 283 | - ?> |
|
| 280 | + if ( is_wp_error( $downloads_data ) ) { |
|
| 281 | + echo wpautop( '<pre>' . esc_html( $downloads_data->get_error_message() ) . '</pre>' ); |
|
| 282 | + } |
|
| 283 | + ?> |
|
| 284 | 284 | </div> |
| 285 | 285 | </div> |
| 286 | 286 | <?php |
@@ -336,9 +336,9 @@ discard block |
||
| 336 | 336 | protected function render_download( $download, $wp_plugins ) { |
| 337 | 337 | |
| 338 | 338 | |
| 339 | - $details = $this->get_download_display_details( $download, $wp_plugins ); |
|
| 339 | + $details = $this->get_download_display_details( $download, $wp_plugins ); |
|
| 340 | 340 | |
| 341 | - $download_info = $details['download_info']; |
|
| 341 | + $download_info = $details['download_info']; |
|
| 342 | 342 | |
| 343 | 343 | ?> |
| 344 | 344 | <div class="item <?php echo esc_attr( $details['item_class'] ); ?>"> |
@@ -367,25 +367,25 @@ discard block |
||
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | /** |
| 370 | - * Generates details array for the download to keep the render_download() method a bit tidier |
|
| 371 | - * |
|
| 370 | + * Generates details array for the download to keep the render_download() method a bit tidier |
|
| 371 | + * |
|
| 372 | 372 | * @param array $download Single download, as returned by {@see get_downloads_data} |
| 373 | 373 | * @param array $wp_plugins All active plugins, as returned by {@see get_plugins()} |
| 374 | 374 | * |
| 375 | 375 | * @return array { |
| 376 | - * @type array $download_info |
|
| 377 | - * @type string $plugin_path |
|
| 378 | - * @type string $status License status returned by Easy Digital Downloads ("active", "inactive", "expired", "revoked", etc) |
|
| 379 | - * @type string $status_label |
|
| 380 | - * @type string $button_title Title attribute to show when hovering over the download's button |
|
| 381 | - * @type string $button_class CSS class to use for the button |
|
| 382 | - * @type string $button_label Text to use for the download's anchor link |
|
| 383 | - * @type string $href URL for the download's button |
|
| 384 | - * @type bool $spinner Whether to show the spinner icon |
|
| 385 | - * @type string $item_class CSS class for the download container |
|
| 386 | - * @type string $required_license The name of the required license for the download ("Galactic" or "Interstellar") |
|
| 387 | - * @type bool $is_active Is the current GravityView license (as entered in Settings) active? |
|
| 388 | - * } |
|
| 376 | + * @type array $download_info |
|
| 377 | + * @type string $plugin_path |
|
| 378 | + * @type string $status License status returned by Easy Digital Downloads ("active", "inactive", "expired", "revoked", etc) |
|
| 379 | + * @type string $status_label |
|
| 380 | + * @type string $button_title Title attribute to show when hovering over the download's button |
|
| 381 | + * @type string $button_class CSS class to use for the button |
|
| 382 | + * @type string $button_label Text to use for the download's anchor link |
|
| 383 | + * @type string $href URL for the download's button |
|
| 384 | + * @type bool $spinner Whether to show the spinner icon |
|
| 385 | + * @type string $item_class CSS class for the download container |
|
| 386 | + * @type string $required_license The name of the required license for the download ("Galactic" or "Interstellar") |
|
| 387 | + * @type bool $is_active Is the current GravityView license (as entered in Settings) active? |
|
| 388 | + * } |
|
| 389 | 389 | */ |
| 390 | 390 | private function get_download_display_details( $download, $wp_plugins ) { |
| 391 | 391 | |
@@ -474,18 +474,18 @@ discard block |
||
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | return compact( 'download_info','plugin_path', 'status', 'status_label', 'button_title', 'button_class', 'button_label', 'href', 'spinner', 'item_class', 'required_license', 'is_active' ); |
| 477 | - } |
|
| 477 | + } |
|
| 478 | 478 | |
| 479 | 479 | /** |
| 480 | - * Returns the base price for an extension |
|
| 481 | - * |
|
| 480 | + * Returns the base price for an extension |
|
| 481 | + * |
|
| 482 | 482 | * @param array $download |
| 483 | 483 | * |
| 484 | 484 | * @return float Base price for an extension. If not for sale separately, returns 0 |
| 485 | 485 | */ |
| 486 | 486 | private function get_download_base_price( $download ) { |
| 487 | 487 | |
| 488 | - $base_price = \GV\Utils::get( $download, 'pricing/amount', 0 ); |
|
| 488 | + $base_price = \GV\Utils::get( $download, 'pricing/amount', 0 ); |
|
| 489 | 489 | $base_price = \GFCommon::to_number( $base_price ); |
| 490 | 490 | |
| 491 | 491 | unset( $download['pricing']['amount'] ); |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | return floatval( $base_price ); |
| 499 | - } |
|
| 499 | + } |
|
| 500 | 500 | |
| 501 | 501 | /** |
| 502 | 502 | * Handle AJAX request to activate extension |
@@ -514,8 +514,8 @@ discard block |
||
| 514 | 514 | |
| 515 | 515 | if ( is_wp_error( $result ) || ! is_plugin_active( $data['path'] ) ) { |
| 516 | 516 | wp_send_json_error( array( |
| 517 | - 'error' => sprintf( __( 'Plugin activation failed: %s', 'gravityview' ), $result->get_error_message() ) |
|
| 518 | - ) ); |
|
| 517 | + 'error' => sprintf( __( 'Plugin activation failed: %s', 'gravityview' ), $result->get_error_message() ) |
|
| 518 | + ) ); |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | wp_send_json_success(); |
@@ -536,10 +536,10 @@ discard block |
||
| 536 | 536 | deactivate_plugins( $data['path'] ); |
| 537 | 537 | |
| 538 | 538 | if( is_plugin_active( $data['path'] ) ) { |
| 539 | - wp_send_json_error( array( |
|
| 540 | - 'error' => sprintf( __( 'Plugin deactivation failed.', 'gravityview' ) ) |
|
| 541 | - ) ); |
|
| 542 | - } |
|
| 539 | + wp_send_json_error( array( |
|
| 540 | + 'error' => sprintf( __( 'Plugin deactivation failed.', 'gravityview' ) ) |
|
| 541 | + ) ); |
|
| 542 | + } |
|
| 543 | 543 | |
| 544 | 544 | wp_send_json_success(); |
| 545 | 545 | } |
@@ -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 |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | * @return array The settings. |
| 485 | 485 | */ |
| 486 | 486 | public function all() { |
| 487 | - return wp_parse_args( get_option( 'gravityformsaddon_' . $this->_slug . '_app_settings', array() ), $this->defaults() ); |
|
| 487 | + return wp_parse_args( get_option( 'gravityformsaddon_' . $this->_slug . '_app_settings', array() ), $this->defaults() ); |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | /** |
@@ -553,8 +553,8 @@ discard block |
||
| 553 | 553 | type="' . $field['type'] . '" |
| 554 | 554 | name="' . esc_attr( $name ) . '" |
| 555 | 555 | value="' . $value . '" ' . |
| 556 | - implode( ' ', $attributes ) . |
|
| 557 | - ' />'; |
|
| 556 | + implode( ' ', $attributes ) . |
|
| 557 | + ' />'; |
|
| 558 | 558 | |
| 559 | 559 | if ( $echo ) { |
| 560 | 560 | echo $html; |
@@ -572,12 +572,12 @@ discard block |
||
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | /** |
| 575 | - * Check whether GravityView is being saved |
|
| 576 | - * |
|
| 577 | - * The generic is_save_postback() is true for all addons |
|
| 578 | - * |
|
| 579 | - * @since 2.0.8 |
|
| 580 | - * |
|
| 575 | + * Check whether GravityView is being saved |
|
| 576 | + * |
|
| 577 | + * The generic is_save_postback() is true for all addons |
|
| 578 | + * |
|
| 579 | + * @since 2.0.8 |
|
| 580 | + * |
|
| 581 | 581 | * @return bool |
| 582 | 582 | */ |
| 583 | 583 | public function is_save_postback() { |
@@ -591,16 +591,16 @@ discard block |
||
| 591 | 591 | */ |
| 592 | 592 | public function license_key_notice() { |
| 593 | 593 | |
| 594 | - if( $this->is_save_postback() ) { |
|
| 595 | - $settings = $this->get_posted_settings(); |
|
| 596 | - $license_key = \GV\Utils::get( $settings, 'license_key' ); |
|
| 597 | - $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' ); |
|
| 598 | - } else { |
|
| 599 | - $license_status = $this->get( 'license_key_status', 'inactive' ); |
|
| 600 | - $license_key = $this->get( 'license_key' ); |
|
| 601 | - } |
|
| 594 | + if( $this->is_save_postback() ) { |
|
| 595 | + $settings = $this->get_posted_settings(); |
|
| 596 | + $license_key = \GV\Utils::get( $settings, 'license_key' ); |
|
| 597 | + $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' ); |
|
| 598 | + } else { |
|
| 599 | + $license_status = $this->get( 'license_key_status', 'inactive' ); |
|
| 600 | + $license_key = $this->get( 'license_key' ); |
|
| 601 | + } |
|
| 602 | 602 | |
| 603 | - $license_id = empty( $license_key ) ? 'license' : $license_key; |
|
| 603 | + $license_id = empty( $license_key ) ? 'license' : $license_key; |
|
| 604 | 604 | |
| 605 | 605 | $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' ); |
| 606 | 606 | |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $update_below = false; |
| 618 | 618 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
| 619 | 619 | |
| 620 | - switch ( $license_status ) { |
|
| 620 | + switch ( $license_status ) { |
|
| 621 | 621 | /** @since 1.17 */ |
| 622 | 622 | case 'expired': |
| 623 | 623 | $title = __( 'Expired License', 'gravityview' ); |
@@ -655,13 +655,13 @@ discard block |
||
| 655 | 655 | return; |
| 656 | 656 | } |
| 657 | 657 | |
| 658 | - \GravityView_Admin_Notices::add_notice( array( |
|
| 659 | - 'message' => $message, |
|
| 660 | - 'class' => 'notice notice-warning', |
|
| 661 | - 'title' => $title, |
|
| 662 | - 'cap' => 'gravityview_edit_settings', |
|
| 663 | - 'dismiss' => sha1( $license_status . '_' . $license_id . '_' . date( 'z' ) ), // Show every day, instead of every 8 weeks (which is the default) |
|
| 664 | - ) ); |
|
| 658 | + \GravityView_Admin_Notices::add_notice( array( |
|
| 659 | + 'message' => $message, |
|
| 660 | + 'class' => 'notice notice-warning', |
|
| 661 | + 'title' => $title, |
|
| 662 | + 'cap' => 'gravityview_edit_settings', |
|
| 663 | + 'dismiss' => sha1( $license_status . '_' . $license_id . '_' . date( 'z' ) ), // Show every day, instead of every 8 weeks (which is the default) |
|
| 664 | + ) ); |
|
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | /** |
@@ -675,12 +675,12 @@ discard block |
||
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | /** |
| 678 | - * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
| 679 | - * |
|
| 680 | - * @since 1.21.5 |
|
| 681 | - * |
|
| 682 | - * @see GFAddOn::scripts() |
|
| 683 | - * |
|
| 678 | + * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
| 679 | + * |
|
| 680 | + * @since 1.21.5 |
|
| 681 | + * |
|
| 682 | + * @see GFAddOn::scripts() |
|
| 683 | + * |
|
| 684 | 684 | * @return array Array of scripts |
| 685 | 685 | */ |
| 686 | 686 | public function scripts() { |
@@ -689,10 +689,10 @@ discard block |
||
| 689 | 689 | $scripts[] = array( |
| 690 | 690 | 'handle' => 'gform_tooltip_init', |
| 691 | 691 | 'enqueue' => array( |
| 692 | - array( |
|
| 693 | - 'admin_page' => array( 'app_settings' ) |
|
| 694 | - ) |
|
| 695 | - ) |
|
| 692 | + array( |
|
| 693 | + 'admin_page' => array( 'app_settings' ) |
|
| 694 | + ) |
|
| 695 | + ) |
|
| 696 | 696 | ); |
| 697 | 697 | |
| 698 | 698 | return $scripts; |
@@ -710,10 +710,10 @@ discard block |
||
| 710 | 710 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
| 711 | 711 | 'version' => Plugin::$version, |
| 712 | 712 | 'deps' => array( |
| 713 | - 'gform_admin', |
|
| 713 | + 'gform_admin', |
|
| 714 | 714 | 'gaddon_form_settings_css', |
| 715 | - 'gform_tooltip', |
|
| 716 | - 'gform_font_awesome', |
|
| 715 | + 'gform_tooltip', |
|
| 716 | + 'gform_font_awesome', |
|
| 717 | 717 | ), |
| 718 | 718 | 'enqueue' => array( |
| 719 | 719 | array( 'admin_page' => array( |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | array( |
| 882 | 882 | 'label' => _x( 'Show me beta versions if they are available.', 'gravityview' ), |
| 883 | 883 | 'value' => '1', |
| 884 | - 'name' => 'beta', |
|
| 884 | + 'name' => 'beta', |
|
| 885 | 885 | ), |
| 886 | 886 | ), |
| 887 | 887 | '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' ), |
@@ -919,38 +919,38 @@ discard block |
||
| 919 | 919 | |
| 920 | 920 | if ( empty( $field['disabled'] ) ) { |
| 921 | 921 | unset( $field['disabled'] ); |
| 922 | - } |
|
| 922 | + } |
|
| 923 | 923 | } |
| 924 | 924 | |
| 925 | - $sections = array( |
|
| 926 | - array( |
|
| 927 | - 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), Plugin::$version ) ), |
|
| 928 | - 'fields' => $fields, |
|
| 929 | - ) |
|
| 930 | - ); |
|
| 925 | + $sections = array( |
|
| 926 | + array( |
|
| 927 | + 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), Plugin::$version ) ), |
|
| 928 | + 'fields' => $fields, |
|
| 929 | + ) |
|
| 930 | + ); |
|
| 931 | 931 | |
| 932 | - // custom 'update settings' button |
|
| 933 | - $button = array( |
|
| 934 | - 'class' => 'button button-primary button-hero', |
|
| 935 | - 'type' => 'save', |
|
| 936 | - ); |
|
| 932 | + // custom 'update settings' button |
|
| 933 | + $button = array( |
|
| 934 | + 'class' => 'button button-primary button-hero', |
|
| 935 | + 'type' => 'save', |
|
| 936 | + ); |
|
| 937 | 937 | |
| 938 | 938 | if ( $disabled_attribute ) { |
| 939 | 939 | $button['disabled'] = $disabled_attribute; |
| 940 | 940 | } |
| 941 | 941 | |
| 942 | - /** |
|
| 943 | - * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
| 944 | - * Extensions can tap in here to insert their own section and settings. |
|
| 945 | - * <code> |
|
| 946 | - * $sections[] = array( |
|
| 947 | - * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
| 948 | - * 'fields' => $settings, |
|
| 949 | - * ); |
|
| 950 | - * </code> |
|
| 951 | - * @param array $extension_settings Empty array, ready for extension settings! |
|
| 952 | - */ |
|
| 953 | - $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
| 942 | + /** |
|
| 943 | + * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
| 944 | + * Extensions can tap in here to insert their own section and settings. |
|
| 945 | + * <code> |
|
| 946 | + * $sections[] = array( |
|
| 947 | + * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
| 948 | + * 'fields' => $settings, |
|
| 949 | + * ); |
|
| 950 | + * </code> |
|
| 951 | + * @param array $extension_settings Empty array, ready for extension settings! |
|
| 952 | + */ |
|
| 953 | + $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
| 954 | 954 | |
| 955 | 955 | // If there are extensions, add a section for them |
| 956 | 956 | if ( ! empty( $extension_sections ) ) { |
@@ -963,13 +963,13 @@ discard block |
||
| 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 | - // add the 'update settings' button to the general section |
|
| 971 | - $sections[0]['fields'][] = $button; |
|
| 972 | - } |
|
| 970 | + // add the 'update settings' button to the general section |
|
| 971 | + $sections[0]['fields'][] = $button; |
|
| 972 | + } |
|
| 973 | 973 | |
| 974 | 974 | return $sections; |
| 975 | 975 | } |
@@ -1023,9 +1023,9 @@ discard block |
||
| 1023 | 1023 | */ |
| 1024 | 1024 | protected function settings_edd_license( $field, $echo = true ) { |
| 1025 | 1025 | |
| 1026 | - if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
|
| 1027 | - $field['input_type'] = 'password'; |
|
| 1028 | - } |
|
| 1026 | + if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
|
| 1027 | + $field['input_type'] = 'password'; |
|
| 1028 | + } |
|
| 1029 | 1029 | |
| 1030 | 1030 | $text = $this->settings_text( $field, false ); |
| 1031 | 1031 | |
@@ -1042,9 +1042,9 @@ discard block |
||
| 1042 | 1042 | |
| 1043 | 1043 | /** |
| 1044 | 1044 | * Allow pure HTML settings row |
| 1045 | - * |
|
| 1046 | - * @since 2.0.6 |
|
| 1047 | - * |
|
| 1045 | + * |
|
| 1046 | + * @since 2.0.6 |
|
| 1047 | + * |
|
| 1048 | 1048 | * @param array $field |
| 1049 | 1049 | * @param bool $echo Whether to echo the |
| 1050 | 1050 | * |
@@ -1110,19 +1110,19 @@ discard block |
||
| 1110 | 1110 | } |
| 1111 | 1111 | |
| 1112 | 1112 | /** |
| 1113 | - * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
| 1114 | - * |
|
| 1115 | - * Converts `$field['description']` to `$field['gv_description']` |
|
| 1116 | - * Converts `$field['subtitle']` to `$field['description']` |
|
| 1117 | - * |
|
| 1118 | - * @see \GV\Addon_Settings::single_setting_label Converts `gv_description` back to `description` |
|
| 1119 | - * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
| 1120 | - * |
|
| 1121 | - * @since 1.21.5.2 |
|
| 1122 | - * |
|
| 1113 | + * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
| 1114 | + * |
|
| 1115 | + * Converts `$field['description']` to `$field['gv_description']` |
|
| 1116 | + * Converts `$field['subtitle']` to `$field['description']` |
|
| 1117 | + * |
|
| 1118 | + * @see \GV\Addon_Settings::single_setting_label Converts `gv_description` back to `description` |
|
| 1119 | + * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
| 1120 | + * |
|
| 1121 | + * @since 1.21.5.2 |
|
| 1122 | + * |
|
| 1123 | 1123 | * @param array $field |
| 1124 | - * |
|
| 1125 | - * @return void |
|
| 1124 | + * |
|
| 1125 | + * @return void |
|
| 1126 | 1126 | */ |
| 1127 | 1127 | public function single_setting_row( $field ) { |
| 1128 | 1128 | $field['gv_description'] = Utils::get( $field, 'description' ); |