| @@ -28,15 +28,15 @@ | ||
| 28 | 28 | /** |
| 29 | 29 | * @since 6.15 |
| 30 | 30 | */ |
| 31 | 31 | public static function load_admin_hooks() { |
| 32 | - add_action( 'admin_menu', self::class . '::menu', 100 ); | |
| 33 | - add_filter( 'pre_set_site_transient_update_plugins', self::class . '::check_update' ); | |
| 32 | + add_action( 'admin_menu', __CLASS__ . '::menu', 100 ); | |
| 33 | + add_filter( 'pre_set_site_transient_update_plugins', __CLASS__ . '::check_update' ); | |
| 34 | 34 | |
| 35 | 35 | if ( FrmAppHelper::is_admin_page( 'formidable-addons' ) ) { |
| 36 | 36 | self::$request_addon_url = 'https://connect.formidableforms.com/add-on-request/'; |
| 37 | 37 | |
| 38 | - add_action( 'admin_enqueue_scripts', self::class . '::enqueue_assets', 15 ); | |
| 38 | + add_action( 'admin_enqueue_scripts', __CLASS__ . '::enqueue_assets', 15 ); | |
| 39 | 39 | add_filter( 'frm_show_footer_links', '__return_false' ); |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| @@ -96,9 +96,9 @@ | ||
| 96 | 96 | return; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $label = __( 'Add-Ons', 'formidable' ); |
| 100 | - $label = '<span style="color:#3FCA89">' . esc_html( $label ) . '</span>'; | |
| 100 | + $label = '<span style="color:#3FCA89">' . $label . '</span>'; | |
| 101 | 101 | |
| 102 | 102 | add_submenu_page( 'formidable', 'Formidable | ' . __( 'Add-Ons', 'formidable' ), $label, 'frm_view_forms', 'formidable-addons', 'FrmAddonsController::list_addons' ); |
| 103 | 103 | |
| 104 | 104 | // remove default created subpage, make the page with highest priority as default. |
| @@ -104,17 +104,12 @@ | ||
| 104 | 104 | // remove default created subpage, make the page with highest priority as default. |
| 105 | 105 | remove_submenu_page( 'formidable', 'formidable' ); |
| 106 | 106 | |
| 107 | 107 | if ( ! FrmAppHelper::pro_is_installed() ) { |
| 108 | - $cta_text = FrmSalesApi::get_best_sale_value( 'menu_cta_text' ); | |
| 109 | - if ( ! $cta_text ) { | |
| 110 | - $cta_text = __( 'Upgrade', 'formidable' ); | |
| 111 | - } | |
| 112 | - | |
| 113 | 108 | add_submenu_page( |
| 114 | 109 | 'formidable', |
| 115 | 110 | 'Formidable | ' . __( 'Upgrade', 'formidable' ), |
| 116 | - '<span class="frm-upgrade-submenu">' . esc_html( $cta_text ) . '</span>', | |
| 111 | + '<span class="frm-upgrade-submenu">' . __( 'Upgrade', 'formidable' ) . '</span>', | |
| 117 | 112 | 'frm_view_forms', |
| 118 | 113 | 'formidable-pro-upgrade', |
| 119 | 114 | function () { |
| 120 | 115 | // This function doesn't need to do anything. |
| @@ -123,9 +118,9 @@ | ||
| 123 | 118 | ); |
| 124 | 119 | } elseif ( 'formidable-pro-upgrade' === FrmAppHelper::get_param( 'page' ) ) { |
| 125 | 120 | wp_safe_redirect( admin_url( 'admin.php?page=formidable' ) ); |
| 126 | 121 | exit; |
| 127 | - }//end if | |
| 122 | + } | |
| 128 | 123 | } |
| 129 | 124 | |
| 130 | 125 | /** |
| 131 | 126 | * @return void |
| @@ -142,9 +137,9 @@ | ||
| 142 | 137 | |
| 143 | 138 | if ( isset( $addons['error'] ) ) { |
| 144 | 139 | $api = new FrmFormApi(); |
| 145 | 140 | $errors = $api->get_error_from_response( $addons ); |
| 146 | - $license_type = $addons['error']['type'] ?? ''; | |
| 141 | + $license_type = isset( $addons['error']['type'] ) ? $addons['error']['type'] : ''; | |
| 147 | 142 | unset( $addons['error'] ); |
| 148 | 143 | } |
| 149 | 144 | |
| 150 | 145 | $pro = array( |
| @@ -414,9 +409,9 @@ | ||
| 414 | 409 | $api = new FrmFormApi( $license ); |
| 415 | 410 | $downloads = $api->get_api_info(); |
| 416 | 411 | $pro = self::get_pro_from_addons( $downloads ); |
| 417 | 412 | |
| 418 | - return $pro['url'] ?? ''; | |
| 413 | + return isset( $pro['url'] ) ? $pro['url'] : ''; | |
| 419 | 414 | } |
| 420 | 415 | |
| 421 | 416 | /** |
| 422 | 417 | * @since 4.08 |
| @@ -452,9 +447,9 @@ | ||
| 452 | 447 | * @param array $addons |
| 453 | 448 | * @return array |
| 454 | 449 | */ |
| 455 | 450 | protected static function get_pro_from_addons( $addons ) { |
| 456 | - return $addons['93790'] ?? array(); | |
| 451 | + return isset( $addons['93790'] ) ? $addons['93790'] : array(); | |
| 457 | 452 | } |
| 458 | 453 | |
| 459 | 454 | /** |
| 460 | 455 | * @since 4.06 |
| @@ -477,9 +472,9 @@ | ||
| 477 | 472 | if ( ! isset( $version_info['error'] ) ) { |
| 478 | 473 | return false; |
| 479 | 474 | } |
| 480 | 475 | |
| 481 | - $expires = $version_info['error']['expires'] ?? 0; | |
| 476 | + $expires = isset( $version_info['error']['expires'] ) ? $version_info['error']['expires'] : 0; | |
| 482 | 477 | if ( empty( $expires ) || $expires > time() ) { |
| 483 | 478 | return false; |
| 484 | 479 | } |
| 485 | 480 | |
| @@ -548,10 +543,10 @@ | ||
| 548 | 543 | // don't show an update if the plugin isn't installed |
| 549 | 544 | continue; |
| 550 | 545 | } |
| 551 | 546 | |
| 552 | - $wp_plugin = $wp_plugins[ $folder ] ?? array(); | |
| 553 | - $wp_version = $wp_plugin['Version'] ?? '1.0'; | |
| 547 | + $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); | |
| 548 | + $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0'; | |
| 554 | 549 | $plugin->slug = explode( '/', $folder )[0]; |
| 555 | 550 | |
| 556 | 551 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 557 | 552 | $transient->response[ $folder ] = $plugin; |
| @@ -629,9 +624,9 @@ | ||
| 629 | 624 | if ( empty( $plugin ) ) { |
| 630 | 625 | continue; |
| 631 | 626 | } |
| 632 | 627 | |
| 633 | - $download_id = $plugin['id'] ?? 0; | |
| 628 | + $download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0; | |
| 634 | 629 | if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
| 635 | 630 | // if this addon is using its own license, get the update url |
| 636 | 631 | $addon_info = $api->get_api_info(); |
| 637 | 632 | |
| @@ -973,9 +968,9 @@ | ||
| 973 | 968 | if ( ! function_exists( 'request_filesystem_credentials' ) ) { |
| 974 | 969 | include_once ABSPATH . 'wp-admin/includes/file.php'; |
| 975 | 970 | } |
| 976 | 971 | |
| 977 | - // Start output buffering to catch the filesystem form if credentials are needed. | |
| 972 | + // Start output bufferring to catch the filesystem form if credentials are needed. | |
| 978 | 973 | ob_start(); |
| 979 | 974 | |
| 980 | 975 | $show_form = false; |
| 981 | 976 | $method = ''; |
| @@ -1415,9 +1410,8 @@ | ||
| 1415 | 1410 | */ |
| 1416 | 1411 | public static function addon_upgrade_link( $addon, $upgrade_link ) { |
| 1417 | 1412 | $atts = is_array( $upgrade_link ) ? $upgrade_link : array(); |
| 1418 | 1413 | $upgrade_link = is_array( $upgrade_link ) ? $upgrade_link['link'] : $upgrade_link; |
| 1419 | - $text = ! empty( $atts['text'] ) ? $atts['text'] : __( 'Upgrade Now', 'formidable' ); | |
| 1420 | 1414 | |
| 1421 | 1415 | if ( $addon ) { |
| 1422 | 1416 | $upgrade_link .= '&utm_content=' . $addon['slug']; |
| 1423 | 1417 | } |
| @@ -1432,9 +1426,9 @@ | ||
| 1432 | 1426 | $class .= ' frm-button-secondary frm-button-sm'; |
| 1433 | 1427 | } |
| 1434 | 1428 | ?> |
| 1435 | 1429 | <a class="install-now button <?php echo esc_attr( $class ); ?>" href="<?php echo esc_url( $upgrade_link ); ?>" target="_blank" rel="noopener" aria-label="<?php esc_attr_e( 'Upgrade Now', 'formidable' ); ?>"> |
| 1436 | - <?php echo esc_html( $text ); ?> | |
| 1430 | + <?php esc_html_e( 'Upgrade Now', 'formidable' ); ?> | |
| 1437 | 1431 | </a> |
| 1438 | 1432 | <?php |
| 1439 | 1433 | } |
| 1440 | 1434 | |