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