PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.3
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.3
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 -210 6.255.3 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,10 +118,10 @@
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(
197 127 'content' => 'form-scheduling',
@@ -196,10 +126,10 @@
196 126 'link' => array(
197 127 'content' => 'form-scheduling',
198 128 'param' => 'schedule-forms-wordpress',
199 129 ),
200 - 'tip' => __( 'Limit form access with built-in scheduling.', 'formidable' ),
201 - 'call' => self::cta_label(),
130 + 'tip' => __( 'Want your form open only for a certain time period?', 'formidable' ),
131 + 'call' => __( 'Add form scheduling.', 'formidable' ),
202 132 ),
203 133 );
204 134
205 135 return $tips;
@@ -204,11 +134,8 @@
204 134
205 135 return $tips;
206 136 }
207 137
208 - /**
209 - * @return array
210 - */
211 138 public static function get_form_action_tip() {
212 139 $tips = array(
213 140 array(
214 141 'link' => array(
@@ -214,10 +141,10 @@
214 141 'link' => array(
215 142 'content' => 'email-routing',
216 143 'param' => 'virtually-unlimited-emails',
217 144 ),
218 - 'tip' => __( 'Save time — route emails to the right person automatically.', 'formidable' ),
219 - 'call' => self::cta_label(),
145 + 'tip' => __( 'Save time by sending the email to the right person automatically.', 'formidable' ),
146 + 'call' => __( 'Add email routing.', 'formidable' ),
220 147 ),
221 148 array(
222 149 'link' => array(
223 150 'content' => 'create-posts',
@@ -223,9 +150,9 @@
223 150 'content' => 'create-posts',
224 151 'param' => 'create-posts-pages-wordpress-forms',
225 152 ),
226 153 'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
227 - 'call' => self::cta_label(),
154 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
228 155 ),
229 156 array(
230 157 'link' => array(
231 158 'content' => 'user-submit',
@@ -231,9 +158,9 @@
231 158 'content' => 'user-submit',
232 159 'param' => 'create-posts-pages-wordpress-forms',
233 160 ),
234 161 'tip' => __( 'Let your users submit posts on the front-end.', 'formidable' ),
235 - 'call' => self::cta_label(),
162 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
236 163 ),
237 164 array(
238 165 'link' => array(
239 166 'content' => 'mailchimp',
@@ -238,10 +165,10 @@
238 165 'link' => array(
239 166 'content' => 'mailchimp',
240 167 'page' => 'mailchimp-tip',
241 168 ),
242 - 'tip' => __( 'Send leads to Mailchimp for instant email follow-up.', 'formidable' ),
243 - 'call' => self::cta_label(),
169 + 'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
170 + 'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
244 171 ),
245 172 array(
246 173 'link' => array(
247 174 'content' => 'paypal-revenue',
@@ -246,10 +173,10 @@
246 173 'link' => array(
247 174 'content' => 'paypal-revenue',
248 175 'page' => 'paypal-increase-revenue-tip',
249 176 ),
250 - 'tip' => __( 'Accept PayPal payments and grow your sales.', 'formidable' ),
251 - 'call' => self::cta_label(),
177 + 'tip' => __( 'Increase revenue.', 'formidable' ),
178 + 'call' => __( 'Use PayPal with this form.', 'formidable' ),
252 179 ),
253 180 array(
254 181 'link' => array(
255 182 'content' => 'paypal-fast',
@@ -254,10 +181,10 @@
254 181 'link' => array(
255 182 'content' => 'paypal-fast',
256 183 'page' => 'paypal-save-time-tip',
257 184 ),
258 - 'tip' => __( 'Accept payments now with PayPal integration.', 'formidable' ),
259 - 'call' => self::cta_label(),
185 + 'tip' => __( 'Get paid instantly.', 'formidable' ),
186 + 'call' => __( 'Use Paypal with this form.', 'formidable' ),
260 187 ),
261 188 array(
262 189 'link' => array(
263 190 'content' => 'registration',
@@ -270,10 +197,10 @@
270 197 'link' => array(
271 198 'content' => 'profile',
272 199 'page' => 'registration-profile-editing-tip',
273 200 ),
274 - 'tip' => __( 'Enable front-end profile editing with User Registration.', 'formidable' ),
275 - 'call' => self::cta_label(),
201 + 'tip' => __( 'Need front-end profile editing?', 'formidable' ),
202 + 'call' => __( 'Add user registration.', 'formidable' ),
276 203 ),
277 204 array(
278 205 'link' => array(
279 206 'content' => 'twilio-payment',
@@ -278,10 +205,10 @@
278 205 'link' => array(
279 206 'content' => 'twilio-payment',
280 207 'page' => 'twilio-tip',
281 208 ),
282 - 'tip' => __( 'Get SMS alerts for form submissions and payments—just add Twilio.', 'formidable' ),
283 - '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' ),
284 211 ),
285 212 array(
286 213 'link' => array(
287 214 'content' => 'twilio',
@@ -286,27 +213,16 @@
286 213 'link' => array(
287 214 'content' => 'twilio',
288 215 'page' => 'twilio-send-tip',
289 216 ),
290 - 'tip' => __( 'Use Twilio to send SMS when forms are submitted.', 'formidable' ),
291 - 'call' => self::cta_label(),
217 + 'tip' => __( 'Send an SMS message when a form is submitted.', 'formidable' ),
218 + 'call' => __( 'Get the Twilio integration.', 'formidable' ),
292 219 ),
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 220 );
302 221
303 222 return $tips;
304 223 }
305 224
306 - /**
307 - * @return array
308 - */
309 225 public static function get_styling_tip() {
310 226 $tips = array(
311 227 array(
312 228 'link' => array(
@@ -312,10 +228,10 @@
312 228 'link' => array(
313 229 'content' => 'style',
314 230 'param' => 'wordpress-visual-form-styler',
315 231 ),
316 - 'tip' => __( 'Make your forms stand out with multiple style templates.', 'formidable' ),
317 - 'call' => self::cta_label(),
232 + 'tip' => __( 'Make your sidebar and footer forms stand out.', 'formidable' ),
233 + 'call' => __( 'Use multiple style templates.', 'formidable' ),
318 234 ),
319 235 array(
320 236 'link' => array(
321 237 'content' => 'style',
@@ -321,17 +237,17 @@
321 237 'content' => 'style',
322 238 'param' => 'bg-image-style-settings',
323 239 ),
324 240 'tip' => __( 'Want to add a background image?', 'formidable' ),
325 - 'call' => self::cta_label(),
241 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
326 242 ),
327 243 array(
328 244 'link' => array(
329 245 'content' => 'style',
330 - 'param' => 'duplicate-style',
246 + 'param' => 'bg-image-style-settings',
331 247 ),
332 - 'tip' => __( 'Want to duplicate a style?', 'formidable' ),
333 - 'call' => self::cta_label(),
248 + 'tip' => __( 'Want to set a color with an alpha slider?', 'formidable' ),
249 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
334 250 ),
335 251 );
336 252
337 253 return $tips;
@@ -336,11 +252,8 @@
336 252
337 253 return $tips;
338 254 }
339 255
340 - /**
341 - * @return array
342 - */
343 256 public static function get_entries_tip() {
344 257 $tips = array(
345 258 array(
346 259 'link' => array(
@@ -346,10 +259,10 @@
346 259 'link' => array(
347 260 'content' => 'entries',
348 261 'param' => 'form-entry-management-wordpress',
349 262 ),
350 - 'tip' => __( 'Edit form entries anytime with entry management.', 'formidable' ),
351 - 'call' => self::cta_label(),
263 + 'tip' => __( 'Want to edit form submissions?', 'formidable' ),
264 + 'call' => __( 'Add entry management.', 'formidable' ),
352 265 ),
353 266 array(
354 267 'link' => array(
355 268 'content' => 'entries-search',
@@ -355,9 +268,9 @@
355 268 'content' => 'entries-search',
356 269 'param' => 'form-entry-management-wordpress',
357 270 ),
358 271 'tip' => __( 'Want to search submitted entries?', 'formidable' ),
359 - 'call' => self::cta_label(),
272 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
360 273 ),
361 274 array(
362 275 'link' => array(
363 276 'content' => 'views',
@@ -362,10 +275,10 @@
362 275 'link' => array(
363 276 'content' => 'views',
364 277 'param' => 'views-display-form-data',
365 278 ),
366 - 'tip' => __( 'Turn entries into dynamic content — no code needed.', 'formidable' ),
367 - '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' ),
368 281 ),
369 282 );
370 283 $tips = array_merge( $tips, self::get_import_tip() );
371 284
@@ -371,11 +284,8 @@
371 284
372 285 return $tips;
373 286 }
374 287
375 - /**
376 - * @return array
377 - */
378 288 public static function get_import_tip() {
379 289 $tips = array(
380 290 array(
381 291 'link' => array(
@@ -382,9 +292,9 @@
382 292 'content' => 'import',
383 293 'param' => 'importing-exporting-wordpress-forms',
384 294 ),
385 295 'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
386 - 'call' => self::cta_label(),
296 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
387 297 ),
388 298 );
389 299
390 300 return $tips;
@@ -389,68 +299,44 @@
389 299
390 300 return $tips;
391 301 }
392 302
393 - public static function get_random_tip( $tips ) {
394 - $random = random_int( 0, count( $tips ) - 1 );
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;
395 333
396 - return $tips[ $random ];
334 + return $tip;
397 335 }
398 336
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';
337 + public static function get_random_tip( $tips ) {
338 + $random = rand( 0, count( $tips ) - 1 );
418 339
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();
340 + return $tips[ $random ];
455 341 }
456 342 }