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