PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 4.01.02
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v4.01.02
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
formidable / classes / helpers / FrmTipsHelper.php

FrmTipsHelper.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 4.01.02, at classes/helpers/FrmTipsHelper.php

338 lines 9.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class FrmTipsHelper {
4
5 public static function pro_tip( $callback, $html = '' ) {
6 if ( FrmAppHelper::pro_is_installed() ) {
7 return;
8 }
9
10 $tips = self::$callback();
11 $tip = self::get_random_tip( $tips );
12
13 if ( 'p' === $html ) {
14 echo '<p class="frmcenter frm_no_top_margin">';
15 }
16
17 if ( ! isset( $tip['page'] ) ) {
18 $tip['page'] = '';
19 }
20 if ( ! isset( $tip['link']['medium'] ) ) {
21 $tip['link']['medium'] = 'tip';
22 }
23
24 $link = FrmAppHelper::make_affiliate_url( FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] ) );
25 ?>
26 <a href="<?php echo esc_url( $link ); ?>" target="_blank" class="frm_pro_tip">
27 <?php FrmAppHelper::icon_by_class( 'frmfont frm_star_full_icon', array( 'aria-hidden' => 'true' ) ); ?>
28 <span class="pro-tip">
29 <?php esc_html_e( 'Pro Tip:', 'formidable' ); ?>
30 </span>
31
32 <?php if ( isset( $tip['call'] ) ) { ?>
33 <?php echo esc_html( $tip['tip'] ); ?>
34 <span class="frm-tip-cta">
35 <?php echo esc_html( $tip['call'] ); ?>
36 </span>
37 <?php } else { ?>
38 <span class="frm-tip-cta">
39 <?php echo esc_html( $tip['tip'] ); ?>
40 </span>
41 <?php } ?>
42 </a>
43 <?php
44 if ( 'p' === $html ) {
45 echo '</p>';
46 }
47 }
48
49 public static function get_builder_tip() {
50 $tips = array(
51 array(
52 'link' => array(
53 'content' => 'conditional-logic',
54 'anchor' => 'feature-conditional-logic-wordpress-forms',
55 ),
56 'tip' => __( 'Use conditional logic to shorten your forms and increase conversions.', 'formidable' ),
57 'call' => __( 'Upgrade to Pro.', 'formidable' ),
58 ),
59 array(
60 'link' => array(
61 'content' => 'confirmation-fields',
62 'anchor' => 'feature-confirm-email-address-password-wordpress-form',
63 ),
64 'tip' => __( 'Want to stop losing leads from email typos?', 'formidable' ),
65 'call' => __( 'Add email confirmation fields.', 'formidable' ),
66 ),
67 array(
68 'link' => array(
69 'content' => 'page-breaks',
70 'anchor' => 'feature-wordpress-multi-step-form',
71 ),
72 'tip' => __( 'Stop intimidating users with long forms.', 'formidable' ),
73 'call' => __( 'Use page breaks.', 'formidable' ),
74 ),
75 array(
76 'link' => array(
77 'content' => 'file-uploads',
78 'anchor' => 'feature-wordpress-multiple-file-upload-form',
79 ),
80 'tip' => __( 'Cut down on back-and-forth with clients.', 'formidable' ),
81 'call' => __( 'Allow file uploads in your form.', 'formidable' ),
82 ),
83 array(
84 'link' => array(
85 'content' => 'calculations',
86 'anchor' => 'feature-wordpress-calculated-fields-form',
87 ),
88 'tip' => __( 'Need to calculate a total?', 'formidable' ),
89 'call' => __( 'Upgrade to Pro.', 'formidable' ),
90 ),
91 array(
92 'link' => array(
93 'content' => 'prefill-fields',
94 'anchor' => 'feature-fill-out-forms-automatically',
95 ),
96 'tip' => __( 'Save time.', 'formidable' ),
97 'call' => __( 'Prefill fields with user info.', 'formidable' ),
98 ),
99 );
100
101 return $tips;
102 }
103
104 public static function get_form_settings_tip() {
105 $tips = array(
106 array(
107 'link' => array(
108 'content' => 'front-edit-b',
109 'anchor' => 'feature-user-submitted-posts-wordpress-forms',
110 ),
111 'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
112 'call' => __( 'Add front-end editing.', 'formidable' ),
113 ),
114 array(
115 'link' => array(
116 'content' => 'save-drafts',
117 'anchor' => 'feature-user-submitted-posts-wordpress-forms',
118 ),
119 'tip' => __( 'Have a long form that takes time to complete?', 'formidable' ),
120 'call' => __( 'Let logged-in users save a draft and return later.', 'formidable' ),
121 ),
122 array(
123 'link' => array(
124 'content' => 'ajax',
125 ),
126 'tip' => __( 'Want to submit forms without reloading the page?', 'formidable' ),
127 'call' => __( 'Get ajax form submit.', 'formidable' ),
128 ),
129 array(
130 'link' => array(
131 'content' => 'form-scheduling',
132 ),
133 'tip' => __( 'Need to open and close your form on specific days?', 'formidable' ),
134 'call' => __( 'Add form scheduling.', 'formidable' ),
135 ),
136 );
137
138 return $tips;
139 }
140
141 public static function get_form_action_tip() {
142 $tips = array(
143 array(
144 'link' => array(
145 'content' => 'email-routing',
146 'anchor' => 'feature-email-autoresponders-wordpress',
147 ),
148 'tip' => __( 'Save time by sending the email to the right person automatically.', 'formidable' ),
149 'call' => __( 'Add email routing.', 'formidable' ),
150 ),
151 array(
152 'link' => array(
153 'content' => 'create-posts',
154 'anchor' => 'feature-user-submitted-posts-wordpress-forms',
155 ),
156 'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
157 'call' => __( 'Upgrade to Pro.', 'formidable' ),
158 ),
159 array(
160 'link' => array(
161 'content' => 'user-submit',
162 'anchor' => 'feature-user-submitted-posts-wordpress-forms',
163 ),
164 'tip' => __( 'Make front-end posting easy.', 'formidable' ),
165 'call' => __( 'Upgrade to Pro.', 'formidable' ),
166 ),
167 array(
168 'link' => array(
169 'content' => 'mailchimp',
170 'page' => 'mailchimp-tip',
171 ),
172 'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
173 'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
174 ),
175 array(
176 'link' => array(
177 'content' => 'paypal',
178 'page' => 'paypal-tip',
179 ),
180 'tip' => __( 'Save hours and increase revenue by collecting payments with every submission.', 'formidable' ),
181 'call' => __( 'Use PayPal with this form.', 'formidable' ),
182 ),
183 array(
184 'link' => array(
185 'content' => 'paypal-revenue',
186 'page' => 'paypal-increase-revenue-tip',
187 ),
188 'tip' => __( 'Increase revenue.', 'formidable' ),
189 'call' => __( 'Use PayPal with this form.', 'formidable' ),
190 ),
191 array(
192 'link' => array(
193 'content' => 'paypal-fast',
194 'page' => 'paypal-save-time-tip',
195 ),
196 'tip' => __( 'Get paid instantly.', 'formidable' ),
197 'call' => __( 'Use Paypal with this form.', 'formidable' ),
198 ),
199 array(
200 'link' => array(
201 'content' => 'registration',
202 'page' => 'registration-tip',
203 ),
204 'tip' => __( 'Boost your site membership.', 'formidable' ),
205 'call' => __( 'Automatically create user accounts.', 'formidable' ),
206 ),
207 array(
208 'link' => array(
209 'content' => 'profile',
210 'page' => 'registration-profile-editing-tip',
211 ),
212 'tip' => __( 'Make front-end profile editing possible.', 'formidable' ),
213 'call' => __( 'Add user registration.', 'formidable' ),
214 ),
215 array(
216 'link' => array(
217 'content' => 'twilio-payment',
218 'page' => 'twilio-tip',
219 ),
220 'tip' => __( 'Want a text when this form is submitted or when a payment is received?', 'formidable' ),
221 'call' => __( 'Use Twilio with this form.', 'formidable' ),
222 ),
223 array(
224 'link' => array(
225 'content' => 'twilio',
226 'page' => 'twilio-send-tip',
227 ),
228 'tip' => __( 'Send a text when this form is submitted.', 'formidable' ),
229 'call' => __( 'Get Twilio.', 'formidable' ),
230 ),
231 );
232
233 return $tips;
234 }
235
236 public static function get_styling_tip() {
237 $tips = array(
238 array(
239 'link' => array(
240 'content' => 'style',
241 'anchor' => 'feature-wordpress-visual-form-styler',
242 ),
243 'tip' => __( 'Make your sidebar and footer forms stand out.', 'formidable' ),
244 'call' => __( 'Use multiple style templates.', 'formidable' ),
245 ),
246 );
247
248 return $tips;
249 }
250
251 public static function get_entries_tip() {
252 $tips = array(
253 array(
254 'link' => array(
255 'content' => 'entries',
256 'anchor' => 'feature-form-entry-management-wordpress',
257 ),
258 'tip' => __( 'Want to edit form submissions?', 'formidable' ),
259 'call' => __( 'Add entry management.', 'formidable' ),
260 ),
261 array(
262 'link' => array(
263 'content' => 'entries-search',
264 'anchor' => 'feature-form-entry-management-wordpress',
265 ),
266 'tip' => __( 'Want to search submitted entries?', 'formidable' ),
267 'call' => __( 'Upgrade to Pro.', 'formidable' ),
268 ),
269 array(
270 'link' => array(
271 'content' => 'views',
272 'anchor' => 'feature-display-form-data-views',
273 ),
274 'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
275 'call' => __( 'Display form data with Views.', 'formidable' ),
276 ),
277 );
278 $tips = array_merge( $tips, self::get_import_tip() );
279
280 return $tips;
281 }
282
283 public static function get_import_tip() {
284 $tips = array(
285 array(
286 'link' => array(
287 'content' => 'import',
288 'anchor' => 'feature-importing-exporting-wordpress-forms',
289 ),
290 'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
291 'call' => __( 'Upgrade to Pro.', 'formidable' ),
292 ),
293 );
294
295 return $tips;
296 }
297
298 public static function get_banner_tip() {
299 $tips = array(
300 array(
301 'link' => array(
302 'medium' => 'banner',
303 'content' => 'professional-results',
304 ),
305 'tip' => __( 'Looking for more ways to get professional results?', 'formidable' ),
306 'call' => __( 'Take your forms to the next level.', 'formidable' ),
307 ),
308 array(
309 'link' => array(
310 'medium' => 'banner',
311 'content' => 'increase-conversions',
312 ),
313 'tip' => __( 'Increase conversions in long forms.', 'formidable' ),
314 'call' => __( 'Add conditional logic, page breaks, and section headings.', 'formidable' ),
315 ),
316 array(
317 'link' => array(
318 'medium' => 'banner',
319 'content' => 'automate',
320 ),
321 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
322 'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
323 ),
324 );
325 $random = rand( 0, count( $tips ) - 1 );
326 $tip = $tips[ $random ];
327 $tip['num'] = $random;
328
329 return $tip;
330 }
331
332 public static function get_random_tip( $tips ) {
333 $random = rand( 0, count( $tips ) - 1 );
334
335 return $tips[ $random ];
336 }
337 }
338