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