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

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