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