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

331 lines 9.3 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::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 'param' => '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 'param' => 'confirmation-fields-wordpress-forms',
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 'param' => 'wordpress-multi-page-forms',
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 'param' => 'wordpress-multi-file-upload-fields',
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 'param' => 'field-calculations-wordpress-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 'param' => 'auto-fill-forms',
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 'param' => 'wordpress-front-end-editing',
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 'param' => 'save-drafts-wordpress-form',
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 'param' => 'schedule-forms-wordpress',
133 ),
134 'tip' => __( 'Need to open and close your form on specific days?', 'formidable' ),
135 'call' => __( 'Add form scheduling.', 'formidable' ),
136 ),
137 );
138
139 return $tips;
140 }
141
142 public static function get_form_action_tip() {
143 $tips = array(
144 array(
145 'link' => array(
146 'content' => 'email-routing',
147 'param' => 'virtually-unlimited-emails',
148 ),
149 'tip' => __( 'Save time by sending the email to the right person automatically.', 'formidable' ),
150 'call' => __( 'Add email routing.', 'formidable' ),
151 ),
152 array(
153 'link' => array(
154 'content' => 'create-posts',
155 'param' => 'create-posts-pages-wordpress-forms',
156 ),
157 'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
158 'call' => __( 'Upgrade to Pro.', 'formidable' ),
159 ),
160 array(
161 'link' => array(
162 'content' => 'user-submit',
163 'param' => 'create-posts-pages-wordpress-forms',
164 ),
165 'tip' => __( 'Make front-end posting easy.', 'formidable' ),
166 'call' => __( 'Upgrade to Pro.', 'formidable' ),
167 ),
168 array(
169 'link' => array(
170 'content' => 'mailchimp',
171 'page' => 'mailchimp-tip',
172 ),
173 'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
174 'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
175 ),
176 array(
177 'link' => array(
178 'content' => 'paypal-revenue',
179 'page' => 'paypal-increase-revenue-tip',
180 ),
181 'tip' => __( 'Increase revenue.', 'formidable' ),
182 'call' => __( 'Use PayPal with this form.', 'formidable' ),
183 ),
184 array(
185 'link' => array(
186 'content' => 'paypal-fast',
187 'page' => 'paypal-save-time-tip',
188 ),
189 'tip' => __( 'Get paid instantly.', 'formidable' ),
190 'call' => __( 'Use Paypal with this form.', 'formidable' ),
191 ),
192 array(
193 'link' => array(
194 'content' => 'registration',
195 'page' => 'registration-tip',
196 ),
197 'tip' => __( 'Boost your site membership.', 'formidable' ),
198 'call' => __( 'Automatically create user accounts.', 'formidable' ),
199 ),
200 array(
201 'link' => array(
202 'content' => 'profile',
203 'page' => 'registration-profile-editing-tip',
204 ),
205 'tip' => __( 'Make front-end profile editing possible.', 'formidable' ),
206 'call' => __( 'Add user registration.', 'formidable' ),
207 ),
208 array(
209 'link' => array(
210 'content' => 'twilio-payment',
211 'page' => 'twilio-tip',
212 ),
213 'tip' => __( 'Want a text when this form is submitted or when a payment is received?', 'formidable' ),
214 'call' => __( 'Use Twilio with this form.', 'formidable' ),
215 ),
216 array(
217 'link' => array(
218 'content' => 'twilio',
219 'page' => 'twilio-send-tip',
220 ),
221 'tip' => __( 'Send a text when this form is submitted.', 'formidable' ),
222 'call' => __( 'Get Twilio.', 'formidable' ),
223 ),
224 );
225
226 return $tips;
227 }
228
229 public static function get_styling_tip() {
230 $tips = array(
231 array(
232 'link' => array(
233 'content' => 'style',
234 'param' => 'wordpress-visual-form-styler',
235 ),
236 'tip' => __( 'Make your sidebar and footer forms stand out.', 'formidable' ),
237 'call' => __( 'Use multiple style templates.', 'formidable' ),
238 ),
239 );
240
241 return $tips;
242 }
243
244 public static function get_entries_tip() {
245 $tips = array(
246 array(
247 'link' => array(
248 'content' => 'entries',
249 'param' => 'form-entry-management-wordpress',
250 ),
251 'tip' => __( 'Want to edit form submissions?', 'formidable' ),
252 'call' => __( 'Add entry management.', 'formidable' ),
253 ),
254 array(
255 'link' => array(
256 'content' => 'entries-search',
257 'param' => 'form-entry-management-wordpress',
258 ),
259 'tip' => __( 'Want to search submitted entries?', 'formidable' ),
260 'call' => __( 'Upgrade to Pro.', 'formidable' ),
261 ),
262 array(
263 'link' => array(
264 'content' => 'views',
265 'param' => 'views-display-form-data',
266 ),
267 'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
268 'call' => __( 'Display form data with Views.', 'formidable' ),
269 ),
270 );
271 $tips = array_merge( $tips, self::get_import_tip() );
272
273 return $tips;
274 }
275
276 public static function get_import_tip() {
277 $tips = array(
278 array(
279 'link' => array(
280 'content' => 'import',
281 'param' => 'importing-exporting-wordpress-forms',
282 ),
283 'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
284 'call' => __( 'Upgrade to Pro.', 'formidable' ),
285 ),
286 );
287
288 return $tips;
289 }
290
291 public static function get_banner_tip() {
292 $tips = array(
293 array(
294 'link' => array(
295 'medium' => 'banner',
296 'content' => 'professional-results',
297 ),
298 'tip' => __( 'Looking for more ways to get professional results?', 'formidable' ),
299 'call' => __( 'Take your forms to the next level.', 'formidable' ),
300 ),
301 array(
302 'link' => array(
303 'medium' => 'banner',
304 'content' => 'increase-conversions',
305 ),
306 'tip' => __( 'Increase conversions in long forms.', 'formidable' ),
307 'call' => __( 'Add conditional logic, page breaks, and section headings.', 'formidable' ),
308 ),
309 array(
310 'link' => array(
311 'medium' => 'banner',
312 'content' => 'automate',
313 ),
314 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
315 'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
316 ),
317 );
318 $random = rand( 0, count( $tips ) - 1 );
319 $tip = $tips[ $random ];
320 $tip['num'] = $random;
321
322 return $tip;
323 }
324
325 public static function get_random_tip( $tips ) {
326 $random = rand( 0, count( $tips ) - 1 );
327
328 return $tips[ $random ];
329 }
330 }
331