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