@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return GV_License_Handler |
48 | 48 | */ |
49 | 49 | public static function get_instance( GravityView_Settings $GFAddOn ) { |
50 | - if( empty( self::$instance ) ) { |
|
50 | + if ( empty( self::$instance ) ) { |
|
51 | 51 | self::$instance = new self( $GFAddOn ); |
52 | 52 | } |
53 | 53 | return self::$instance; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | 'url' => home_url(), |
125 | 125 | 'site_data' => $this->get_site_data(), |
126 | 126 | ), |
127 | - )); |
|
127 | + ) ); |
|
128 | 128 | |
129 | 129 | // make sure the response came back okay |
130 | 130 | if ( is_wp_error( $response ) ) { |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function refresh_license_status() { |
152 | 152 | |
153 | - if ( defined('DOING_AJAX') && DOING_AJAX ) { |
|
153 | + if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
|
154 | 154 | return; |
155 | 155 | } |
156 | 156 | |
157 | 157 | // The transient is fresh; don't fetch. |
158 | - if( $status = get_transient( self::status_transient_key ) ) { |
|
158 | + if ( $status = get_transient( self::status_transient_key ) ) { |
|
159 | 159 | return; |
160 | 160 | } |
161 | 161 | |
@@ -188,48 +188,48 @@ discard block |
||
188 | 188 | $theme_data = wp_get_theme(); |
189 | 189 | $theme = $theme_data->Name . ' ' . $theme_data->Version; |
190 | 190 | |
191 | - $data['gv_version'] = GravityView_Plugin::version; |
|
192 | - $data['php_version'] = phpversion(); |
|
193 | - $data['wp_version'] = get_bloginfo( 'version' ); |
|
194 | - $data['gf_version'] = GFForms::$version; |
|
195 | - $data['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : ''; |
|
196 | - $data['multisite'] = is_multisite(); |
|
197 | - $data['theme'] = $theme; |
|
198 | - $data['url'] = home_url(); |
|
199 | - $data['license_key'] = GravityView_Settings::get_instance()->get_app_setting( 'license_key' ); |
|
191 | + $data[ 'gv_version' ] = GravityView_Plugin::version; |
|
192 | + $data[ 'php_version' ] = phpversion(); |
|
193 | + $data[ 'wp_version' ] = get_bloginfo( 'version' ); |
|
194 | + $data[ 'gf_version' ] = GFForms::$version; |
|
195 | + $data[ 'server' ] = isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) ? $_SERVER[ 'SERVER_SOFTWARE' ] : ''; |
|
196 | + $data[ 'multisite' ] = is_multisite(); |
|
197 | + $data[ 'theme' ] = $theme; |
|
198 | + $data[ 'url' ] = home_url(); |
|
199 | + $data[ 'license_key' ] = GravityView_Settings::get_instance()->get_app_setting( 'license_key' ); |
|
200 | 200 | |
201 | 201 | // View Data |
202 | - $gravityview_posts = get_posts('numberposts=-1&post_type=gravityview&post_status=publish&order=ASC'); |
|
202 | + $gravityview_posts = get_posts( 'numberposts=-1&post_type=gravityview&post_status=publish&order=ASC' ); |
|
203 | 203 | |
204 | 204 | if ( ! empty( $gravityview_posts ) ) { |
205 | 205 | $first = array_shift( $gravityview_posts ); |
206 | 206 | $latest = array_pop( $gravityview_posts ); |
207 | - $data['view_count'] = count( $gravityview_posts ); |
|
208 | - $data['view_first'] = $first->post_date; |
|
209 | - $data['view_latest'] = $latest->post_date; |
|
207 | + $data[ 'view_count' ] = count( $gravityview_posts ); |
|
208 | + $data[ 'view_first' ] = $first->post_date; |
|
209 | + $data[ 'view_latest' ] = $latest->post_date; |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | // Form counts |
213 | 213 | if ( class_exists( 'GFFormsModel' ) ) { |
214 | 214 | $form_data = GFFormsModel::get_form_count(); |
215 | - $data['forms_total'] = rgar( $form_data, 'total', 0 ); |
|
216 | - $data['forms_active'] = rgar( $form_data, 'active', 0 ); |
|
217 | - $data['forms_inactive'] = rgar( $form_data, 'inactive', 0 ); |
|
218 | - $data['forms_trash'] = rgar( $form_data, 'inactive', 0 ); |
|
215 | + $data[ 'forms_total' ] = rgar( $form_data, 'total', 0 ); |
|
216 | + $data[ 'forms_active' ] = rgar( $form_data, 'active', 0 ); |
|
217 | + $data[ 'forms_inactive' ] = rgar( $form_data, 'inactive', 0 ); |
|
218 | + $data[ 'forms_trash' ] = rgar( $form_data, 'inactive', 0 ); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | // Retrieve current plugin information |
222 | - if( ! function_exists( 'get_plugins' ) ) { |
|
222 | + if ( ! function_exists( 'get_plugins' ) ) { |
|
223 | 223 | include ABSPATH . '/wp-admin/includes/plugin.php'; |
224 | 224 | } |
225 | 225 | |
226 | - $data['integrations'] = self::get_related_plugins_and_extensions(); |
|
227 | - $data['active_plugins'] = get_option( 'active_plugins', array() ); |
|
228 | - $data['inactive_plugins'] = array(); |
|
229 | - $data['locale'] = get_locale(); |
|
226 | + $data[ 'integrations' ] = self::get_related_plugins_and_extensions(); |
|
227 | + $data[ 'active_plugins' ] = get_option( 'active_plugins', array() ); |
|
228 | + $data[ 'inactive_plugins' ] = array(); |
|
229 | + $data[ 'locale' ] = get_locale(); |
|
230 | 230 | |
231 | 231 | // Validate request on the GV server |
232 | - $data['hash'] = 'gv_version.url.locale:' . sha1( $data['gv_version'] . $data['url'] . $data['locale'] ); |
|
232 | + $data[ 'hash' ] = 'gv_version.url.locale:' . sha1( $data[ 'gv_version' ] . $data[ 'url' ] . $data[ 'locale' ] ); |
|
233 | 233 | |
234 | 234 | return $data; |
235 | 235 | } |
@@ -261,10 +261,10 @@ discard block |
||
261 | 261 | |
262 | 262 | $plugin_data = get_plugin_data( $active_plugin ); |
263 | 263 | |
264 | - $extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] ); |
|
264 | + $extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] ); |
|
265 | 265 | } |
266 | 266 | |
267 | - if( ! empty( $extensions ) ) { |
|
267 | + if ( ! empty( $extensions ) ) { |
|
268 | 268 | set_site_transient( self::related_plugins_key, $extensions, HOUR_IN_SECONDS ); |
269 | 269 | } else { |
270 | 270 | return 'There was an error fetching related plugins.'; |
@@ -283,37 +283,37 @@ discard block |
||
283 | 283 | $status = trim( $this->Addon->get_app_setting( 'license_key_status' ) ); |
284 | 284 | $key = trim( $this->Addon->get_app_setting( 'license_key' ) ); |
285 | 285 | |
286 | - if( !empty( $key ) ) { |
|
286 | + if ( ! empty( $key ) ) { |
|
287 | 287 | $response = $this->Addon->get_app_setting( 'license_key_response' ); |
288 | - $response = is_array( $response ) ? (object) $response : json_decode( $response ); |
|
288 | + $response = is_array( $response ) ? (object)$response : json_decode( $response ); |
|
289 | 289 | } else { |
290 | 290 | $response = array(); |
291 | 291 | } |
292 | 292 | |
293 | 293 | wp_localize_script( 'gv-admin-edd-license', 'GVGlobals', array( |
294 | 294 | 'license_box' => $this->get_license_message( $response ) |
295 | - )); |
|
295 | + ) ); |
|
296 | 296 | |
297 | 297 | |
298 | 298 | $fields = array( |
299 | 299 | array( |
300 | 300 | 'name' => 'edd-activate', |
301 | - 'value' => __('Activate License', 'gravityview'), |
|
302 | - 'data-pending_text' => __('Verifying license…', 'gravityview'), |
|
301 | + 'value' => __( 'Activate License', 'gravityview' ), |
|
302 | + 'data-pending_text' => __( 'Verifying license…', 'gravityview' ), |
|
303 | 303 | 'data-edd_action' => 'activate_license', |
304 | 304 | 'class' => 'button-primary', |
305 | 305 | ), |
306 | 306 | array( |
307 | 307 | 'name' => 'edd-deactivate', |
308 | - 'value' => __('Deactivate License', 'gravityview'), |
|
309 | - 'data-pending_text' => __('Deactivating license…', 'gravityview'), |
|
308 | + 'value' => __( 'Deactivate License', 'gravityview' ), |
|
309 | + 'data-pending_text' => __( 'Deactivating license…', 'gravityview' ), |
|
310 | 310 | 'data-edd_action' => 'deactivate_license', |
311 | 311 | 'class' => ( empty( $status ) ? 'button-primary hide' : 'button-primary' ), |
312 | 312 | ), |
313 | 313 | array( |
314 | 314 | 'name' => 'edd-check', |
315 | - 'value' => __('Check License', 'gravityview'), |
|
316 | - 'data-pending_text' => __('Verifying license…', 'gravityview'), |
|
315 | + 'value' => __( 'Check License', 'gravityview' ), |
|
316 | + 'data-pending_text' => __( 'Verifying license…', 'gravityview' ), |
|
317 | 317 | 'title' => 'Check the license before saving it', |
318 | 318 | 'data-edd_action' => 'check_license', |
319 | 319 | 'class' => 'button-secondary', |
@@ -323,17 +323,17 @@ discard block |
||
323 | 323 | |
324 | 324 | $class = 'button gv-edd-action'; |
325 | 325 | |
326 | - $class .= ( !empty( $key ) && $status !== 'valid' ) ? '' : ' hide'; |
|
326 | + $class .= ( ! empty( $key ) && $status !== 'valid' ) ? '' : ' hide'; |
|
327 | 327 | |
328 | 328 | $disabled_attribute = GVCommon::has_cap( 'gravityview_edit_settings' ) ? false : 'disabled'; |
329 | 329 | |
330 | 330 | $submit = '<div class="gv-edd-button-wrapper">'; |
331 | 331 | foreach ( $fields as $field ) { |
332 | - $field['type'] = 'button'; |
|
333 | - $field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class; |
|
334 | - $field['style'] = 'margin-left: 10px;'; |
|
335 | - if( $disabled_attribute ) { |
|
336 | - $field['disabled'] = $disabled_attribute; |
|
332 | + $field[ 'type' ] = 'button'; |
|
333 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class; |
|
334 | + $field[ 'style' ] = 'margin-left: 10px;'; |
|
335 | + if ( $disabled_attribute ) { |
|
336 | + $field[ 'disabled' ] = $disabled_attribute; |
|
337 | 337 | } |
338 | 338 | $submit .= $this->Addon->settings_submit( $field, $echo ); |
339 | 339 | } |
@@ -349,8 +349,8 @@ discard block |
||
349 | 349 | */ |
350 | 350 | private function setup_edd() { |
351 | 351 | |
352 | - if( !class_exists('EDD_SL_Plugin_Updater') ) { |
|
353 | - require_once( GRAVITYVIEW_DIR . 'includes/lib/EDD_SL_Plugin_Updater.php'); |
|
352 | + if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) { |
|
353 | + require_once( GRAVITYVIEW_DIR . 'includes/lib/EDD_SL_Plugin_Updater.php' ); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | // setup the updater |
@@ -388,8 +388,8 @@ discard block |
||
388 | 388 | 'beta' => $this->Addon->get_app_setting( 'beta' ), |
389 | 389 | ); |
390 | 390 | |
391 | - if( !empty( $action ) ) { |
|
392 | - $settings['edd_action'] = esc_attr( $action ); |
|
391 | + if ( ! empty( $action ) ) { |
|
392 | + $settings[ 'edd_action' ] = esc_attr( $action ); |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | $settings = array_map( 'urlencode', $settings ); |
@@ -403,14 +403,14 @@ discard block |
||
403 | 403 | */ |
404 | 404 | private function _license_get_remote_response( $data, $license = '' ) { |
405 | 405 | |
406 | - $api_params = $this->_get_edd_settings( $data['edd_action'], $license ); |
|
406 | + $api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license ); |
|
407 | 407 | |
408 | 408 | $url = add_query_arg( $api_params, self::url ); |
409 | 409 | |
410 | 410 | $response = wp_remote_get( $url, array( |
411 | 411 | 'timeout' => 15, |
412 | 412 | 'sslverify' => false, |
413 | - )); |
|
413 | + ) ); |
|
414 | 414 | |
415 | 415 | if ( is_wp_error( $response ) ) { |
416 | 416 | return array(); |
@@ -443,11 +443,11 @@ discard block |
||
443 | 443 | */ |
444 | 444 | function get_license_message( $license_data ) { |
445 | 445 | |
446 | - if( empty( $license_data ) ) { |
|
446 | + if ( empty( $license_data ) ) { |
|
447 | 447 | $message = ''; |
448 | 448 | } else { |
449 | 449 | |
450 | - if( ! empty( $license_data->error ) ) { |
|
450 | + if ( ! empty( $license_data->error ) ) { |
|
451 | 451 | $class = 'error'; |
452 | 452 | $string_key = $license_data->error; |
453 | 453 | } else { |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | $string_key = $license_data->license; |
456 | 456 | } |
457 | 457 | |
458 | - $message = sprintf( '<p><strong>%s: %s</strong></p>', $this->strings('status'), $this->strings( $string_key, $license_data ) ); |
|
458 | + $message = sprintf( '<p><strong>%s: %s</strong></p>', $this->strings( 'status' ), $this->strings( $string_key, $license_data ) ); |
|
459 | 459 | |
460 | 460 | $message = $this->generate_license_box( $message, $class ); |
461 | 461 | } |
@@ -492,18 +492,18 @@ discard block |
||
492 | 492 | */ |
493 | 493 | public function license_details( $response = array() ) { |
494 | 494 | |
495 | - $response = (array) $response; |
|
495 | + $response = (array)$response; |
|
496 | 496 | |
497 | 497 | $return = ''; |
498 | 498 | $wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>'; |
499 | 499 | |
500 | - if( ! empty( $response['license_key'] ) ) { |
|
500 | + if ( ! empty( $response[ 'license_key' ] ) ) { |
|
501 | 501 | |
502 | 502 | $return .= '<h3>' . esc_html__( 'License Details:', 'gravityview' ) . '</h3>'; |
503 | 503 | |
504 | 504 | if ( in_array( rgar( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) { |
505 | - $return .= $this->strings( $response['license'], $response ); |
|
506 | - } elseif ( ! empty( $response['license_name'] ) ) { |
|
505 | + $return .= $this->strings( $response[ 'license' ], $response ); |
|
506 | + } elseif ( ! empty( $response[ 'license_name' ] ) ) { |
|
507 | 507 | |
508 | 508 | $response_keys = array( |
509 | 509 | 'license_name' => '', |
@@ -518,19 +518,19 @@ discard block |
||
518 | 518 | // Make sure all the keys are set |
519 | 519 | $response = wp_parse_args( $response, $response_keys ); |
520 | 520 | |
521 | - $login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response['customer_email'] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) ); |
|
522 | - $local_text = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' ); |
|
521 | + $login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response[ 'customer_email' ] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) ); |
|
522 | + $local_text = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' ); |
|
523 | 523 | $details = array( |
524 | - 'license' => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response['license_name'] ), esc_html( $response['license_limit'] ) ), |
|
525 | - 'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . $login_link, |
|
526 | - 'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response['site_count'] ), esc_html( $response['license_limit'] ) ) . $local_text, |
|
527 | - 'expires' => 'lifetime' === $response['expires'] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ), |
|
528 | - 'upgrade' => $this->get_upgrade_html( $response['upgrades'] ), |
|
524 | + 'license' => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response[ 'license_name' ] ), esc_html( $response[ 'license_limit' ] ) ), |
|
525 | + 'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . $login_link, |
|
526 | + 'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response[ 'site_count' ] ), esc_html( $response[ 'license_limit' ] ) ) . $local_text, |
|
527 | + 'expires' => 'lifetime' === $response[ 'expires' ] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ), |
|
528 | + 'upgrade' => $this->get_upgrade_html( $response[ 'upgrades' ] ), |
|
529 | 529 | ); |
530 | 530 | |
531 | - if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) { |
|
532 | - unset( $details['upgrade'] ); |
|
533 | - $details['expires'] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>'; |
|
531 | + if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) { |
|
532 | + unset( $details[ 'upgrade' ] ); |
|
533 | + $details[ 'expires' ] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>'; |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | $return .= '<ul><li>' . implode( '</li><li>', array_filter( $details ) ) . '</li></ul>'; |
@@ -553,11 +553,11 @@ discard block |
||
553 | 553 | |
554 | 554 | $output = ''; |
555 | 555 | |
556 | - if( ! empty( $upgrades ) ) { |
|
556 | + if ( ! empty( $upgrades ) ) { |
|
557 | 557 | |
558 | 558 | $locale_parts = explode( '_', get_locale() ); |
559 | 559 | |
560 | - $is_english = ( 'en' === $locale_parts[0] ); |
|
560 | + $is_english = ( 'en' === $locale_parts[ 0 ] ); |
|
561 | 561 | |
562 | 562 | $output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>'; |
563 | 563 | |
@@ -565,14 +565,14 @@ discard block |
||
565 | 565 | |
566 | 566 | foreach ( $upgrades as $upgrade_id => $upgrade ) { |
567 | 567 | |
568 | - $upgrade = (object) $upgrade; |
|
568 | + $upgrade = (object)$upgrade; |
|
569 | 569 | |
570 | 570 | $anchor_text = sprintf( esc_html_x( 'Upgrade to %1$s for %2$s', '1: GravityView upgrade name, 2: Cost of upgrade', 'gravityview' ), esc_attr( $upgrade->name ), esc_attr( $upgrade->price ) ); |
571 | 571 | |
572 | - if( $is_english && isset( $upgrade->description ) ) { |
|
572 | + if ( $is_english && isset( $upgrade->description ) ) { |
|
573 | 573 | $message = esc_html( $upgrade->description ); |
574 | 574 | } else { |
575 | - switch( $upgrade->price_id ) { |
|
575 | + switch ( $upgrade->price_id ) { |
|
576 | 576 | // Interstellar |
577 | 577 | case 1: |
578 | 578 | default: |
@@ -610,16 +610,16 @@ discard block |
||
610 | 610 | */ |
611 | 611 | public function license_call( $array = array() ) { |
612 | 612 | |
613 | - $is_ajax = ( defined('DOING_AJAX') && DOING_AJAX ); |
|
614 | - $data = empty( $array ) ? $_POST['data'] : $array; |
|
613 | + $is_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX ); |
|
614 | + $data = empty( $array ) ? $_POST[ 'data' ] : $array; |
|
615 | 615 | $has_cap = GVCommon::has_cap( 'gravityview_edit_settings' ); |
616 | 616 | |
617 | - if ( $is_ajax && empty( $data['license'] ) ) { |
|
618 | - die( - 1 ); |
|
617 | + if ( $is_ajax && empty( $data[ 'license' ] ) ) { |
|
618 | + die( -1 ); |
|
619 | 619 | } |
620 | 620 | |
621 | 621 | // If the user isn't allowed to edit settings, show an error message |
622 | - if( ! $has_cap && empty( $data['all_caps'] ) ) { |
|
622 | + if ( ! $has_cap && empty( $data[ 'all_caps' ] ) ) { |
|
623 | 623 | $license_data = new stdClass(); |
624 | 624 | $license_data->error = 'capability'; |
625 | 625 | $license_data->message = $this->get_license_message( $license_data ); |
@@ -643,11 +643,11 @@ discard block |
||
643 | 643 | |
644 | 644 | $json = json_encode( $license_data ); |
645 | 645 | |
646 | - $update_license = ( ! isset( $data['update'] ) || ! empty( $data['update'] ) ); |
|
646 | + $update_license = ( ! isset( $data[ 'update' ] ) || ! empty( $data[ 'update' ] ) ); |
|
647 | 647 | |
648 | - $is_check_action_button = ( 'check_license' === $data['edd_action'] && defined( 'DOING_AJAX' ) && DOING_AJAX ); |
|
648 | + $is_check_action_button = ( 'check_license' === $data[ 'edd_action' ] && defined( 'DOING_AJAX' ) && DOING_AJAX ); |
|
649 | 649 | |
650 | - if( $is_check_action_button ) { |
|
650 | + if ( $is_check_action_button ) { |
|
651 | 651 | delete_transient( self::status_transient_key ); |
652 | 652 | } |
653 | 653 | // Failed is the response from trying to de-activate a license and it didn't work. |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | // most likely a mistake. |
657 | 657 | else if ( $license_data->license !== 'failed' && $update_license ) { |
658 | 658 | |
659 | - if ( ! empty( $data['field_id'] ) ) { |
|
659 | + if ( ! empty( $data[ 'field_id' ] ) ) { |
|
660 | 660 | set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS ); |
661 | 661 | } |
662 | 662 | |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | if ( $is_ajax ) { |
668 | 668 | exit( $json ); |
669 | 669 | } else { // Non-ajax call |
670 | - return ( rgget('format', $data ) === 'object' ) ? $license_data : $json; |
|
670 | + return ( rgget( 'format', $data ) === 'object' ) ? $license_data : $json; |
|
671 | 671 | } |
672 | 672 | } |
673 | 673 | |
@@ -681,9 +681,9 @@ discard block |
||
681 | 681 | // Update option with passed data license |
682 | 682 | $settings = $this->Addon->get_app_settings(); |
683 | 683 | |
684 | - $settings['license_key'] = $license_data->license_key = trim( $data['license'] ); |
|
685 | - $settings['license_key_status'] = $license_data->license; |
|
686 | - $settings['license_key_response'] = (array)$license_data; |
|
684 | + $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] ); |
|
685 | + $settings[ 'license_key_status' ] = $license_data->license; |
|
686 | + $settings[ 'license_key_response' ] = (array)$license_data; |
|
687 | 687 | |
688 | 688 | $this->Addon->update_app_settings( $settings ); |
689 | 689 | } |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | */ |
697 | 697 | private function get_license_renewal_url( $license_data ) { |
698 | 698 | $license_data = is_array( $license_data ) ? (object)$license_data : $license_data; |
699 | - $renew_license_url = ( ! empty( $license_data ) && !empty( $license_data->license_key ) ) ? sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s&utm_source=admin_notice&utm_medium=admin&utm_content=expired&utm_campaign=Activation&force_login=1', $license_data->license_key ) : 'https://gravityview.co/account/'; |
|
699 | + $renew_license_url = ( ! empty( $license_data ) && ! empty( $license_data->license_key ) ) ? sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s&utm_source=admin_notice&utm_medium=admin&utm_content=expired&utm_campaign=Activation&force_login=1', $license_data->license_key ) : 'https://gravityview.co/account/'; |
|
700 | 700 | return $renew_license_url; |
701 | 701 | } |
702 | 702 | |
@@ -711,31 +711,31 @@ discard block |
||
711 | 711 | |
712 | 712 | |
713 | 713 | $strings = array( |
714 | - 'status' => esc_html__('Status', 'gravityview'), |
|
715 | - 'error' => esc_html__('There was an error processing the request.', 'gravityview'), |
|
716 | - 'failed' => esc_html__('Could not deactivate the license. The license key you attempted to deactivate may not be active or valid.', 'gravityview'), |
|
717 | - 'site_inactive' => esc_html__('The license key is valid, but it has not been activated for this site.', 'gravityview'), |
|
718 | - 'inactive' => esc_html__('The license key is valid, but it has not been activated for this site.', 'gravityview'), |
|
719 | - 'no_activations_left' => esc_html__('Invalid: this license has reached its activation limit.', 'gravityview') . ' ' . sprintf( esc_html__('You can manage license activations %son your GravityView account page%s.', 'gravityview'), '<a href="https://gravityview.co/account/#licenses">', '</a>' ), |
|
720 | - 'deactivated' => esc_html__('The license has been deactivated.', 'gravityview'), |
|
721 | - 'valid' => esc_html__('The license key is valid and active.', 'gravityview'), |
|
722 | - 'invalid' => esc_html__('The license key entered is invalid.', 'gravityview'), |
|
723 | - 'missing' => esc_html__('Invalid license key.', 'gravityview'), |
|
724 | - 'revoked' => esc_html__('This license key has been revoked.', 'gravityview'), |
|
725 | - 'expired' => sprintf( esc_html__('This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview'), '<a href="'. esc_url( $this->get_license_renewal_url( $license_data ) ) .'">', '</a>' ), |
|
714 | + 'status' => esc_html__( 'Status', 'gravityview' ), |
|
715 | + 'error' => esc_html__( 'There was an error processing the request.', 'gravityview' ), |
|
716 | + 'failed' => esc_html__( 'Could not deactivate the license. The license key you attempted to deactivate may not be active or valid.', 'gravityview' ), |
|
717 | + 'site_inactive' => esc_html__( 'The license key is valid, but it has not been activated for this site.', 'gravityview' ), |
|
718 | + 'inactive' => esc_html__( 'The license key is valid, but it has not been activated for this site.', 'gravityview' ), |
|
719 | + 'no_activations_left' => esc_html__( 'Invalid: this license has reached its activation limit.', 'gravityview' ) . ' ' . sprintf( esc_html__( 'You can manage license activations %son your GravityView account page%s.', 'gravityview' ), '<a href="https://gravityview.co/account/#licenses">', '</a>' ), |
|
720 | + 'deactivated' => esc_html__( 'The license has been deactivated.', 'gravityview' ), |
|
721 | + 'valid' => esc_html__( 'The license key is valid and active.', 'gravityview' ), |
|
722 | + 'invalid' => esc_html__( 'The license key entered is invalid.', 'gravityview' ), |
|
723 | + 'missing' => esc_html__( 'Invalid license key.', 'gravityview' ), |
|
724 | + 'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ), |
|
725 | + 'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="' . esc_url( $this->get_license_renewal_url( $license_data ) ) . '">', '</a>' ), |
|
726 | 726 | 'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ), |
727 | 727 | |
728 | - 'verifying_license' => esc_html__('Verifying license…', 'gravityview'), |
|
729 | - 'activate_license' => esc_html__('Activate License', 'gravityview'), |
|
730 | - 'deactivate_license' => esc_html__('Deactivate License', 'gravityview'), |
|
731 | - 'check_license' => esc_html__('Verify License', 'gravityview'), |
|
728 | + 'verifying_license' => esc_html__( 'Verifying license…', 'gravityview' ), |
|
729 | + 'activate_license' => esc_html__( 'Activate License', 'gravityview' ), |
|
730 | + 'deactivate_license' => esc_html__( 'Deactivate License', 'gravityview' ), |
|
731 | + 'check_license' => esc_html__( 'Verify License', 'gravityview' ), |
|
732 | 732 | ); |
733 | 733 | |
734 | - if( empty( $status ) ) { |
|
734 | + if ( empty( $status ) ) { |
|
735 | 735 | return $strings; |
736 | 736 | } |
737 | 737 | |
738 | - if( isset( $strings[ $status ] ) ) { |
|
738 | + if ( isset( $strings[ $status ] ) ) { |
|
739 | 739 | return $strings[ $status ]; |
740 | 740 | } |
741 | 741 |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
125 | - * Uninstall all traces of GravityView |
|
126 | - * |
|
127 | - * Note: method is public because parent method is public |
|
128 | - * |
|
125 | + * Uninstall all traces of GravityView |
|
126 | + * |
|
127 | + * Note: method is public because parent method is public |
|
128 | + * |
|
129 | 129 | * @return bool |
130 | 130 | */ |
131 | 131 | public function uninstall() { |
@@ -137,53 +137,53 @@ discard block |
||
137 | 137 | $uninstaller->fire_everything(); |
138 | 138 | |
139 | 139 | /** |
140 | - * Set the path so that Gravity Forms can de-activate GravityView |
|
141 | - * @see GFAddOn::uninstall_addon |
|
142 | - * @uses deactivate_plugins() |
|
143 | - */ |
|
140 | + * Set the path so that Gravity Forms can de-activate GravityView |
|
141 | + * @see GFAddOn::uninstall_addon |
|
142 | + * @uses deactivate_plugins() |
|
143 | + */ |
|
144 | 144 | $this->_path = GRAVITYVIEW_FILE; |
145 | 145 | |
146 | 146 | return true; |
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
150 | - * Get an array of reasons why the plugin might be uninstalled |
|
151 | - * |
|
152 | - * @since 1.17.5 |
|
153 | - * |
|
150 | + * Get an array of reasons why the plugin might be uninstalled |
|
151 | + * |
|
152 | + * @since 1.17.5 |
|
153 | + * |
|
154 | 154 | * @return array Array of reasons with the label and followup questions for each uninstall reason |
155 | 155 | */ |
156 | 156 | private function get_uninstall_reasons() { |
157 | 157 | |
158 | 158 | $reasons = array( |
159 | 159 | 'will-continue' => array( |
160 | - 'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ), |
|
161 | - ), |
|
160 | + 'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ), |
|
161 | + ), |
|
162 | 162 | 'no-longer-need' => array( |
163 | - 'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ), |
|
164 | - ), |
|
163 | + 'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ), |
|
164 | + ), |
|
165 | 165 | 'doesnt-work' => array( |
166 | - 'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ), |
|
167 | - ), |
|
166 | + 'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ), |
|
167 | + ), |
|
168 | 168 | 'found-other' => array( |
169 | - 'label' => esc_html__( 'I found a better plugin', 'gravityview' ), |
|
170 | - 'followup' => esc_attr__('What plugin you are using, and why?', 'gravityview'), |
|
171 | - ), |
|
169 | + 'label' => esc_html__( 'I found a better plugin', 'gravityview' ), |
|
170 | + 'followup' => esc_attr__('What plugin you are using, and why?', 'gravityview'), |
|
171 | + ), |
|
172 | 172 | 'other' => array( |
173 | - 'label' => esc_html__( 'Other', 'gravityview' ), |
|
174 | - ), |
|
173 | + 'label' => esc_html__( 'Other', 'gravityview' ), |
|
174 | + ), |
|
175 | 175 | ); |
176 | 176 | |
177 | 177 | shuffle( $reasons ); |
178 | 178 | |
179 | 179 | return $reasons; |
180 | - } |
|
180 | + } |
|
181 | 181 | |
182 | 182 | /** |
183 | - * Display a feedback form when the plugin is uninstalled |
|
184 | - * |
|
185 | - * @since 1.17.5 |
|
186 | - * |
|
183 | + * Display a feedback form when the plugin is uninstalled |
|
184 | + * |
|
185 | + * @since 1.17.5 |
|
186 | + * |
|
187 | 187 | * @return string HTML of the uninstallation form |
188 | 188 | */ |
189 | 189 | public function uninstall_form() { |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | <h2><?php esc_html_e( 'Why did you uninstall GravityView?', 'gravityview' ); ?></h2> |
264 | 264 | <ul> |
265 | 265 | <?php |
266 | - $reasons = $this->get_uninstall_reasons(); |
|
266 | + $reasons = $this->get_uninstall_reasons(); |
|
267 | 267 | foreach ( $reasons as $reason ) { |
268 | 268 | printf( '<li><label><input name="reason" type="radio" value="other" data-followup="%s"> %s</label></li>', rgar( $reason, 'followup' ), rgar( $reason, 'label' ) ); |
269 | 269 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $license_key = self::getSetting('license_key'); |
427 | 427 | if( '' === $license_key ) { |
428 | 428 | $license_status = 'inactive'; |
429 | - } |
|
429 | + } |
|
430 | 430 | $license_id = empty( $license_key ) ? 'license' : $license_key; |
431 | 431 | |
432 | 432 | $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'); |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $update_below = false; |
442 | 442 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
443 | 443 | |
444 | - switch ( $license_status ) { |
|
444 | + switch ( $license_status ) { |
|
445 | 445 | /** @since 1.17 */ |
446 | 446 | case 'expired': |
447 | 447 | $title = __('Expired License', 'gravityview'); |
@@ -487,12 +487,12 @@ discard block |
||
487 | 487 | } |
488 | 488 | |
489 | 489 | /** |
490 | - * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
491 | - * |
|
492 | - * @since 1.21.5 |
|
493 | - * |
|
494 | - * @see GFAddOn::scripts() |
|
495 | - * |
|
490 | + * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
491 | + * |
|
492 | + * @since 1.21.5 |
|
493 | + * |
|
494 | + * @see GFAddOn::scripts() |
|
495 | + * |
|
496 | 496 | * @return array Array of scripts |
497 | 497 | */ |
498 | 498 | public function scripts() { |
@@ -501,10 +501,10 @@ discard block |
||
501 | 501 | $scripts[] = array( |
502 | 502 | 'handle' => 'gform_tooltip_init', |
503 | 503 | 'enqueue' => array( |
504 | - array( |
|
505 | - 'admin_page' => array( 'app_settings' ) |
|
506 | - ) |
|
507 | - ) |
|
504 | + array( |
|
505 | + 'admin_page' => array( 'app_settings' ) |
|
506 | + ) |
|
507 | + ) |
|
508 | 508 | ); |
509 | 509 | |
510 | 510 | return $scripts; |
@@ -523,10 +523,10 @@ discard block |
||
523 | 523 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
524 | 524 | 'version' => GravityView_Plugin::version, |
525 | 525 | "deps" => array( |
526 | - 'gform_admin', |
|
526 | + 'gform_admin', |
|
527 | 527 | 'gaddon_form_settings_css', |
528 | - 'gform_tooltip', |
|
529 | - 'gform_font_awesome', |
|
528 | + 'gform_tooltip', |
|
529 | + 'gform_font_awesome', |
|
530 | 530 | ), |
531 | 531 | 'enqueue' => array( |
532 | 532 | array( 'admin_page' => array( |
@@ -592,12 +592,12 @@ discard block |
||
592 | 592 | } |
593 | 593 | |
594 | 594 | public function app_settings_tab() { |
595 | - parent::app_settings_tab(); |
|
595 | + parent::app_settings_tab(); |
|
596 | 596 | |
597 | 597 | if ( $this->maybe_uninstall() ) { |
598 | - echo $this->uninstall_form(); |
|
598 | + echo $this->uninstall_form(); |
|
599 | 599 | } |
600 | - } |
|
600 | + } |
|
601 | 601 | |
602 | 602 | /** |
603 | 603 | * Make protected public |
@@ -720,8 +720,8 @@ discard block |
||
720 | 720 | type="' . $field['type'] . '" |
721 | 721 | name="' . esc_attr( $name ) . '" |
722 | 722 | value="' . $value . '" ' . |
723 | - implode( ' ', $attributes ) . |
|
724 | - ' />'; |
|
723 | + implode( ' ', $attributes ) . |
|
724 | + ' />'; |
|
725 | 725 | |
726 | 726 | if ( $echo ) { |
727 | 727 | echo $html; |
@@ -762,19 +762,19 @@ discard block |
||
762 | 762 | |
763 | 763 | |
764 | 764 | /** |
765 | - * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
766 | - * |
|
767 | - * Converts `$field['description']` to `$field['gv_description']` |
|
768 | - * Converts `$field['subtitle']` to `$field['description']` |
|
769 | - * |
|
770 | - * @see GravityView_Settings::single_setting_label Converts `gv_description` back to `description` |
|
771 | - * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
772 | - * |
|
773 | - * @since 1.21.5.2 |
|
774 | - * |
|
765 | + * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
766 | + * |
|
767 | + * Converts `$field['description']` to `$field['gv_description']` |
|
768 | + * Converts `$field['subtitle']` to `$field['description']` |
|
769 | + * |
|
770 | + * @see GravityView_Settings::single_setting_label Converts `gv_description` back to `description` |
|
771 | + * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
772 | + * |
|
773 | + * @since 1.21.5.2 |
|
774 | + * |
|
775 | 775 | * @param array $field |
776 | - * |
|
777 | - * @return void |
|
776 | + * |
|
777 | + * @return void |
|
778 | 778 | */ |
779 | 779 | public function single_setting_row( $field ) { |
780 | 780 | |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | array( |
969 | 969 | 'label' => _x('Show me beta versions if they are available.', 'gravityview'), |
970 | 970 | 'value' => '1', |
971 | - 'name' => 'beta', |
|
971 | + 'name' => 'beta', |
|
972 | 972 | ), |
973 | 973 | ), |
974 | 974 | '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'), |
@@ -993,36 +993,36 @@ discard block |
||
993 | 993 | } |
994 | 994 | |
995 | 995 | |
996 | - $sections = array( |
|
997 | - array( |
|
998 | - 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ), |
|
999 | - 'fields' => $fields, |
|
1000 | - ) |
|
1001 | - ); |
|
996 | + $sections = array( |
|
997 | + array( |
|
998 | + 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ), |
|
999 | + 'fields' => $fields, |
|
1000 | + ) |
|
1001 | + ); |
|
1002 | 1002 | |
1003 | - // custom 'update settings' button |
|
1004 | - $button = array( |
|
1005 | - 'class' => 'button button-primary button-hero', |
|
1006 | - 'type' => 'save', |
|
1007 | - ); |
|
1003 | + // custom 'update settings' button |
|
1004 | + $button = array( |
|
1005 | + 'class' => 'button button-primary button-hero', |
|
1006 | + 'type' => 'save', |
|
1007 | + ); |
|
1008 | 1008 | |
1009 | 1009 | if( $disabled_attribute ) { |
1010 | 1010 | $button['disabled'] = $disabled_attribute; |
1011 | 1011 | } |
1012 | 1012 | |
1013 | 1013 | |
1014 | - /** |
|
1015 | - * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
1016 | - * Extensions can tap in here to insert their own section and settings. |
|
1017 | - * <code> |
|
1018 | - * $sections[] = array( |
|
1019 | - * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
1020 | - * 'fields' => $settings, |
|
1021 | - * ); |
|
1022 | - * </code> |
|
1023 | - * @param array $extension_settings Empty array, ready for extension settings! |
|
1024 | - */ |
|
1025 | - $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
1014 | + /** |
|
1015 | + * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
1016 | + * Extensions can tap in here to insert their own section and settings. |
|
1017 | + * <code> |
|
1018 | + * $sections[] = array( |
|
1019 | + * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
1020 | + * 'fields' => $settings, |
|
1021 | + * ); |
|
1022 | + * </code> |
|
1023 | + * @param array $extension_settings Empty array, ready for extension settings! |
|
1024 | + */ |
|
1025 | + $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
1026 | 1026 | |
1027 | 1027 | // If there are extensions, add a section for them |
1028 | 1028 | if ( ! empty( $extension_sections ) ) { |
@@ -1035,13 +1035,13 @@ discard block |
||
1035 | 1035 | } |
1036 | 1036 | } |
1037 | 1037 | |
1038 | - $k = count( $extension_sections ) - 1 ; |
|
1039 | - $extension_sections[ $k ]['fields'][] = $button; |
|
1038 | + $k = count( $extension_sections ) - 1 ; |
|
1039 | + $extension_sections[ $k ]['fields'][] = $button; |
|
1040 | 1040 | $sections = array_merge( $sections, $extension_sections ); |
1041 | 1041 | } else { |
1042 | - // add the 'update settings' button to the general section |
|
1043 | - $sections[0]['fields'][] = $button; |
|
1044 | - } |
|
1042 | + // add the 'update settings' button to the general section |
|
1043 | + $sections[0]['fields'][] = $button; |
|
1044 | + } |
|
1045 | 1045 | |
1046 | 1046 | return $sections; |
1047 | 1047 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if( ! class_exists('GFAddOn') ) { |
|
3 | +if ( ! class_exists( 'GFAddOn' ) ) { |
|
4 | 4 | return; |
5 | 5 | } |
6 | 6 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function __construct( $prevent_multiple_instances = '' ) { |
77 | 77 | |
78 | - if( $prevent_multiple_instances === 'get_instance' ) { |
|
78 | + if ( $prevent_multiple_instances === 'get_instance' ) { |
|
79 | 79 | return parent::__construct(); |
80 | 80 | } |
81 | 81 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public static function get_instance() { |
89 | 89 | |
90 | - if( empty( self::$instance ) ) { |
|
90 | + if ( empty( self::$instance ) ) { |
|
91 | 91 | self::$instance = new self( 'get_instance' ); |
92 | 92 | } |
93 | 93 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function current_user_can_any( $caps ) { |
108 | 108 | |
109 | - if( empty( $caps ) ) { |
|
109 | + if ( empty( $caps ) ) { |
|
110 | 110 | $caps = array( 'gravityview_full_access' ); |
111 | 111 | } |
112 | 112 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | ), |
168 | 168 | 'found-other' => array( |
169 | 169 | 'label' => esc_html__( 'I found a better plugin', 'gravityview' ), |
170 | - 'followup' => esc_attr__('What plugin you are using, and why?', 'gravityview'), |
|
170 | + 'followup' => esc_attr__( 'What plugin you are using, and why?', 'gravityview' ), |
|
171 | 171 | ), |
172 | 172 | 'other' => array( |
173 | 173 | 'label' => esc_html__( 'Other', 'gravityview' ), |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | }); |
255 | 255 | |
256 | 256 | function gv_feedback_append_error_message() { |
257 | - $('#gv-uninstall-thanks').append('<div class="notice error"><?php echo esc_js( __('There was an error sharing your feedback. Sorry! Please email us at [email protected]', 'gravityview' ) ) ?></div>'); |
|
257 | + $('#gv-uninstall-thanks').append('<div class="notice error"><?php echo esc_js( __( 'There was an error sharing your feedback. Sorry! Please email us at [email protected]', 'gravityview' ) ) ?></div>'); |
|
258 | 258 | } |
259 | 259 | }); |
260 | 260 | </script> |
@@ -271,15 +271,15 @@ discard block |
||
271 | 271 | </ul> |
272 | 272 | <div class="gv-followup widefat"> |
273 | 273 | <p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p> |
274 | - <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> |
|
274 | + <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> |
|
275 | 275 | </div> |
276 | 276 | <div class="scale-description"> |
277 | - <p><strong><?php esc_html_e('How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p> |
|
277 | + <p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p> |
|
278 | 278 | <ul class="inline"> |
279 | 279 | <?php |
280 | 280 | $i = 0; |
281 | - while( $i < 11 ) { |
|
282 | - echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>'; |
|
281 | + while ( $i < 11 ) { |
|
282 | + echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>'; |
|
283 | 283 | $i++; |
284 | 284 | } |
285 | 285 | ?> |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | </div> |
289 | 289 | |
290 | 290 | <div class="gv-form-field-wrapper"> |
291 | - <label><input type="checkbox" class="checkbox" name="follow_up_with_me" value="1" /> <?php esc_html_e('Please follow up with me about my feedback', 'gravityview'); ?></label> |
|
291 | + <label><input type="checkbox" class="checkbox" name="follow_up_with_me" value="1" /> <?php esc_html_e( 'Please follow up with me about my feedback', 'gravityview' ); ?></label> |
|
292 | 292 | </div> |
293 | 293 | |
294 | 294 | <div class="submit"> |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | <div id="gv-uninstall-thanks" class="notice notice-large notice-updated below-h2" style="display:none;"> |
303 | 303 | <h3 class="notice-title"><?php esc_html_e( 'Thank you for using GravityView!', 'gravityview' ); ?></h3> |
304 | 304 | <p><?php echo gravityview_get_floaty(); ?> |
305 | - <?php echo make_clickable( esc_html__('Your feedback helps us improve GravityView. If you have any questions or comments, email us: [email protected]', 'gravityview' ) ); ?> |
|
305 | + <?php echo make_clickable( esc_html__( 'Your feedback helps us improve GravityView. If you have any questions or comments, email us: [email protected]', 'gravityview' ) ); ?> |
|
306 | 306 | </p> |
307 | 307 | <div class="wp-clearfix"></div> |
308 | 308 | </div> |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | add_filter( 'gform_addon_app_settings_menu_gravityview', array( $this, 'modify_app_settings_menu_title' ) ); |
377 | 377 | |
378 | 378 | /** @since 1.7.6 */ |
379 | - add_action('network_admin_menu', array( $this, 'add_network_menu' ) ); |
|
379 | + add_action( 'network_admin_menu', array( $this, 'add_network_menu' ) ); |
|
380 | 380 | |
381 | 381 | parent::init_admin(); |
382 | 382 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | */ |
391 | 391 | public function modify_app_settings_menu_title( $setting_tabs ) { |
392 | 392 | |
393 | - $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview'); |
|
393 | + $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
394 | 394 | |
395 | 395 | return $setting_tabs; |
396 | 396 | } |
@@ -407,11 +407,11 @@ discard block |
||
407 | 407 | */ |
408 | 408 | private function _load_license_handler() { |
409 | 409 | |
410 | - if( !empty( $this->License_Handler ) ) { |
|
410 | + if ( ! empty( $this->License_Handler ) ) { |
|
411 | 411 | return; |
412 | 412 | } |
413 | 413 | |
414 | - require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php'); |
|
414 | + require_once( GRAVITYVIEW_DIR . 'includes/class-gv-license-handler.php' ); |
|
415 | 415 | |
416 | 416 | $this->License_Handler = GV_License_Handler::get_instance( $this ); |
417 | 417 | } |
@@ -422,21 +422,21 @@ discard block |
||
422 | 422 | */ |
423 | 423 | function license_key_notice() { |
424 | 424 | |
425 | - $license_status = self::getSetting('license_key_status'); |
|
426 | - $license_key = self::getSetting('license_key'); |
|
427 | - if( '' === $license_key ) { |
|
425 | + $license_status = self::getSetting( 'license_key_status' ); |
|
426 | + $license_key = self::getSetting( 'license_key' ); |
|
427 | + if ( '' === $license_key ) { |
|
428 | 428 | $license_status = 'inactive'; |
429 | 429 | } |
430 | 430 | $license_id = empty( $license_key ) ? 'license' : $license_key; |
431 | 431 | |
432 | - $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'); |
|
432 | + $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' ); |
|
433 | 433 | |
434 | 434 | /** |
435 | 435 | * I wanted to remove the period from after the buttons in the string, |
436 | 436 | * but didn't want to mess up the translation strings for the translators. |
437 | 437 | */ |
438 | 438 | $message = mb_substr( $message, 0, mb_strlen( $message ) - 1 ); |
439 | - $title = __('Inactive License', 'gravityview'); |
|
439 | + $title = __( 'Inactive License', 'gravityview' ); |
|
440 | 440 | $status = ''; |
441 | 441 | $update_below = false; |
442 | 442 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
@@ -444,17 +444,17 @@ discard block |
||
444 | 444 | switch ( $license_status ) { |
445 | 445 | /** @since 1.17 */ |
446 | 446 | case 'expired': |
447 | - $title = __('Expired License', 'gravityview'); |
|
447 | + $title = __( 'Expired License', 'gravityview' ); |
|
448 | 448 | $status = 'expired'; |
449 | - $message = $this->get_license_handler()->strings( 'expired', self::getSetting('license_key_response') ); |
|
449 | + $message = $this->get_license_handler()->strings( 'expired', self::getSetting( 'license_key_response' ) ); |
|
450 | 450 | break; |
451 | 451 | case 'invalid': |
452 | - $title = __('Invalid License', 'gravityview'); |
|
453 | - $status = __('is invalid', 'gravityview'); |
|
452 | + $title = __( 'Invalid License', 'gravityview' ); |
|
453 | + $status = __( 'is invalid', 'gravityview' ); |
|
454 | 454 | break; |
455 | 455 | case 'deactivated': |
456 | - $status = __('is inactive', 'gravityview'); |
|
457 | - $update_below = __('Activate your license key below.', 'gravityview'); |
|
456 | + $status = __( 'is inactive', 'gravityview' ); |
|
457 | + $update_below = __( 'Activate your license key below.', 'gravityview' ); |
|
458 | 458 | break; |
459 | 459 | /** @noinspection PhpMissingBreakStatementInspection */ |
460 | 460 | case '': |
@@ -462,20 +462,20 @@ discard block |
||
462 | 462 | // break intentionally left blank |
463 | 463 | case 'inactive': |
464 | 464 | case 'site_inactive': |
465 | - $status = __('has not been activated', 'gravityview'); |
|
466 | - $update_below = __('Activate your license key below.', 'gravityview'); |
|
465 | + $status = __( 'has not been activated', 'gravityview' ); |
|
466 | + $update_below = __( 'Activate your license key below.', 'gravityview' ); |
|
467 | 467 | break; |
468 | 468 | } |
469 | - $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice'; |
|
469 | + $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice'; |
|
470 | 470 | |
471 | 471 | // Show a different notice on settings page for inactive licenses (hide the buttons) |
472 | - if( $update_below && gravityview_is_admin_page( '', 'settings' ) ) { |
|
472 | + if ( $update_below && gravityview_is_admin_page( '', 'settings' ) ) { |
|
473 | 473 | $message = sprintf( $message, $status, '<div class="hidden">', '', '', '</div><a href="#" onclick="jQuery(\'#license_key\').focus(); return false;">' . $update_below . '</a>' ); |
474 | 474 | } else { |
475 | 475 | $message = sprintf( $message, $status, "\n\n" . '<a href="' . esc_url( $primary_button_link ) . '" class="button button-primary">', '</a>', '<a href="' . esc_url( $url ) . '" class="button button-secondary">', '</a>' ); |
476 | 476 | } |
477 | 477 | |
478 | - if( !empty( $status ) ) { |
|
478 | + if ( ! empty( $status ) ) { |
|
479 | 479 | GravityView_Admin_Notices::add_notice( array( |
480 | 480 | 'message' => $message, |
481 | 481 | 'class' => 'updated', |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | public function scripts() { |
499 | 499 | $scripts = parent::scripts(); |
500 | 500 | |
501 | - $scripts[] = array( |
|
501 | + $scripts[ ] = array( |
|
502 | 502 | 'handle' => 'gform_tooltip_init', |
503 | 503 | 'enqueue' => array( |
504 | 504 | array( |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | |
519 | 519 | $styles = parent::styles(); |
520 | 520 | |
521 | - $styles[] = array( |
|
521 | + $styles[ ] = array( |
|
522 | 522 | 'handle' => 'gravityview_settings', |
523 | 523 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
524 | 524 | 'version' => GravityView_Plugin::version, |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | * @return void |
545 | 545 | */ |
546 | 546 | public function add_network_menu() { |
547 | - if( GravityView_Plugin::is_network_activated() ) { |
|
547 | + if ( GravityView_Plugin::is_network_activated() ) { |
|
548 | 548 | add_menu_page( __( 'Settings', 'gravityview' ), __( 'GravityView', 'gravityview' ), $this->_capabilities_app_settings, "{$this->_slug}_settings", array( $this, 'app_tab_page' ), 'none' ); |
549 | 549 | } |
550 | 550 | } |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | * If multisite and not network admin, we don't want the settings to show. |
562 | 562 | * @since 1.7.6 |
563 | 563 | */ |
564 | - $show_submenu = !is_multisite() || is_main_site() || !GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() ); |
|
564 | + $show_submenu = ! is_multisite() || is_main_site() || ! GravityView_Plugin::is_network_activated() || ( is_network_admin() && GravityView_Plugin::is_network_activated() ); |
|
565 | 565 | |
566 | 566 | /** |
567 | 567 | * Override whether to show the Settings menu on a per-blog basis. |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | */ |
571 | 571 | $show_submenu = apply_filters( 'gravityview/show-settings-menu', $show_submenu ); |
572 | 572 | |
573 | - if( $show_submenu ) { |
|
573 | + if ( $show_submenu ) { |
|
574 | 574 | add_submenu_page( 'edit.php?post_type=gravityview', __( 'Settings', 'gravityview' ), __( 'Settings', 'gravityview' ), $this->_capabilities_app_settings, $this->_slug . '_settings', array( $this, 'app_tab_page' ) ); |
575 | 575 | } |
576 | 576 | } |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | /** |
610 | 610 | * Backward compatibility with Redux |
611 | 611 | */ |
612 | - if( $setting_name === 'license' ) { |
|
612 | + if ( $setting_name === 'license' ) { |
|
613 | 613 | return array( |
614 | 614 | 'license' => parent::get_app_setting( 'license_key' ), |
615 | 615 | 'status' => parent::get_app_setting( 'license_key_status' ), |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | |
674 | 674 | $return = $text . $activation; |
675 | 675 | |
676 | - if( $echo ) { |
|
676 | + if ( $echo ) { |
|
677 | 677 | echo $return; |
678 | 678 | } |
679 | 679 | |
@@ -700,15 +700,15 @@ discard block |
||
700 | 700 | */ |
701 | 701 | public function settings_submit( $field, $echo = true ) { |
702 | 702 | |
703 | - $field['type'] = ( isset($field['type']) && in_array( $field['type'], array('submit','reset','button') ) ) ? $field['type'] : 'submit'; |
|
703 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
704 | 704 | |
705 | 705 | $attributes = $this->get_field_attributes( $field ); |
706 | 706 | $default_value = rgar( $field, 'value' ) ? rgar( $field, 'value' ) : rgar( $field, 'default_value' ); |
707 | - $value = $this->get_setting( $field['name'], $default_value ); |
|
707 | + $value = $this->get_setting( $field[ 'name' ], $default_value ); |
|
708 | 708 | |
709 | 709 | |
710 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton'; |
|
711 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_'.$field['name']; |
|
710 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton'; |
|
711 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
712 | 712 | |
713 | 713 | if ( empty( $value ) ) { |
714 | 714 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | $attributes = $this->get_field_attributes( $field ); |
718 | 718 | |
719 | 719 | $html = '<input |
720 | - type="' . $field['type'] . '" |
|
720 | + type="' . $field[ 'type' ] . '" |
|
721 | 721 | name="' . esc_attr( $name ) . '" |
722 | 722 | value="' . $value . '" ' . |
723 | 723 | implode( ' ', $attributes ) . |
@@ -739,12 +739,12 @@ discard block |
||
739 | 739 | * @return string |
740 | 740 | */ |
741 | 741 | public function settings_save( $field, $echo = true ) { |
742 | - $field['type'] = 'submit'; |
|
743 | - $field['name'] = 'gform-settings-save'; |
|
744 | - $field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton'; |
|
742 | + $field[ 'type' ] = 'submit'; |
|
743 | + $field[ 'name' ] = 'gform-settings-save'; |
|
744 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton'; |
|
745 | 745 | |
746 | 746 | if ( ! rgar( $field, 'value' ) ) { |
747 | - $field['value'] = __( 'Update Settings', 'gravityview' ); |
|
747 | + $field[ 'value' ] = __( 'Update Settings', 'gravityview' ); |
|
748 | 748 | } |
749 | 749 | |
750 | 750 | $output = $this->settings_submit( $field, false ); |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | $this->app_settings_uninstall_tab(); |
754 | 754 | $output .= ob_get_clean(); |
755 | 755 | |
756 | - if( $echo ) { |
|
756 | + if ( $echo ) { |
|
757 | 757 | echo $output; |
758 | 758 | } |
759 | 759 | |
@@ -778,8 +778,8 @@ discard block |
||
778 | 778 | */ |
779 | 779 | public function single_setting_row( $field ) { |
780 | 780 | |
781 | - $field['gv_description'] = rgar( $field, 'description' ); |
|
782 | - $field['description'] = rgar( $field, 'subtitle' ); |
|
781 | + $field[ 'gv_description' ] = rgar( $field, 'description' ); |
|
782 | + $field[ 'description' ] = rgar( $field, 'subtitle' ); |
|
783 | 783 | |
784 | 784 | parent::single_setting_row( $field ); |
785 | 785 | } |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | parent::single_setting_label( $field ); |
795 | 795 | |
796 | 796 | if ( $description = rgar( $field, 'gv_description' ) ) { |
797 | - echo '<span class="description">'. $description .'</span>'; |
|
797 | + echo '<span class="description">' . $description . '</span>'; |
|
798 | 798 | } |
799 | 799 | } |
800 | 800 | |
@@ -856,11 +856,11 @@ discard block |
||
856 | 856 | |
857 | 857 | // If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response), |
858 | 858 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
859 | - if( $local_key !== $response_key ) { |
|
859 | + if ( $local_key !== $response_key ) { |
|
860 | 860 | |
861 | - unset( $posted_settings['license_key_response'] ); |
|
862 | - unset( $posted_settings['license_key_status'] ); |
|
863 | - GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
861 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
862 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
863 | + GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
864 | 864 | } |
865 | 865 | |
866 | 866 | return $posted_settings; |
@@ -895,25 +895,25 @@ discard block |
||
895 | 895 | 'label' => __( 'License Key', 'gravityview' ), |
896 | 896 | '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' ) ), |
897 | 897 | 'type' => 'edd_license', |
898 | - 'data-pending-text' => __('Verifying license…', 'gravityview'), |
|
899 | - 'default_value' => $default_settings['license_key'], |
|
898 | + 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
|
899 | + 'default_value' => $default_settings[ 'license_key' ], |
|
900 | 900 | 'class' => ( '' == $this->get_app_setting( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
901 | 901 | ), |
902 | 902 | array( |
903 | 903 | 'name' => 'license_key_response', |
904 | - 'default_value' => $default_settings['license_key_response'], |
|
904 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
905 | 905 | 'type' => 'hidden', |
906 | 906 | ), |
907 | 907 | array( |
908 | 908 | 'name' => 'license_key_status', |
909 | - 'default_value' => $default_settings['license_key_status'], |
|
909 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
910 | 910 | 'type' => 'hidden', |
911 | 911 | ), |
912 | 912 | array( |
913 | 913 | 'name' => 'support-email', |
914 | 914 | 'type' => 'text', |
915 | 915 | 'validate' => 'email', |
916 | - 'default_value' => $default_settings['support-email'], |
|
916 | + 'default_value' => $default_settings[ 'support-email' ], |
|
917 | 917 | 'label' => __( 'Support Email', 'gravityview' ), |
918 | 918 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
919 | 919 | 'class' => 'code regular-text', |
@@ -925,53 +925,53 @@ discard block |
||
925 | 925 | 'name' => 'support_port', |
926 | 926 | 'type' => 'radio', |
927 | 927 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
928 | - 'default_value' => $default_settings['support_port'], |
|
928 | + 'default_value' => $default_settings[ 'support_port' ], |
|
929 | 929 | 'horizontal' => 1, |
930 | 930 | 'choices' => array( |
931 | 931 | array( |
932 | - 'label' => _x('Show', 'Setting: Show or Hide', 'gravityview'), |
|
932 | + 'label' => _x( 'Show', 'Setting: Show or Hide', 'gravityview' ), |
|
933 | 933 | 'value' => '1', |
934 | 934 | ), |
935 | 935 | array( |
936 | - 'label' => _x('Hide', 'Setting: Show or Hide', 'gravityview'), |
|
936 | + 'label' => _x( 'Hide', 'Setting: Show or Hide', 'gravityview' ), |
|
937 | 937 | 'value' => '0', |
938 | 938 | ), |
939 | 939 | ), |
940 | - 'tooltip' => '<p><img src="' . esc_url_raw( plugins_url('assets/images/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__('The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview') . '</p>', |
|
940 | + 'tooltip' => '<p><img src="' . esc_url_raw( plugins_url( 'assets/images/beacon.png', GRAVITYVIEW_FILE ) ) . '" alt="' . esc_attr__( 'The Support Port looks like this.', 'gravityview' ) . '" class="alignright" style="max-width:40px; margin:.5em;" />' . esc_html__( 'The Support Port provides quick access to how-to articles and tutorials. For administrators, it also makes it easy to contact support.', 'gravityview' ) . '</p>', |
|
941 | 941 | 'description' => __( 'Show the Support Port on GravityView pages?', 'gravityview' ), |
942 | 942 | ), |
943 | 943 | array( |
944 | 944 | 'name' => 'no-conflict-mode', |
945 | 945 | 'type' => 'radio', |
946 | 946 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
947 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
947 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
948 | 948 | 'horizontal' => 1, |
949 | 949 | 'choices' => array( |
950 | 950 | array( |
951 | - 'label' => _x('On', 'Setting: On or off', 'gravityview'), |
|
951 | + 'label' => _x( 'On', 'Setting: On or off', 'gravityview' ), |
|
952 | 952 | 'value' => '1', |
953 | 953 | ), |
954 | 954 | array( |
955 | - 'label' => _x('Off', 'Setting: On or off', 'gravityview'), |
|
955 | + 'label' => _x( 'Off', 'Setting: On or off', 'gravityview' ), |
|
956 | 956 | 'value' => '0', |
957 | 957 | ), |
958 | 958 | ), |
959 | - 'description' => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __('If your Edit View tabs are ugly, enable this setting.', 'gravityview'), |
|
959 | + 'description' => __( 'Set this to ON to prevent extraneous scripts and styles from being printed on GravityView admin pages, reducing conflicts with other plugins and themes.', 'gravityview' ) . ' ' . __( 'If your Edit View tabs are ugly, enable this setting.', 'gravityview' ), |
|
960 | 960 | ), |
961 | 961 | array( |
962 | 962 | 'name' => 'beta', |
963 | 963 | 'type' => 'checkbox', |
964 | 964 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
965 | - 'default_value' => $default_settings['beta'], |
|
965 | + 'default_value' => $default_settings[ 'beta' ], |
|
966 | 966 | 'horizontal' => 1, |
967 | 967 | 'choices' => array( |
968 | 968 | array( |
969 | - 'label' => _x('Show me beta versions if they are available.', 'gravityview'), |
|
969 | + 'label' => _x( 'Show me beta versions if they are available.', 'gravityview' ), |
|
970 | 970 | 'value' => '1', |
971 | 971 | 'name' => 'beta', |
972 | 972 | ), |
973 | 973 | ), |
974 | - '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'), |
|
974 | + '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' ), |
|
975 | 975 | ), |
976 | 976 | ) ); |
977 | 977 | |
@@ -982,20 +982,20 @@ discard block |
||
982 | 982 | * @since 1.7.4 |
983 | 983 | */ |
984 | 984 | foreach ( $fields as &$field ) { |
985 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : rgget('id', $field ); |
|
986 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : rgget('title', $field ); |
|
987 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : rgget('default', $field ); |
|
988 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : rgget('subtitle', $field ); |
|
985 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : rgget( 'id', $field ); |
|
986 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : rgget( 'title', $field ); |
|
987 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : rgget( 'default', $field ); |
|
988 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : rgget( 'subtitle', $field ); |
|
989 | 989 | |
990 | - if( $disabled_attribute ) { |
|
991 | - $field['disabled'] = $disabled_attribute; |
|
990 | + if ( $disabled_attribute ) { |
|
991 | + $field[ 'disabled' ] = $disabled_attribute; |
|
992 | 992 | } |
993 | 993 | } |
994 | 994 | |
995 | 995 | |
996 | 996 | $sections = array( |
997 | 997 | array( |
998 | - 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ), |
|
998 | + 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), GravityView_Plugin::version ) ), |
|
999 | 999 | 'fields' => $fields, |
1000 | 1000 | ) |
1001 | 1001 | ); |
@@ -1006,8 +1006,8 @@ discard block |
||
1006 | 1006 | 'type' => 'save', |
1007 | 1007 | ); |
1008 | 1008 | |
1009 | - if( $disabled_attribute ) { |
|
1010 | - $button['disabled'] = $disabled_attribute; |
|
1009 | + if ( $disabled_attribute ) { |
|
1010 | + $button[ 'disabled' ] = $disabled_attribute; |
|
1011 | 1011 | } |
1012 | 1012 | |
1013 | 1013 | |
@@ -1027,20 +1027,20 @@ discard block |
||
1027 | 1027 | // If there are extensions, add a section for them |
1028 | 1028 | if ( ! empty( $extension_sections ) ) { |
1029 | 1029 | |
1030 | - if( $disabled_attribute ) { |
|
1030 | + if ( $disabled_attribute ) { |
|
1031 | 1031 | foreach ( $extension_sections as &$section ) { |
1032 | - foreach ( $section['fields'] as &$field ) { |
|
1033 | - $field['disabled'] = $disabled_attribute; |
|
1032 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
1033 | + $field[ 'disabled' ] = $disabled_attribute; |
|
1034 | 1034 | } |
1035 | 1035 | } |
1036 | 1036 | } |
1037 | 1037 | |
1038 | - $k = count( $extension_sections ) - 1 ; |
|
1039 | - $extension_sections[ $k ]['fields'][] = $button; |
|
1038 | + $k = count( $extension_sections ) - 1; |
|
1039 | + $extension_sections[ $k ][ 'fields' ][ ] = $button; |
|
1040 | 1040 | $sections = array_merge( $sections, $extension_sections ); |
1041 | 1041 | } else { |
1042 | 1042 | // add the 'update settings' button to the general section |
1043 | - $sections[0]['fields'][] = $button; |
|
1043 | + $sections[ 0 ][ 'fields' ][ ] = $button; |
|
1044 | 1044 | } |
1045 | 1045 | |
1046 | 1046 | return $sections; |