PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 3.06.06
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v3.06.06
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 +72 -162 6.5.33.06.06 View file →
@@ -1,17 +1,8 @@
1 1 <?php
2 -if ( ! defined( 'ABSPATH' ) ) {
3 - die( 'You are not allowed to call this page directly.' );
4 -}
5 2
6 3 class FrmTipsHelper {
7 4
8 - /**
9 - * @param string $callback
10 - * @param string $html
11 - *
12 - * @return void
13 - */
14 5 public static function pro_tip( $callback, $html = '' ) {
15 6 if ( FrmAppHelper::pro_is_installed() ) {
16 7 return;
17 8 }
@@ -16,99 +7,52 @@
16 7 return;
17 8 }
18 9
19 10 $tips = self::$callback();
20 - $tip = self::get_random_tip( $tips );
11 + $tip = self::get_random_tip( $tips );
21 12
22 - self::show_tip( $tip, $html );
23 - }
13 + if ( 'p' === $html ) {
14 + echo '<p>';
15 + }
24 16
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'] ) ) {
17 + if ( ! isset( $tip['page'] ) ) {
18 + $tip['page'] = '';
19 + }
20 + if ( ! isset( $tip['link']['medium'] ) ) {
51 21 $tip['link']['medium'] = 'tip';
52 22 }
53 23
54 - if ( 'p' === $html ) {
55 - echo '<p class="frmcenter ' . esc_attr( $tip['class'] ) . '">';
56 - }
57 -
58 - $link = empty( $tip['link'] ) ? $tip['page'] : FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] );
24 + $link = FrmAppHelper::make_affiliate_url( FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] ) );
59 25 ?>
60 - <a href="<?php echo esc_url( $link ); ?>" <?php echo empty( $tip['link'] ) ? '' : 'target="_blank"'; ?> class="frm_pro_tip">
61 - <?php FrmAppHelper::icon_by_class( 'frmfont frm_lightning', array( 'aria-hidden' => 'true' ) ); ?>
62 -
26 + <a href="<?php echo esc_url( $link ); ?>" target="_blank" class="frm_pro_tip">
27 + <span>
28 + <i class="frm_icon_font frm_check1_icon"></i> <?php esc_html_e( 'Pro Tip:', 'formidable' ); ?>
29 + </span>
30 + <?php echo esc_html( $tip['tip'] ) ?>
63 31 <?php if ( isset( $tip['call'] ) ) { ?>
64 - <span class="frm-tip-info">
65 - <?php echo esc_html( $tip['tip'] ); ?>
66 - </span>
67 - <span class="frm-tip-cta">
68 - <?php echo esc_html( $tip['call'] ); ?>
69 - </span>
70 - <?php } else { ?>
71 - <span class="frm-tip-cta">
72 - <?php echo esc_html( $tip['tip'] ); ?>
73 - </span>
32 + <span><?php echo esc_html( $tip['call'] ) ?></span>
74 33 <?php } ?>
75 34 </a>
76 35 <?php
77 -
78 36 if ( 'p' === $html ) {
79 37 echo '</p>';
80 38 }
81 39 }
82 40
83 - /**
84 - * Use the correct label for the license.
85 - *
86 - * @since 6.5.1
87 - *
88 - * @return string
89 - */
90 - private static function cta_label() {
91 - return FrmAddonsController::is_license_expired() ? __( 'Renew', 'formidable' ) : __( 'Upgrade to Pro.', 'formidable' );
92 - }
93 -
94 - /**
95 - * @return array
96 - */
97 41 public static function get_builder_tip() {
98 42 $tips = array(
99 43 array(
100 44 'link' => array(
101 45 'content' => 'conditional-logic',
102 - 'param' => 'conditional-logic-wordpress-forms',
46 + 'anchor' => 'feature-conditional-logic-wordpress-forms',
103 47 ),
104 48 'tip' => __( 'Use conditional logic to shorten your forms and increase conversions.', 'formidable' ),
105 - 'call' => self::cta_label(),
49 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
106 50 ),
107 51 array(
108 52 'link' => array(
109 53 'content' => 'confirmation-fields',
110 - 'param' => 'confirmation-fields-wordpress-forms',
54 + 'anchor' => 'feature-confirm-email-address-password-wordpress-form',
111 55 ),
112 56 'tip' => __( 'Want to stop losing leads from email typos?', 'formidable' ),
113 57 'call' => __( 'Add email confirmation fields.', 'formidable' ),
114 58 ),
@@ -114,17 +58,17 @@
114 58 ),
115 59 array(
116 60 'link' => array(
117 61 'content' => 'page-breaks',
118 - 'param' => 'wordpress-multi-page-forms',
62 + 'anchor' => 'feature-wordpress-multi-step-form',
119 63 ),
120 - 'tip' => __( 'Use page breaks for easier forms.', 'formidable' ),
121 - 'call' => self::cta_label(),
64 + 'tip' => __( 'Stop intimidating users with long forms.', 'formidable' ),
65 + 'call' => __( 'Use page breaks.', 'formidable' ),
122 66 ),
123 67 array(
124 68 'link' => array(
125 69 'content' => 'file-uploads',
126 - 'param' => 'wordpress-multi-file-upload-fields',
70 + 'anchor' => 'feature-wordpress-multiple-file-upload-form',
127 71 ),
128 72 'tip' => __( 'Cut down on back-and-forth with clients.', 'formidable' ),
129 73 'call' => __( 'Allow file uploads in your form.', 'formidable' ),
130 74 ),
@@ -130,20 +74,20 @@
130 74 ),
131 75 array(
132 76 'link' => array(
133 77 'content' => 'calculations',
134 - 'param' => 'field-calculations-wordpress-form',
78 + 'anchor' => 'feature-wordpress-calculated-fields-form',
135 79 ),
136 80 'tip' => __( 'Need to calculate a total?', 'formidable' ),
137 - 'call' => self::cta_label(),
81 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
138 82 ),
139 83 array(
140 84 'link' => array(
141 85 'content' => 'prefill-fields',
142 - 'param' => 'auto-fill-forms',
86 + 'anchor' => 'feature-fill-out-forms-automatically',
143 87 ),
144 88 'tip' => __( 'Save time.', 'formidable' ),
145 - 'call' => __( 'Fill out forms automatically!', 'formidable' ),
89 + 'call' => __( 'Prefill fields with user info.', 'formidable' ),
146 90 ),
147 91 );
148 92
149 93 return $tips;
@@ -148,17 +92,14 @@
148 92
149 93 return $tips;
150 94 }
151 95
152 - /**
153 - * @return array
154 - */
155 96 public static function get_form_settings_tip() {
156 97 $tips = array(
157 98 array(
158 99 'link' => array(
159 100 'content' => 'front-edit-b',
160 - 'param' => 'wordpress-front-end-editing',
101 + 'anchor' => 'feature-user-submitted-posts-wordpress-forms',
161 102 ),
162 103 'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
163 104 'call' => __( 'Add front-end editing.', 'formidable' ),
164 105 ),
@@ -164,35 +105,37 @@
164 105 ),
165 106 array(
166 107 'link' => array(
167 108 'content' => 'save-drafts',
168 - 'param' => 'save-drafts-wordpress-form',
109 + 'anchor' => 'feature-user-submitted-posts-wordpress-forms',
169 110 ),
170 - 'tip' => __( 'Have long forms?', 'formidable' ),
171 - 'call' => __( 'Let users save drafts and return later!', 'formidable' ),
111 + 'tip' => __( 'Have a long form that takes time to complete?', 'formidable' ),
112 + 'call' => __( 'Let logged-in users save a draft and return later.', 'formidable' ),
172 113 ),
173 114 array(
174 115 'link' => array(
116 + 'content' => 'ajax',
117 + ),
118 + 'tip' => __( 'Want to submit forms without reloading the page?', 'formidable' ),
119 + 'call' => __( 'Get ajax form submit.', 'formidable' ),
120 + ),
121 + array(
122 + 'link' => array(
175 123 'content' => 'form-scheduling',
176 - 'param' => 'schedule-forms-wordpress',
177 124 ),
178 - 'tip' => __( 'Want your form open only for a certain time period?', 'formidable' ),
125 + 'tip' => __( 'Need to open and close your form on specific days?', 'formidable' ),
179 126 'call' => __( 'Add form scheduling.', 'formidable' ),
180 127 ),
181 128 );
182 -
183 129 return $tips;
184 130 }
185 131
186 - /**
187 - * @return array
188 - */
189 132 public static function get_form_action_tip() {
190 133 $tips = array(
191 134 array(
192 135 'link' => array(
193 136 'content' => 'email-routing',
194 - 'param' => 'virtually-unlimited-emails',
137 + 'anchor' => 'feature-email-autoresponders-wordpress',
195 138 ),
196 139 'tip' => __( 'Save time by sending the email to the right person automatically.', 'formidable' ),
197 140 'call' => __( 'Add email routing.', 'formidable' ),
198 141 ),
@@ -198,20 +141,20 @@
198 141 ),
199 142 array(
200 143 'link' => array(
201 144 'content' => 'create-posts',
202 - 'param' => 'create-posts-pages-wordpress-forms',
145 + 'anchor' => 'feature-user-submitted-posts-wordpress-forms',
203 146 ),
204 147 'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
205 - 'call' => self::cta_label(),
148 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
206 149 ),
207 150 array(
208 151 'link' => array(
209 152 'content' => 'user-submit',
210 - 'param' => 'create-posts-pages-wordpress-forms',
153 + 'anchor' => 'feature-user-submitted-posts-wordpress-forms',
211 154 ),
212 - 'tip' => __( 'Let your users submit posts on the front-end.', 'formidable' ),
213 - 'call' => self::cta_label(),
155 + 'tip' => __( 'Make front-end posting easy.', 'formidable' ),
156 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
214 157 ),
215 158 array(
216 159 'link' => array(
217 160 'content' => 'mailchimp',
@@ -217,12 +160,20 @@
217 160 'content' => 'mailchimp',
218 161 'page' => 'mailchimp-tip',
219 162 ),
220 163 'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
221 - 'call' => __( 'Send leads straight to Mailchimp.', 'formidable' ),
164 + 'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
222 165 ),
223 166 array(
224 167 'link' => array(
168 + 'content' => 'paypal',
169 + 'page' => 'paypal-tip',
170 + ),
171 + 'tip' => __( 'Save hours and increase revenue by collecting payments with every submission.', 'formidable' ),
172 + 'call' => __( 'Use PayPal with this form.', 'formidable' ),
173 + ),
174 + array(
175 + 'link' => array(
225 176 'content' => 'paypal-revenue',
226 177 'page' => 'paypal-increase-revenue-tip',
227 178 ),
228 179 'tip' => __( 'Increase revenue.', 'formidable' ),
@@ -240,10 +191,10 @@
240 191 'link' => array(
241 192 'content' => 'registration',
242 193 'page' => 'registration-tip',
243 194 ),
244 - 'tip' => __( 'Automatically create user accounts.', 'formidable' ),
245 - 'call' => __( 'Upgrade to boost your site membership.', 'formidable' ),
195 + 'tip' => __( 'Boost your site membership.', 'formidable' ),
196 + 'call' => __( 'Automatically create user accounts.', 'formidable' ),
246 197 ),
247 198 array(
248 199 'link' => array(
249 200 'content' => 'profile',
@@ -248,9 +199,9 @@
248 199 'link' => array(
249 200 'content' => 'profile',
250 201 'page' => 'registration-profile-editing-tip',
251 202 ),
252 - 'tip' => __( 'Need front-end profile editing?', 'formidable' ),
203 + 'tip' => __( 'Make front-end profile editing possible.', 'formidable' ),
253 204 'call' => __( 'Add user registration.', 'formidable' ),
254 205 ),
255 206 array(
256 207 'link' => array(
@@ -256,10 +207,10 @@
256 207 'link' => array(
257 208 'content' => 'twilio-payment',
258 209 'page' => 'twilio-tip',
259 210 ),
260 - 'tip' => __( 'Want an SMS notification when a form is submitted or a payment received?', 'formidable' ),
261 - 'call' => __( 'Get the Twilio integration.', 'formidable' ),
211 + 'tip' => __( 'Want a text when this form is submitted or when a payment is received?', 'formidable' ),
212 + 'call' => __( 'Use Twilio with this form.', 'formidable' ),
262 213 ),
263 214 array(
264 215 'link' => array(
265 216 'content' => 'twilio',
@@ -264,67 +215,36 @@
264 215 'link' => array(
265 216 'content' => 'twilio',
266 217 'page' => 'twilio-send-tip',
267 218 ),
268 - 'tip' => __( 'Send an SMS message when a form is submitted.', 'formidable' ),
269 - 'call' => __( 'Get the Twilio integration.', 'formidable' ),
219 + 'tip' => __( 'Send a text when this form is submitted.', 'formidable' ),
220 + 'call' => __( 'Get Twilio.', 'formidable' ),
270 221 ),
271 - array(
272 - 'link' => array(
273 - 'content' => 'acf-tip',
274 - 'param' => 'acf-tip',
275 - ),
276 - 'tip' => __( 'Fill Advanced Custom Fields from a form.', 'formidable' ),
277 - 'call' => __( 'Add ACF Integration', 'formidable' ),
278 - ),
279 222 );
280 223
281 224 return $tips;
282 225 }
283 226
284 - /**
285 - * @return array
286 - */
287 227 public static function get_styling_tip() {
288 228 $tips = array(
289 229 array(
290 230 'link' => array(
291 231 'content' => 'style',
292 - 'param' => 'wordpress-visual-form-styler',
232 + 'anchor' => 'feature-wordpress-visual-form-styler',
293 233 ),
294 - 'tip' => __( 'Make your sidebar and footer forms stand out.', 'formidable' ),
234 + 'tip' => __( 'Make your sidebar or footer form stand out.', 'formidable' ),
295 235 'call' => __( 'Use multiple style templates.', 'formidable' ),
296 236 ),
297 - array(
298 - 'link' => array(
299 - 'content' => 'style',
300 - 'param' => 'bg-image-style-settings',
301 - ),
302 - 'tip' => __( 'Want to add a background image?', 'formidable' ),
303 - 'call' => self::cta_label(),
304 - ),
305 - array(
306 - 'link' => array(
307 - 'content' => 'style',
308 - 'param' => 'duplicate-style',
309 - ),
310 - 'tip' => __( 'Want to duplicate a style?', 'formidable' ),
311 - 'call' => self::cta_label(),
312 - ),
313 237 );
314 -
315 238 return $tips;
316 239 }
317 240
318 - /**
319 - * @return array
320 - */
321 241 public static function get_entries_tip() {
322 242 $tips = array(
323 243 array(
324 244 'link' => array(
325 245 'content' => 'entries',
326 - 'param' => 'form-entry-management-wordpress',
246 + 'anchor' => 'feature-form-entry-management-wordpress',
327 247 ),
328 248 'tip' => __( 'Want to edit form submissions?', 'formidable' ),
329 249 'call' => __( 'Add entry management.', 'formidable' ),
330 250 ),
@@ -330,17 +250,17 @@
330 250 ),
331 251 array(
332 252 'link' => array(
333 253 'content' => 'entries-search',
334 - 'param' => 'form-entry-management-wordpress',
254 + 'anchor' => 'feature-form-entry-management-wordpress',
335 255 ),
336 256 'tip' => __( 'Want to search submitted entries?', 'formidable' ),
337 - 'call' => self::cta_label(),
257 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
338 258 ),
339 259 array(
340 260 'link' => array(
341 261 'content' => 'views',
342 - 'param' => 'views-display-form-data',
262 + 'anchor' => 'feature-display-form-data-views',
343 263 ),
344 264 'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
345 265 'call' => __( 'Display form data with Views.', 'formidable' ),
346 266 ),
@@ -345,35 +265,27 @@
345 265 'call' => __( 'Display form data with Views.', 'formidable' ),
346 266 ),
347 267 );
348 268 $tips = array_merge( $tips, self::get_import_tip() );
349 -
350 269 return $tips;
351 270 }
352 271
353 - /**
354 - * @return array
355 - */
356 272 public static function get_import_tip() {
357 273 $tips = array(
358 274 array(
359 275 'link' => array(
360 276 'content' => 'import',
361 - 'param' => 'importing-exporting-wordpress-forms',
277 + 'anchor' => 'feature-importing-exporting-wordpress-forms',
362 278 ),
363 279 'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
364 - 'call' => self::cta_label(),
280 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
365 281 ),
366 282 );
367 -
368 283 return $tips;
369 284 }
370 285
371 - /**
372 - * @return array
373 - */
374 286 public static function get_banner_tip() {
375 - $tips = array(
287 + $tips = array(
376 288 array(
377 289 'link' => array(
378 290 'medium' => 'banner',
379 291 'content' => 'professional-results',
@@ -394,20 +306,18 @@
394 306 'medium' => 'banner',
395 307 'content' => 'automate',
396 308 ),
397 309 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
398 - 'call' => __( 'Collect instant payments, and send leads to Mailchimp.', 'formidable' ),
310 + 'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
399 311 ),
400 312 );
401 - $random = rand( 0, count( $tips ) - 1 );
402 - $tip = $tips[ $random ];
313 + $random = rand( 0, count( $tips ) - 1 );
314 + $tip = $tips[ $random ];
403 315 $tip['num'] = $random;
404 -
405 316 return $tip;
406 317 }
407 318
408 319 public static function get_random_tip( $tips ) {
409 320 $random = rand( 0, count( $tips ) - 1 );
410 -
411 321 return $tips[ $random ];
412 322 }
413 323 }