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