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

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