PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.0.01
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.0.01
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 +30 -110 6.5.25.0.01 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,53 +12,29 @@
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 = empty( $tip['link'] ) ? $tip['page'] : FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] );
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">
61 - <?php FrmAppHelper::icon_by_class( 'frmfont frm_lightning', array( 'aria-hidden' => 'true' ) ); ?>
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">
65 - <?php echo esc_html( $tip['tip'] ); ?>
66 - </span>
36 + <?php echo esc_html( $tip['tip'] ); ?>
67 37 <span class="frm-tip-cta">
68 38 <?php echo esc_html( $tip['call'] ); ?>
69 39 </span>
70 40 <?php } else { ?>
@@ -73,28 +43,13 @@
73 43 </span>
74 44 <?php } ?>
75 45 </a>
76 46 <?php
77 -
78 47 if ( 'p' === $html ) {
79 48 echo '</p>';
80 49 }
81 50 }
82 51
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 52 public static function get_builder_tip() {
98 53 $tips = array(
99 54 array(
100 55 'link' => array(
@@ -101,9 +56,9 @@
101 56 'content' => 'conditional-logic',
102 57 'param' => 'conditional-logic-wordpress-forms',
103 58 ),
104 59 'tip' => __( 'Use conditional logic to shorten your forms and increase conversions.', 'formidable' ),
105 - 'call' => self::cta_label(),
60 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
106 61 ),
107 62 array(
108 63 'link' => array(
109 64 'content' => 'confirmation-fields',
@@ -117,9 +72,9 @@
117 72 'content' => 'page-breaks',
118 73 'param' => 'wordpress-multi-page-forms',
119 74 ),
120 75 'tip' => __( 'Use page breaks for easier forms.', 'formidable' ),
121 - 'call' => self::cta_label(),
76 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
122 77 ),
123 78 array(
124 79 'link' => array(
125 80 'content' => 'file-uploads',
@@ -133,9 +88,9 @@
133 88 'content' => 'calculations',
134 89 'param' => 'field-calculations-wordpress-form',
135 90 ),
136 91 'tip' => __( 'Need to calculate a total?', 'formidable' ),
137 - 'call' => self::cta_label(),
92 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
138 93 ),
139 94 array(
140 95 'link' => array(
141 96 'content' => 'prefill-fields',
@@ -148,11 +103,8 @@
148 103
149 104 return $tips;
150 105 }
151 106
152 - /**
153 - * @return array
154 - */
155 107 public static function get_form_settings_tip() {
156 108 $tips = array(
157 109 array(
158 110 'link' => array(
@@ -171,8 +123,15 @@
171 123 'call' => __( 'Let users save drafts and return later!', 'formidable' ),
172 124 ),
173 125 array(
174 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(
175 134 'content' => 'form-scheduling',
176 135 'param' => 'schedule-forms-wordpress',
177 136 ),
178 137 'tip' => __( 'Want your form open only for a certain time period?', 'formidable' ),
@@ -182,11 +141,8 @@
182 141
183 142 return $tips;
184 143 }
185 144
186 - /**
187 - * @return array
188 - */
189 145 public static function get_form_action_tip() {
190 146 $tips = array(
191 147 array(
192 148 'link' => array(
@@ -201,9 +157,9 @@
201 157 'content' => 'create-posts',
202 158 'param' => 'create-posts-pages-wordpress-forms',
203 159 ),
204 160 'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
205 - 'call' => self::cta_label(),
161 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
206 162 ),
207 163 array(
208 164 'link' => array(
209 165 'content' => 'user-submit',
@@ -209,9 +165,9 @@
209 165 'content' => 'user-submit',
210 166 'param' => 'create-posts-pages-wordpress-forms',
211 167 ),
212 168 'tip' => __( 'Let your users submit posts on the front-end.', 'formidable' ),
213 - 'call' => self::cta_label(),
169 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
214 170 ),
215 171 array(
216 172 'link' => array(
217 173 'content' => 'mailchimp',
@@ -217,9 +173,9 @@
217 173 'content' => 'mailchimp',
218 174 'page' => 'mailchimp-tip',
219 175 ),
220 176 'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
221 - 'call' => __( 'Send leads straight to Mailchimp.', 'formidable' ),
177 + 'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
222 178 ),
223 179 array(
224 180 'link' => array(
225 181 'content' => 'paypal-revenue',
@@ -267,24 +223,13 @@
267 223 ),
268 224 'tip' => __( 'Send an SMS message when a form is submitted.', 'formidable' ),
269 225 'call' => __( 'Get the Twilio integration.', 'formidable' ),
270 226 ),
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 227 );
280 228
281 229 return $tips;
282 230 }
283 231
284 - /**
285 - * @return array
286 - */
287 232 public static function get_styling_tip() {
288 233 $tips = array(
289 234 array(
290 235 'link' => array(
@@ -293,32 +238,13 @@
293 238 ),
294 239 'tip' => __( 'Make your sidebar and footer forms stand out.', 'formidable' ),
295 240 'call' => __( 'Use multiple style templates.', 'formidable' ),
296 241 ),
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 242 );
314 243
315 244 return $tips;
316 245 }
317 246
318 - /**
319 - * @return array
320 - */
321 247 public static function get_entries_tip() {
322 248 $tips = array(
323 249 array(
324 250 'link' => array(
@@ -333,9 +259,9 @@
333 259 'content' => 'entries-search',
334 260 'param' => 'form-entry-management-wordpress',
335 261 ),
336 262 'tip' => __( 'Want to search submitted entries?', 'formidable' ),
337 - 'call' => self::cta_label(),
263 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
338 264 ),
339 265 array(
340 266 'link' => array(
341 267 'content' => 'views',
@@ -349,11 +275,8 @@
349 275
350 276 return $tips;
351 277 }
352 278
353 - /**
354 - * @return array
355 - */
356 279 public static function get_import_tip() {
357 280 $tips = array(
358 281 array(
359 282 'link' => array(
@@ -360,9 +283,9 @@
360 283 'content' => 'import',
361 284 'param' => 'importing-exporting-wordpress-forms',
362 285 ),
363 286 'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
364 - 'call' => self::cta_label(),
287 + 'call' => __( 'Upgrade to Pro.', 'formidable' ),
365 288 ),
366 289 );
367 290
368 291 return $tips;
@@ -367,11 +290,8 @@
367 290
368 291 return $tips;
369 292 }
370 293
371 - /**
372 - * @return array
373 - */
374 294 public static function get_banner_tip() {
375 295 $tips = array(
376 296 array(
377 297 'link' => array(
@@ -394,9 +314,9 @@
394 314 'medium' => 'banner',
395 315 'content' => 'automate',
396 316 ),
397 317 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
398 - 'call' => __( 'Collect instant payments, and send leads to Mailchimp.', 'formidable' ),
318 + 'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
399 319 ),
400 320 );
401 321 $random = rand( 0, count( $tips ) - 1 );
402 322 $tip = $tips[ $random ];