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 +23 -92 6.55.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,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,17 +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 - * @return array
85 - */
86 52 public static function get_builder_tip() {
87 53 $tips = array(
88 54 array(
89 55 'link' => array(
@@ -137,11 +103,8 @@
137 103
138 104 return $tips;
139 105 }
140 106
141 - /**
142 - * @return array
143 - */
144 107 public static function get_form_settings_tip() {
145 108 $tips = array(
146 109 array(
147 110 'link' => array(
@@ -160,8 +123,15 @@
160 123 'call' => __( 'Let users save drafts and return later!', 'formidable' ),
161 124 ),
162 125 array(
163 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(
164 134 'content' => 'form-scheduling',
165 135 'param' => 'schedule-forms-wordpress',
166 136 ),
167 137 'tip' => __( 'Want your form open only for a certain time period?', 'formidable' ),
@@ -171,11 +141,8 @@
171 141
172 142 return $tips;
173 143 }
174 144
175 - /**
176 - * @return array
177 - */
178 145 public static function get_form_action_tip() {
179 146 $tips = array(
180 147 array(
181 148 'link' => array(
@@ -206,9 +173,9 @@
206 173 'content' => 'mailchimp',
207 174 'page' => 'mailchimp-tip',
208 175 ),
209 176 'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
210 - 'call' => __( 'Send leads straight to Mailchimp.', 'formidable' ),
177 + 'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
211 178 ),
212 179 array(
213 180 'link' => array(
214 181 'content' => 'paypal-revenue',
@@ -256,24 +223,13 @@
256 223 ),
257 224 'tip' => __( 'Send an SMS message when a form is submitted.', 'formidable' ),
258 225 'call' => __( 'Get the Twilio integration.', 'formidable' ),
259 226 ),
260 - array(
261 - 'link' => array(
262 - 'content' => 'acf-tip',
263 - 'param' => 'acf-tip',
264 - ),
265 - 'tip' => __( 'Fill Advanced Custom Fields from a form.', 'formidable' ),
266 - 'call' => __( 'Add ACF Integration', 'formidable' ),
267 - ),
268 227 );
269 228
270 229 return $tips;
271 230 }
272 231
273 - /**
274 - * @return array
275 - */
276 232 public static function get_styling_tip() {
277 233 $tips = array(
278 234 array(
279 235 'link' => array(
@@ -282,32 +238,13 @@
282 238 ),
283 239 'tip' => __( 'Make your sidebar and footer forms stand out.', 'formidable' ),
284 240 'call' => __( 'Use multiple style templates.', 'formidable' ),
285 241 ),
286 - array(
287 - 'link' => array(
288 - 'content' => 'style',
289 - 'param' => 'bg-image-style-settings',
290 - ),
291 - 'tip' => __( 'Want to add a background image?', 'formidable' ),
292 - 'call' => __( 'Upgrade to Pro.', 'formidable' ),
293 - ),
294 - array(
295 - 'link' => array(
296 - 'content' => 'style',
297 - 'param' => 'duplicate-style',
298 - ),
299 - 'tip' => __( 'Want to duplicate a style?', 'formidable' ),
300 - 'call' => __( 'Upgrade to Pro.', 'formidable' ),
301 - ),
302 242 );
303 243
304 244 return $tips;
305 245 }
306 246
307 - /**
308 - * @return array
309 - */
310 247 public static function get_entries_tip() {
311 248 $tips = array(
312 249 array(
313 250 'link' => array(
@@ -338,11 +275,8 @@
338 275
339 276 return $tips;
340 277 }
341 278
342 - /**
343 - * @return array
344 - */
345 279 public static function get_import_tip() {
346 280 $tips = array(
347 281 array(
348 282 'link' => array(
@@ -356,11 +290,8 @@
356 290
357 291 return $tips;
358 292 }
359 293
360 - /**
361 - * @return array
362 - */
363 294 public static function get_banner_tip() {
364 295 $tips = array(
365 296 array(
366 297 'link' => array(
@@ -383,9 +314,9 @@
383 314 'medium' => 'banner',
384 315 'content' => 'automate',
385 316 ),
386 317 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
387 - 'call' => __( 'Collect instant payments, and send leads to Mailchimp.', 'formidable' ),
318 + 'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
388 319 ),
389 320 );
390 321 $random = rand( 0, count( $tips ) - 1 );
391 322 $tip = $tips[ $random ];