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