PluginProbe ʕ •ᴥ•ʔ
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More / 1.10.0.5
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More v1.10.0.5
1.10.1.1 1.10.1 1.10.0.5 trunk 1.1.4 1.1.4.2 1.1.5 1.1.5.1 1.1.6 1.1.6.1 1.1.7 1.1.7.1 1.1.7.2 1.1.8 1.1.8.1 1.1.8.2 1.1.8.3 1.1.8.4 1.10.0.1 1.10.0.2 1.10.0.3 1.10.0.4 1.2.0 1.2.0.1 1.2.1 1.2.2 1.2.2.1 1.2.2.2 1.2.3 1.2.3.1 1.2.3.2 1.2.4 1.2.4.1 1.2.5 1.2.5.1 1.2.6 1.2.7 1.2.8 1.2.8.1 1.2.9 1.3.0 1.3.1 1.3.1.1 1.3.1.2 1.3.2 1.3.3 1.3.5 1.3.6 1.3.6.1 1.3.6.2 1.3.7.2 1.3.7.3 1.3.7.4 1.3.8 1.3.9.1 1.4.0.1 1.4.1.1 1.4.2 1.4.2.1 1.4.2.2 1.4.3 1.4.4 1.4.4.1 1.4.5 1.4.5.1 1.4.5.2 1.4.5.3 1.4.6 1.4.7.1 1.4.7.2 1.4.8.1 1.4.9 1.5.0.1 1.5.0.3 1.5.0.4 1.5.1 1.5.1.1 1.5.1.3 1.5.2.1 1.5.2.2 1.5.2.3 1.5.3 1.5.3.1 1.5.4.1 1.5.4.2 1.5.5 1.5.5.1 1.5.6 1.5.6.2 1.5.7 1.5.8.2 1.5.9.1 1.5.9.4 1.5.9.5 1.6.0.1 1.6.0.2 1.6.1 1.6.2.2 1.6.2.3 1.6.3.1 1.6.4 1.6.4.1 1.6.5 1.6.6 1.6.7 1.6.7.1 1.6.7.2 1.6.7.3 1.6.8 1.6.8.1 1.6.9 1.7.0 1.7.1.1 1.7.1.2 1.7.2 1.7.2.1 1.7.3 1.7.4 1.7.4.1 1.7.4.2 1.7.5.1 1.7.5.2 1.7.5.3 1.7.5.5 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.7.9.1 1.8.0.1 1.8.0.2 1.8.1.1 1.8.1.2 1.8.1.3 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.3.1 1.8.4 1.8.4.1 1.8.5.2 1.8.5.3 1.8.5.4 1.8.6.2 1.8.6.3 1.8.6.4 1.8.7.2 1.8.8.2 1.8.8.3 1.8.9.1 1.8.9.2 1.8.9.4 1.8.9.5 1.8.9.6 1.9.0.1 1.9.0.2 1.9.0.3 1.9.0.4 1.9.1.1 1.9.1.2 1.9.1.3 1.9.1.4 1.9.1.5 1.9.1.6 1.9.2.1 1.9.2.2 1.9.2.3 1.9.3.1 1.9.3.2 1.9.4.1 1.9.4.2 1.9.5 1.9.5.1 1.9.5.2 1.9.6 1.9.6.1 1.9.6.2 1.9.7.1 1.9.7.2 1.9.7.3 1.9.8.1 1.9.8.2 1.9.8.4 1.9.8.7 1.9.9.2 1.9.9.3 1.9.9.4
wpforms-lite / includes / functions / education.php
wpforms-lite / includes / functions Last commit date
access.php 8 months ago builder.php 11 months ago checks.php 2 months ago colors.php 2 years ago data-presets.php 6 months ago date-time.php 11 months ago debug.php 9 months ago education.php 11 months ago escape-sanitize.php 6 months ago filesystem-media.php 1 year ago form-fields.php 2 months ago forms.php 2 months ago list.php 1 year ago payments.php 10 months ago plugins.php 11 months ago privacy.php 1 year ago providers.php 11 months ago utilities.php 4 months ago
education.php
97 lines
1 <?php
2 /**
3 * Helpers functions for the Education pages.
4 *
5 * @since 1.8.2.2
6 */
7
8 /**
9 * Get the button.
10 *
11 * @since 1.8.2.2
12 * @since 1.9.6.1 Add $license_level parameter.
13 *
14 * @param string $action Action to perform.
15 * @param bool $plugin_allow Is plugin allowed.
16 * @param string $path Plugin file.
17 * @param string $url URL for download plugin.
18 * @param array $utm UTM parameters.
19 * @param string $license_level License level.
20 */
21 function wpforms_edu_get_button( $action, $plugin_allow, $path, $url, $utm, $license_level = '' ) {
22
23 // If the user is not allowed to use the plugin, show the upgrade button.
24 if ( ! $plugin_allow ) {
25 wpforms_edu_get_upgrade_button( $utm, [], $license_level );
26
27 return;
28 }
29
30 $status = 'inactive';
31 $data_plugin = $path;
32 $title = esc_html__( 'Activate', 'wpforms-lite' );
33 $can_install = wpforms_can_install( 'addon' );
34
35 if ( $action === 'install' ) {
36 $status = 'download';
37 $data_plugin = $url;
38 $title = esc_html__( 'Install & Activate', 'wpforms-lite' );
39 }
40
41 ?>
42
43 <?php if ( $action === 'install' && ! $can_install ) : ?>
44 <div class="wpforms-notice wpforms-error">
45 <p><?php esc_html_e( 'Plugin installation is disabled for this site.', 'wpforms-lite' ); ?></p>
46 </div>
47 <?php else : ?>
48 <button
49 class="status-<?php echo esc_attr( $status ); ?> wpforms-btn wpforms-btn-lg wpforms-btn-blue wpforms-education-toggle-plugin-btn"
50 data-type="addon"
51 data-action="<?php echo esc_attr( $action ); ?>"
52 data-plugin="<?php echo esc_attr( $data_plugin ); ?>">
53 <i></i><?php echo esc_html( $title ); ?>
54 <?php endif; ?>
55 <?php
56 }
57
58 /**
59 * Get the upgrade button.
60 *
61 * @since 1.8.2.2
62 * @since 1.9.6.1 Add $license_level parameter.
63 *
64 * @param array $utm UTM parameters.
65 * @param array $classes Classes.
66 * @param string $license_level License level.
67 */
68 function wpforms_edu_get_upgrade_button( $utm, $classes = [], $license_level = '' ) {
69
70 $utm_medium = isset( $utm['medium'] ) ? $utm['medium'] : '';
71 $utm_content = isset( $utm['content'] ) ? $utm['content'] : '';
72
73 $default_classes = [ 'wpforms-btn', 'wpforms-btn-lg', 'wpforms-btn-orange' ];
74 $default_classes[] = ! wpforms()->is_pro() ? 'wpforms-upgrade-modal' : '';
75
76 $btn_classes = array_merge( $default_classes, (array) $classes );
77
78 $upgrade_button_label = esc_html__( 'Upgrade to WPForms Pro', 'wpforms-lite' );
79
80 if ( ! empty( $license_level ) && is_string( $license_level ) ) {
81 $upgrade_button_label = sprintf(
82 /* translators: %s: License name. */
83 esc_html__( 'Upgrade to WPForms %s', 'wpforms-lite' ),
84 esc_html( ucfirst( $license_level ) )
85 );
86 }
87 ?>
88 <a
89 href="<?php echo esc_url( wpforms_admin_upgrade_link( $utm_medium, $utm_content ) ); ?>"
90 target="_blank"
91 rel="noopener noreferrer"
92 class="<?php echo esc_attr( implode( ' ', array_filter( $btn_classes ) ) ); ?>">
93 <?php echo esc_html( $upgrade_button_label ); ?>
94 </a>
95 <?php
96 }
97