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

345 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 /**
225 * @return array
226 */
227 public static function get_styling_tip() {
228 $tips = array(
229 array(
230 'link' => array(
231 'content' => 'style',
232 'param' => 'wordpress-visual-form-styler',
233 ),
234 'tip' => __( 'Make your sidebar and footer forms stand out.', 'formidable' ),
235 'call' => __( 'Use multiple style templates.', 'formidable' ),
236 ),
237 array(
238 'link' => array(
239 'content' => 'style',
240 'param' => 'bg-image-style-settings',
241 ),
242 'tip' => __( 'Want to add a background image?', 'formidable' ),
243 'call' => __( 'Upgrade to Pro.', 'formidable' ),
244 ),
245 array(
246 'link' => array(
247 'content' => 'style',
248 'param' => 'duplicate-style',
249 ),
250 'tip' => __( 'Want to duplicate a style?', 'formidable' ),
251 'call' => __( 'Upgrade to Pro.', 'formidable' ),
252 ),
253 );
254
255 return $tips;
256 }
257
258 public static function get_entries_tip() {
259 $tips = array(
260 array(
261 'link' => array(
262 'content' => 'entries',
263 'param' => 'form-entry-management-wordpress',
264 ),
265 'tip' => __( 'Want to edit form submissions?', 'formidable' ),
266 'call' => __( 'Add entry management.', 'formidable' ),
267 ),
268 array(
269 'link' => array(
270 'content' => 'entries-search',
271 'param' => 'form-entry-management-wordpress',
272 ),
273 'tip' => __( 'Want to search submitted entries?', 'formidable' ),
274 'call' => __( 'Upgrade to Pro.', 'formidable' ),
275 ),
276 array(
277 'link' => array(
278 'content' => 'views',
279 'param' => 'views-display-form-data',
280 ),
281 'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
282 'call' => __( 'Display form data with Views.', 'formidable' ),
283 ),
284 );
285 $tips = array_merge( $tips, self::get_import_tip() );
286
287 return $tips;
288 }
289
290 public static function get_import_tip() {
291 $tips = array(
292 array(
293 'link' => array(
294 'content' => 'import',
295 'param' => 'importing-exporting-wordpress-forms',
296 ),
297 'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
298 'call' => __( 'Upgrade to Pro.', 'formidable' ),
299 ),
300 );
301
302 return $tips;
303 }
304
305 public static function get_banner_tip() {
306 $tips = array(
307 array(
308 'link' => array(
309 'medium' => 'banner',
310 'content' => 'professional-results',
311 ),
312 'tip' => __( 'Looking for more ways to get professional results?', 'formidable' ),
313 'call' => __( 'Take your forms to the next level.', 'formidable' ),
314 ),
315 array(
316 'link' => array(
317 'medium' => 'banner',
318 'content' => 'increase-conversions',
319 ),
320 'tip' => __( 'Increase conversions in long forms.', 'formidable' ),
321 'call' => __( 'Add conditional logic, page breaks, and section headings.', 'formidable' ),
322 ),
323 array(
324 'link' => array(
325 'medium' => 'banner',
326 'content' => 'automate',
327 ),
328 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
329 'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
330 ),
331 );
332 $random = rand( 0, count( $tips ) - 1 );
333 $tip = $tips[ $random ];
334 $tip['num'] = $random;
335
336 return $tip;
337 }
338
339 public static function get_random_tip( $tips ) {
340 $random = rand( 0, count( $tips ) - 1 );
341
342 return $tips[ $random ];
343 }
344 }
345