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