PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.2
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 +94 -165 6.266.2 View file →
@@ -18,9 +18,9 @@
18 18
19 19 $tips = self::$callback();
20 20 $tip = self::get_random_tip( $tips );
21 21
22 - self::show_tip( $tip, $html );
22 + self::show_tip( $tip );
23 23 }
24 24
25 25 /**
26 26 * Shows tip.
@@ -26,10 +26,10 @@
26 26 * Shows tip.
27 27 *
28 28 * @since 6.0
29 29 *
30 - * @param array $tip {
31 - * Tip args.
30 + * @param array $tip {
31 + * Tip args
32 32 *
33 33 * @type array $link Tip link data. See the first parameter of {@see FrmAppHelper::admin_upgrade_link()} for more details.
34 34 * @type string $page The based link of the tip. If this is empty, `https://formidableforms.com/lite-upgrade/` will
35 35 * be used. Otherwise, `https://formidableforms.com/{$page}` will be used.
@@ -35,41 +35,41 @@
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 */
44 43 public static function show_tip( $tip, $html = '' ) {
45 - $defaults = array(
46 - 'page' => '',
47 - 'class' => 'frm-mt-0',
48 - );
49 - $tip = array_merge( $defaults, $tip );
50 -
44 + if ( ! isset( $tip['page'] ) ) {
45 + $tip['page'] = '';
46 + }
51 47 if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) {
52 48 $tip['link']['medium'] = 'tip';
53 49 }
54 50
55 51 if ( 'p' === $html ) {
56 - echo '<p class="frmcenter ' . esc_attr( $tip['class'] ) . '">';
52 + echo '<p class="frmcenter frm-mt-0">';
57 53 }
58 54
59 - $link = self::get_tip_link( $tip );
55 + $link = empty( $tip['link'] ) ? $tip['page'] : FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] );
60 56 ?>
61 - <a href="<?php echo esc_url( $link ); ?>" <?php echo empty( $tip['link'] ) ? '' : 'target="_blank"'; ?> class="frm_pro_tip frm-gradient">
62 - <span class="frm-tip-badge"><?php esc_html_e( 'PRO TIP', 'formidable' ); ?></span>
57 + <a href="<?php echo esc_url( $link ); ?>" <?php echo empty( $tip['link'] ) ? '' : 'target="_blank"'; ?> class="frm_pro_tip">
58 + <?php FrmAppHelper::icon_by_class( 'frmfont frm_lightning', array( 'aria-hidden' => 'true' ) ); ?>
63 59
64 60 <?php if ( isset( $tip['call'] ) ) { ?>
65 61 <span class="frm-tip-info">
66 62 <?php echo esc_html( $tip['tip'] ); ?>
67 63 </span>
64 + <span class="frm-tip-cta">
65 + <?php echo esc_html( $tip['call'] ); ?>
66 + </span>
67 + <?php } else { ?>
68 + <span class="frm-tip-cta">
69 + <?php echo esc_html( $tip['tip'] ); ?>
70 + </span>
68 71 <?php } ?>
69 - <span class="frm-tip-cta">
70 - <?php echo esc_html( $tip['call'] ? $tip['call'] : $tip['tip'] ); ?>
71 - </span>
72 72 </a>
73 73 <?php
74 74
75 75 if ( 'p' === $html ) {
@@ -77,48 +77,8 @@
77 77 }
78 78 }
79 79
80 80 /**
81 - * @since 6.21
82 - *
83 - * @param array $tip
84 - *
85 - * @return string
86 - */
87 - private static function get_tip_link( $tip ) {
88 - if ( empty( $tip['tip'] ) ) {
89 - return $tip['page'];
90 - }
91 -
92 - $cta_link = FrmSalesApi::get_best_sale_value( 'pro_tip_cta_link' );
93 -
94 - if ( $cta_link ) {
95 - if ( is_array( $tip['link'] ) ) {
96 - $cta_link = FrmAppHelper::maybe_add_missing_utm( $cta_link, $tip['link'] );
97 - }
98 - return $cta_link;
99 - }
100 -
101 - return FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] );
102 - }
103 -
104 - /**
105 - * Use the correct label for the license.
106 - *
107 - * @since 6.5.1
108 - *
109 - * @return string
110 - */
111 - private static function cta_label() {
112 - $cta_text = FrmSalesApi::get_best_sale_value( 'pro_tip_cta_text' );
113 -
114 - if ( $cta_text ) {
115 - return $cta_text;
116 - }
117 - return FrmAddonsController::is_license_expired() ? __( 'Renew', 'formidable' ) : __( 'Upgrade to Pro.', 'formidable' );
118 - }
119 -
120 - /**
121 81 * @return array
122 82 */
123 83 public static function get_builder_tip() {
124 84 $tips = array(
@@ -127,9 +87,9 @@
127 87 'content' => 'conditional-logic',
128 88 'param' => 'conditional-logic-wordpress-forms',
129 89 ),
130 90 'tip' => __( 'Use conditional logic to shorten your forms and increase conversions.', 'formidable' ),
131 - 'call' => self::cta_label(),
91 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
132 92 ),
133 93 array(
134 94 'link' => array(
135 95 'content' => 'confirmation-fields',
@@ -134,10 +94,10 @@
134 94 'link' => array(
135 95 'content' => 'confirmation-fields',
136 96 'param' => 'confirmation-fields-wordpress-forms',
137 97 ),
138 - 'tip' => __( 'Eliminate input errors with email confirmation fields.', 'formidable' ),
139 - 'call' => self::cta_label(),
98 + 'tip' => __( 'Want to stop losing leads from email typos?', 'formidable' ),
99 + 'call' => __( 'Add email confirmation fields.', 'formidable' ),
140 100 ),
141 101 array(
142 102 'link' => array(
143 103 'content' => 'page-breaks',
@@ -143,9 +103,9 @@
143 103 'content' => 'page-breaks',
144 104 'param' => 'wordpress-multi-page-forms',
145 105 ),
146 106 'tip' => __( 'Use page breaks for easier forms.', 'formidable' ),
147 - 'call' => self::cta_label(),
107 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
148 108 ),
149 109 array(
150 110 'link' => array(
151 111 'content' => 'file-uploads',
@@ -150,10 +110,10 @@
150 110 'link' => array(
151 111 'content' => 'file-uploads',
152 112 'param' => 'wordpress-multi-file-upload-fields',
153 113 ),
154 - 'tip' => __( 'Skip the follow-ups. Let users upload files.', 'formidable' ),
155 - 'call' => self::cta_label(),
114 + 'tip' => __( 'Cut down on back-and-forth with clients.', 'formidable' ),
115 + 'call' => __( 'Allow file uploads in your form.', 'formidable' ),
156 116 ),
157 117 array(
158 118 'link' => array(
159 119 'content' => 'calculations',
@@ -159,9 +119,9 @@
159 119 'content' => 'calculations',
160 120 'param' => 'field-calculations-wordpress-form',
161 121 ),
162 122 'tip' => __( 'Need to calculate a total?', 'formidable' ),
163 - 'call' => self::cta_label(),
123 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
164 124 ),
165 125 array(
166 126 'link' => array(
167 127 'content' => 'prefill-fields',
@@ -166,10 +126,10 @@
166 126 'link' => array(
167 127 'content' => 'prefill-fields',
168 128 'param' => 'auto-fill-forms',
169 129 ),
170 - 'tip' => __( 'Save time with autofill forms.', 'formidable' ),
171 - 'call' => self::cta_label(),
130 + 'tip' => __( 'Save time.', 'formidable' ),
131 + 'call' => __( 'Fill out forms automatically!', 'formidable' ),
172 132 ),
173 133 );
174 134
175 135 return $tips;
@@ -184,10 +144,10 @@
184 144 'link' => array(
185 145 'content' => 'front-edit-b',
186 146 'param' => 'wordpress-front-end-editing',
187 147 ),
188 - 'tip' => __( 'Make your site dynamic. Enable front-end editing.', 'formidable' ),
189 - 'call' => self::cta_label(),
148 + 'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
149 + 'call' => __( 'Add front-end editing.', 'formidable' ),
190 150 ),
191 151 array(
192 152 'link' => array(
193 153 'content' => 'save-drafts',
@@ -192,10 +152,10 @@
192 152 'link' => array(
193 153 'content' => 'save-drafts',
194 154 'param' => 'save-drafts-wordpress-form',
195 155 ),
196 - 'tip' => __( 'Long form? Let users save and finish later', 'formidable' ),
197 - 'call' => self::cta_label(),
156 + 'tip' => __( 'Have long forms?', 'formidable' ),
157 + 'call' => __( 'Let users save drafts and return later!', 'formidable' ),
198 158 ),
199 159 array(
200 160 'link' => array(
201 161 'content' => 'form-scheduling',
@@ -200,10 +160,10 @@
200 160 'link' => array(
201 161 'content' => 'form-scheduling',
202 162 'param' => 'schedule-forms-wordpress',
203 163 ),
204 - 'tip' => __( 'Limit form access with built-in scheduling.', 'formidable' ),
205 - 'call' => self::cta_label(),
164 + 'tip' => __( 'Want your form open only for a certain time period?', 'formidable' ),
165 + 'call' => __( 'Add form scheduling.', 'formidable' ),
206 166 ),
207 167 );
208 168
209 169 return $tips;
@@ -218,10 +178,10 @@
218 178 'link' => array(
219 179 'content' => 'email-routing',
220 180 'param' => 'virtually-unlimited-emails',
221 181 ),
222 - 'tip' => __( 'Save time — route emails to the right person automatically.', 'formidable' ),
223 - 'call' => self::cta_label(),
182 + 'tip' => __( 'Save time by sending the email to the right person automatically.', 'formidable' ),
183 + 'call' => __( 'Add email routing.', 'formidable' ),
224 184 ),
225 185 array(
226 186 'link' => array(
227 187 'content' => 'create-posts',
@@ -227,9 +187,9 @@
227 187 'content' => 'create-posts',
228 188 'param' => 'create-posts-pages-wordpress-forms',
229 189 ),
230 190 'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
231 - 'call' => self::cta_label(),
191 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
232 192 ),
233 193 array(
234 194 'link' => array(
235 195 'content' => 'user-submit',
@@ -235,9 +195,9 @@
235 195 'content' => 'user-submit',
236 196 'param' => 'create-posts-pages-wordpress-forms',
237 197 ),
238 198 'tip' => __( 'Let your users submit posts on the front-end.', 'formidable' ),
239 - 'call' => self::cta_label(),
199 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
240 200 ),
241 201 array(
242 202 'link' => array(
243 203 'content' => 'mailchimp',
@@ -242,10 +202,10 @@
242 202 'link' => array(
243 203 'content' => 'mailchimp',
244 204 'page' => 'mailchimp-tip',
245 205 ),
246 - 'tip' => __( 'Send leads to Mailchimp for instant email follow-up.', 'formidable' ),
247 - 'call' => self::cta_label(),
206 + 'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
207 + 'call' => __( 'Send leads straight to Mailchimp.', 'formidable' ),
248 208 ),
249 209 array(
250 210 'link' => array(
251 211 'content' => 'paypal-revenue',
@@ -250,10 +210,10 @@
250 210 'link' => array(
251 211 'content' => 'paypal-revenue',
252 212 'page' => 'paypal-increase-revenue-tip',
253 213 ),
254 - 'tip' => __( 'Accept PayPal payments and grow your sales.', 'formidable' ),
255 - 'call' => self::cta_label(),
214 + 'tip' => __( 'Increase revenue.', 'formidable' ),
215 + 'call' => __( 'Use PayPal with this form.', 'formidable' ),
256 216 ),
257 217 array(
258 218 'link' => array(
259 219 'content' => 'paypal-fast',
@@ -258,10 +218,10 @@
258 218 'link' => array(
259 219 'content' => 'paypal-fast',
260 220 'page' => 'paypal-save-time-tip',
261 221 ),
262 - 'tip' => __( 'Accept payments now with PayPal integration.', 'formidable' ),
263 - 'call' => self::cta_label(),
222 + 'tip' => __( 'Get paid instantly.', 'formidable' ),
223 + 'call' => __( 'Use Paypal with this form.', 'formidable' ),
264 224 ),
265 225 array(
266 226 'link' => array(
267 227 'content' => 'registration',
@@ -274,10 +234,10 @@
274 234 'link' => array(
275 235 'content' => 'profile',
276 236 'page' => 'registration-profile-editing-tip',
277 237 ),
278 - 'tip' => __( 'Enable front-end profile editing with User Registration.', 'formidable' ),
279 - 'call' => self::cta_label(),
238 + 'tip' => __( 'Need front-end profile editing?', 'formidable' ),
239 + 'call' => __( 'Add user registration.', 'formidable' ),
280 240 ),
281 241 array(
282 242 'link' => array(
283 243 'content' => 'twilio-payment',
@@ -282,10 +242,10 @@
282 242 'link' => array(
283 243 'content' => 'twilio-payment',
284 244 'page' => 'twilio-tip',
285 245 ),
286 - 'tip' => __( 'Get SMS alerts for form submissions and payments—just add Twilio.', 'formidable' ),
287 - 'call' => self::cta_label(),
246 + 'tip' => __( 'Want an SMS notification when a form is submitted or a payment received?', 'formidable' ),
247 + 'call' => __( 'Get the Twilio integration.', 'formidable' ),
288 248 ),
289 249 array(
290 250 'link' => array(
291 251 'content' => 'twilio',
@@ -290,10 +250,10 @@
290 250 'link' => array(
291 251 'content' => 'twilio',
292 252 'page' => 'twilio-send-tip',
293 253 ),
294 - 'tip' => __( 'Use Twilio to send SMS when forms are submitted.', 'formidable' ),
295 - 'call' => self::cta_label(),
254 + 'tip' => __( 'Send an SMS message when a form is submitted.', 'formidable' ),
255 + 'call' => __( 'Get the Twilio integration.', 'formidable' ),
296 256 ),
297 257 array(
298 258 'link' => array(
299 259 'content' => 'acf-tip',
@@ -298,10 +258,10 @@
298 258 'link' => array(
299 259 'content' => 'acf-tip',
300 260 'param' => 'acf-tip',
301 261 ),
302 - 'tip' => __( 'Fill Advanced Custom Fields automatically with form entries.', 'formidable' ),
303 - 'call' => self::cta_label(),
262 + 'tip' => __( 'Fill Advanced Custom Fields from a form.', 'formidable' ),
263 + 'call' => __( 'Add ACF Integration', 'formidable' ),
304 264 ),
305 265 );
306 266
307 267 return $tips;
@@ -316,10 +276,10 @@
316 276 'link' => array(
317 277 'content' => 'style',
318 278 'param' => 'wordpress-visual-form-styler',
319 279 ),
320 - 'tip' => __( 'Make your forms stand out with multiple style templates.', 'formidable' ),
321 - 'call' => self::cta_label(),
280 + 'tip' => __( 'Make your sidebar and footer forms stand out.', 'formidable' ),
281 + 'call' => __( 'Use multiple style templates.', 'formidable' ),
322 282 ),
323 283 array(
324 284 'link' => array(
325 285 'content' => 'style',
@@ -325,9 +285,9 @@
325 285 'content' => 'style',
326 286 'param' => 'bg-image-style-settings',
327 287 ),
328 288 'tip' => __( 'Want to add a background image?', 'formidable' ),
329 - 'call' => self::cta_label(),
289 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
330 290 ),
331 291 array(
332 292 'link' => array(
333 293 'content' => 'style',
@@ -333,9 +293,9 @@
333 293 'content' => 'style',
334 294 'param' => 'duplicate-style',
335 295 ),
336 296 'tip' => __( 'Want to duplicate a style?', 'formidable' ),
337 - 'call' => self::cta_label(),
297 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
338 298 ),
339 299 );
340 300
341 301 return $tips;
@@ -350,10 +310,10 @@
350 310 'link' => array(
351 311 'content' => 'entries',
352 312 'param' => 'form-entry-management-wordpress',
353 313 ),
354 - 'tip' => __( 'Edit form entries anytime with entry management.', 'formidable' ),
355 - 'call' => self::cta_label(),
314 + 'tip' => __( 'Want to edit form submissions?', 'formidable' ),
315 + 'call' => __( 'Add entry management.', 'formidable' ),
356 316 ),
357 317 array(
358 318 'link' => array(
359 319 'content' => 'entries-search',
@@ -359,9 +319,9 @@
359 319 'content' => 'entries-search',
360 320 'param' => 'form-entry-management-wordpress',
361 321 ),
362 322 'tip' => __( 'Want to search submitted entries?', 'formidable' ),
363 - 'call' => self::cta_label(),
323 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
364 324 ),
365 325 array(
366 326 'link' => array(
367 327 'content' => 'views',
@@ -366,10 +326,10 @@
366 326 'link' => array(
367 327 'content' => 'views',
368 328 'param' => 'views-display-form-data',
369 329 ),
370 - 'tip' => __( 'Turn entries into dynamic content — no code needed.', 'formidable' ),
371 - 'call' => self::cta_label(),
330 + 'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
331 + 'call' => __( 'Display form data with Views.', 'formidable' ),
372 332 ),
373 333 );
374 334 $tips = array_merge( $tips, self::get_import_tip() );
375 335
@@ -386,9 +346,9 @@
386 346 'content' => 'import',
387 347 'param' => 'importing-exporting-wordpress-forms',
388 348 ),
389 349 'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
390 - 'call' => self::cta_label(),
350 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
391 351 ),
392 352 );
393 353
394 354 return $tips;
@@ -394,77 +354,46 @@
394 354 return $tips;
395 355 }
396 356
397 357 /**
398 - * @param array $tips
399 - *
400 358 * @return array
401 359 */
402 - public static function get_random_tip( $tips ) {
403 - $count = count( $tips );
360 + public static function get_banner_tip() {
361 + $tips = array(
362 + array(
363 + 'link' => array(
364 + 'medium' => 'banner',
365 + 'content' => 'professional-results',
366 + ),
367 + 'tip' => __( 'Looking for more ways to get professional results?', 'formidable' ),
368 + 'call' => __( 'Take your forms to the next level.', 'formidable' ),
369 + ),
370 + array(
371 + 'link' => array(
372 + 'medium' => 'banner',
373 + 'content' => 'increase-conversions',
374 + ),
375 + 'tip' => __( 'Increase conversions in long forms.', 'formidable' ),
376 + 'call' => __( 'Add conditional logic, page breaks, and section headings.', 'formidable' ),
377 + ),
378 + array(
379 + 'link' => array(
380 + 'medium' => 'banner',
381 + 'content' => 'automate',
382 + ),
383 + 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
384 + 'call' => __( 'Collect instant payments, and send leads to Mailchimp.', 'formidable' ),
385 + ),
386 + );
387 + $random = rand( 0, count( $tips ) - 1 );
388 + $tip = $tips[ $random ];
389 + $tip['num'] = $random;
404 390
405 - if ( $count === 0 ) {
406 - return array();
407 - }
408 -
409 - $random = random_int( 0, $count - 1 );
410 - return $tips[ $random ];
391 + return $tip;
411 392 }
412 393
413 - /**
414 - * Displays a call-to-action section in the admin area.
415 - *
416 - * @since 6.7
417 - *
418 - * @param array $args {
419 - * An array of arguments to configure the call-to-action section.
420 - *
421 - * @type string $title The title of the section.
422 - * @type string $description The description of the section.
423 - * @type string $link_text The text for the link.
424 - * @type string $link_url The URL for the link.
425 - * @type string $role The required user role to view the section. Default 'administrator'.
426 - * }
427 - *
428 - * @return void
429 - */
430 - public static function show_admin_cta( $args ) {
431 - $role = ! empty( $args['role'] ) ? $args['role'] : 'administrator';
394 + public static function get_random_tip( $tips ) {
395 + $random = rand( 0, count( $tips ) - 1 );
432 396
433 - if ( ! current_user_can( $role ) ) {
434 - // Return early if the user doesn't have the required capability.
435 - return;
436 - }
437 -
438 - $defaults = array(
439 - 'title' => '',
440 - 'description' => '',
441 - 'link_text' => '',
442 - 'link_url' => '#',
443 - 'class' => '',
444 - 'id' => '',
445 - 'target' => '_blank',
446 - );
447 -
448 - $args = wp_parse_args( $args, $defaults );
449 -
450 - $attributes = array(
451 - 'class' => trim( 'frm-cta frm-flex frm-p-sm ' . $args['class'] ),
452 - );
453 -
454 - if ( $args['id'] ) {
455 - $attributes['id'] = $args['id'];
456 - }
457 -
458 - require FrmAppHelper::plugin_path() . '/classes/views/shared/admin-cta.php';
459 - }
460 -
461 - /**
462 - * @deprecated 6.21
463 - *
464 - * @return array
465 - */
466 - public static function get_banner_tip() {
467 - _deprecated_function( __METHOD__, '6.21' );
468 - return array();
397 + return $tips[ $random ];
469 398 }
470 399 }