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