| @@ -35,9 +35,8 @@ | ||
| 35 | 35 | * be used. Otherwise, `https://formidableforms.com/{$page}` will be used. |
| 36 | 36 | * @type string $tip Tip text. |
| 37 | 37 | * @type string $call Call to action text. |
| 38 | 38 | * } |
| 39 | - * | |
| 40 | 39 | * @param string $html |
| 41 | 40 | * |
| 42 | 41 | * @return void |
| 43 | 42 | */ |
| @@ -80,9 +79,8 @@ | ||
| 80 | 79 | /** |
| 81 | 80 | * @since 6.21 |
| 82 | 81 | * |
| 83 | 82 | * @param array $tip |
| 84 | - * | |
| 85 | 83 | * @return string |
| 86 | 84 | */ |
| 87 | 85 | private static function get_tip_link( $tip ) { |
| 88 | 86 | if ( empty( $tip['tip'] ) ) { |
| @@ -89,9 +87,8 @@ | ||
| 89 | 87 | return $tip['page']; |
| 90 | 88 | } |
| 91 | 89 | |
| 92 | 90 | $cta_link = FrmSalesApi::get_best_sale_value( 'pro_tip_cta_link' ); |
| 93 | - | |
| 94 | 91 | if ( $cta_link ) { |
| 95 | 92 | if ( is_array( $tip['link'] ) ) { |
| 96 | 93 | $cta_link = FrmAppHelper::maybe_add_missing_utm( $cta_link, $tip['link'] ); |
| 97 | 94 | } |
| @@ -109,9 +106,8 @@ | ||
| 109 | 106 | * @return string |
| 110 | 107 | */ |
| 111 | 108 | private static function cta_label() { |
| 112 | 109 | $cta_text = FrmSalesApi::get_best_sale_value( 'pro_tip_cta_text' ); |
| 113 | - | |
| 114 | 110 | if ( $cta_text ) { |
| 115 | 111 | return $cta_text; |
| 116 | 112 | } |
| 117 | 113 | return FrmAddonsController::is_license_expired() ? __( 'Renew', 'formidable' ) : __( 'Upgrade to Pro.', 'formidable' ); |
| @@ -393,21 +389,11 @@ | ||
| 393 | 389 | |
| 394 | 390 | return $tips; |
| 395 | 391 | } |
| 396 | 392 | |
| 397 | - /** | |
| 398 | - * @param array $tips | |
| 399 | - * | |
| 400 | - * @return array | |
| 401 | - */ | |
| 402 | 393 | public static function get_random_tip( $tips ) { |
| 403 | - $count = count( $tips ); | |
| 394 | + $random = rand( 0, count( $tips ) - 1 ); | |
| 404 | 395 | |
| 405 | - if ( $count === 0 ) { | |
| 406 | - return array(); | |
| 407 | - } | |
| 408 | - | |
| 409 | - $random = random_int( 0, $count - 1 ); | |
| 410 | 396 | return $tips[ $random ]; |
| 411 | 397 | } |
| 412 | 398 | |
| 413 | 399 | /** |