PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.2.06
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.2.06
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/helpers/FrmTipsHelper.php +27 -98 6.5.25.2.06 View file →
@@ -4,14 +4,8 @@
4 4 }
5 5
6 6 class FrmTipsHelper {
7 7
8 - /**
9 - * @param string $callback
10 - * @param string $html
11 - *
12 - * @return void
13 - */
14 8 public static function pro_tip( $callback, $html = '' ) {
15 9 if ( FrmAppHelper::pro_is_installed() ) {
16 10 return;
17 11 }
@@ -18,53 +12,29 @@
18 12
19 13 $tips = self::$callback();
20 14 $tip = self::get_random_tip( $tips );
21 15
22 - self::show_tip( $tip, $html );
23 - }
16 + if ( 'p' === $html ) {
17 + echo '<p class="frmcenter frm_no_top_margin">';
18 + }
24 19
25 - /**
26 - * Shows tip.
27 - *
28 - * @since 6.0
29 - *
30 - * @param array $tip {
31 - * Tip args
32 - *
33 - * @type array $link Tip link data. See the first parameter of {@see FrmAppHelper::admin_upgrade_link()} for more details.
34 - * @type string $page The based link of the tip. If this is empty, `https://formidableforms.com/lite-upgrade/` will
35 - * be used. Otherwise, `https://formidableforms.com/{$page}` will be used.
36 - * @type string $tip Tip text.
37 - * @type string $call Call to action text.
38 - * }
39 - * @param string $html
40 - *
41 - * @return void
42 - */
43 - public static function show_tip( $tip, $html = '' ) {
44 - $defaults = array(
45 - 'page' => '',
46 - 'class' => 'frm-mt-0',
47 - );
48 - $tip = array_merge( $defaults, $tip );
49 -
50 - if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) {
20 + if ( ! isset( $tip['page'] ) ) {
21 + $tip['page'] = '';
22 + }
23 + if ( ! isset( $tip['link']['medium'] ) ) {
51 24 $tip['link']['medium'] = 'tip';
52 25 }
53 26
54 - if ( 'p' === $html ) {
55 - echo '<p class="frmcenter ' . esc_attr( $tip['class'] ) . '">';
56 - }
57 -
58 - $link = empty( $tip['link'] ) ? $tip['page'] : FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] );
27 + $link = FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] );
59 28 ?>
60 - <a href="<?php echo esc_url( $link ); ?>" <?php echo empty( $tip['link'] ) ? '' : 'target="_blank"'; ?> class="frm_pro_tip">
61 - <?php FrmAppHelper::icon_by_class( 'frmfont frm_lightning', array( 'aria-hidden' => 'true' ) ); ?>
29 + <a href="<?php echo esc_url( $link ); ?>" target="_blank" class="frm_pro_tip">
30 + <?php FrmAppHelper::icon_by_class( 'frmfont frm_star_full_icon', array( 'aria-hidden' => 'true' ) ); ?>
31 + <span class="pro-tip">
32 + <?php esc_html_e( 'Pro Tip:', 'formidable' ); ?>
33 + </span>
62 34
63 35 <?php if ( isset( $tip['call'] ) ) { ?>
64 - <span class="frm-tip-info">
65 - <?php echo esc_html( $tip['tip'] ); ?>
66 - </span>
36 + <?php echo esc_html( $tip['tip'] ); ?>
67 37 <span class="frm-tip-cta">
68 38 <?php echo esc_html( $tip['call'] ); ?>
69 39 </span>
70 40 <?php } else { ?>
@@ -73,28 +43,13 @@
73 43 </span>
74 44 <?php } ?>
75 45 </a>
76 46 <?php
77 -
78 47 if ( 'p' === $html ) {
79 48 echo '</p>';
80 49 }
81 50 }
82 51
83 - /**
84 - * Use the correct label for the license.
85 - *
86 - * @since 6.5.1
87 - *
88 - * @return string
89 - */
90 - private static function cta_label() {
91 - return FrmAddonsController::is_license_expired() ? __( 'Renew', 'formidable' ) : __( 'Upgrade to Pro.', 'formidable' );
92 - }
93 -
94 - /**
95 - * @return array
96 - */
97 52 public static function get_builder_tip() {
98 53 $tips = array(
99 54 array(
100 55 'link' => array(
@@ -101,9 +56,9 @@
101 56 'content' => 'conditional-logic',
102 57 'param' => 'conditional-logic-wordpress-forms',
103 58 ),
104 59 'tip' => __( 'Use conditional logic to shorten your forms and increase conversions.', 'formidable' ),
105 - 'call' => self::cta_label(),
60 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
106 61 ),
107 62 array(
108 63 'link' => array(
109 64 'content' => 'confirmation-fields',
@@ -117,9 +72,9 @@
117 72 'content' => 'page-breaks',
118 73 'param' => 'wordpress-multi-page-forms',
119 74 ),
120 75 'tip' => __( 'Use page breaks for easier forms.', 'formidable' ),
121 - 'call' => self::cta_label(),
76 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
122 77 ),
123 78 array(
124 79 'link' => array(
125 80 'content' => 'file-uploads',
@@ -133,9 +88,9 @@
133 88 'content' => 'calculations',
134 89 'param' => 'field-calculations-wordpress-form',
135 90 ),
136 91 'tip' => __( 'Need to calculate a total?', 'formidable' ),
137 - 'call' => self::cta_label(),
92 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
138 93 ),
139 94 array(
140 95 'link' => array(
141 96 'content' => 'prefill-fields',
@@ -148,11 +103,8 @@
148 103
149 104 return $tips;
150 105 }
151 106
152 - /**
153 - * @return array
154 - */
155 107 public static function get_form_settings_tip() {
156 108 $tips = array(
157 109 array(
158 110 'link' => array(
@@ -182,11 +134,8 @@
182 134
183 135 return $tips;
184 136 }
185 137
186 - /**
187 - * @return array
188 - */
189 138 public static function get_form_action_tip() {
190 139 $tips = array(
191 140 array(
192 141 'link' => array(
@@ -201,9 +150,9 @@
201 150 'content' => 'create-posts',
202 151 'param' => 'create-posts-pages-wordpress-forms',
203 152 ),
204 153 'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
205 - 'call' => self::cta_label(),
154 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
206 155 ),
207 156 array(
208 157 'link' => array(
209 158 'content' => 'user-submit',
@@ -209,9 +158,9 @@
209 158 'content' => 'user-submit',
210 159 'param' => 'create-posts-pages-wordpress-forms',
211 160 ),
212 161 'tip' => __( 'Let your users submit posts on the front-end.', 'formidable' ),
213 - 'call' => self::cta_label(),
162 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
214 163 ),
215 164 array(
216 165 'link' => array(
217 166 'content' => 'mailchimp',
@@ -217,9 +166,9 @@
217 166 'content' => 'mailchimp',
218 167 'page' => 'mailchimp-tip',
219 168 ),
220 169 'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
221 - 'call' => __( 'Send leads straight to Mailchimp.', 'formidable' ),
170 + 'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
222 171 ),
223 172 array(
224 173 'link' => array(
225 174 'content' => 'paypal-revenue',
@@ -267,24 +216,13 @@
267 216 ),
268 217 'tip' => __( 'Send an SMS message when a form is submitted.', 'formidable' ),
269 218 'call' => __( 'Get the Twilio integration.', 'formidable' ),
270 219 ),
271 - array(
272 - 'link' => array(
273 - 'content' => 'acf-tip',
274 - 'param' => 'acf-tip',
275 - ),
276 - 'tip' => __( 'Fill Advanced Custom Fields from a form.', 'formidable' ),
277 - 'call' => __( 'Add ACF Integration', 'formidable' ),
278 - ),
279 220 );
280 221
281 222 return $tips;
282 223 }
283 224
284 - /**
285 - * @return array
286 - */
287 225 public static function get_styling_tip() {
288 226 $tips = array(
289 227 array(
290 228 'link' => array(
@@ -299,17 +237,17 @@
299 237 'content' => 'style',
300 238 'param' => 'bg-image-style-settings',
301 239 ),
302 240 'tip' => __( 'Want to add a background image?', 'formidable' ),
303 - 'call' => self::cta_label(),
241 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
304 242 ),
305 243 array(
306 244 'link' => array(
307 245 'content' => 'style',
308 - 'param' => 'duplicate-style',
246 + 'param' => 'bg-image-style-settings',
309 247 ),
310 - 'tip' => __( 'Want to duplicate a style?', 'formidable' ),
311 - 'call' => self::cta_label(),
248 + 'tip' => __( 'Want to set a color with an alpha slider?', 'formidable' ),
249 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
312 250 ),
313 251 );
314 252
315 253 return $tips;
@@ -314,11 +252,8 @@
314 252
315 253 return $tips;
316 254 }
317 255
318 - /**
319 - * @return array
320 - */
321 256 public static function get_entries_tip() {
322 257 $tips = array(
323 258 array(
324 259 'link' => array(
@@ -333,9 +268,9 @@
333 268 'content' => 'entries-search',
334 269 'param' => 'form-entry-management-wordpress',
335 270 ),
336 271 'tip' => __( 'Want to search submitted entries?', 'formidable' ),
337 - 'call' => self::cta_label(),
272 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
338 273 ),
339 274 array(
340 275 'link' => array(
341 276 'content' => 'views',
@@ -349,11 +284,8 @@
349 284
350 285 return $tips;
351 286 }
352 287
353 - /**
354 - * @return array
355 - */
356 288 public static function get_import_tip() {
357 289 $tips = array(
358 290 array(
359 291 'link' => array(
@@ -360,9 +292,9 @@
360 292 'content' => 'import',
361 293 'param' => 'importing-exporting-wordpress-forms',
362 294 ),
363 295 'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
364 - 'call' => self::cta_label(),
296 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
365 297 ),
366 298 );
367 299
368 300 return $tips;
@@ -367,11 +299,8 @@
367 299
368 300 return $tips;
369 301 }
370 302
371 - /**
372 - * @return array
373 - */
374 303 public static function get_banner_tip() {
375 304 $tips = array(
376 305 array(
377 306 'link' => array(
@@ -394,9 +323,9 @@
394 323 'medium' => 'banner',
395 324 'content' => 'automate',
396 325 ),
397 326 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
398 - 'call' => __( 'Collect instant payments, and send leads to Mailchimp.', 'formidable' ),
327 + 'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
399 328 ),
400 329 );
401 330 $random = rand( 0, count( $tips ) - 1 );
402 331 $tip = $tips[ $random ];