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