C:\xampp\htdocs\landing\wp-content\plugins\wpforms-lite\src\Lite\Admin\Settings\Education.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php

namespace WPForms\Lite\Admin\Settings;

use 
WPForms\Admin\Settings\Geolocation;

/**
 * Settings changes and enhancements to educate Lite users on what is
 * available in WPForms Pro.
 *
 * @since 1.5.5
 */
class Education {

    
/**
     * Constructor.
     *
     * @since 1.5.1
     */
    
public function __construct() {

        
$this->hooks();
    }

    
/**
     * Hooks.
     *
     * @since 1.5.1
     */
    
public function hooks() {

        
// Only proceed for the Settings > Integrations tab.
        
if ( ! \wpforms_is_admin_page'settings' ) ) {
            return;
        }

        
// Integrations related hooks.
        
if ( \wpforms_is_admin_page'settings''integrations' ) ) {
            \
add_filter'wpforms_admin_strings', array( $this'js_strings' ) );
            \
add_action'admin_enqueue_scripts', array( $this'enqueues' ) );
            \
add_action'wpforms_settings_providers', array( $this'providers' ), 10000);
        }

        
// Geolocation API related hooks.
        
if ( \wpforms_is_admin_page'settings''geolocation' ) ) {
            \
add_action'wpforms_settings_init', [ $this'geolocation_settings' ] );
        }
    }

    
/**
     * Localize needed strings.
     *
     * @since 1.5.5
     *
     * @param array $strings JS strings.
     *
     * @return array
     */
    
public function js_strings$strings ) {

        
$strings['upgrade'] = [
            
'pro'   => [
                
'title'   => esc_html__'is a PRO Feature''wpforms-lite' ),
                
'message' => '<p>' esc_html__'We\'re sorry, the %name% is not available on your plan. Please upgrade to the PRO plan to unlock all these awesome features.''wpforms-lite' ) . '</p>',
                
'bonus'   => '<p>' .
                    
wp_kses(
                        
__'<strong>Bonus:</strong> WPForms Lite users get <span>50% off</span> regular price, automatically applied at checkout.''wpforms-lite' ),
                        [
                            
'strong' => [],
                            
'span'   => [],
                        ]
                    ) .
                    
'</p>',
                
'doc'     => '<a href="https://wpforms.com/docs/upgrade-wpforms-lite-paid-license/?utm_source=WordPress&amp;utm_medium=link&amp;utm_campaign=liteplugin&amp;utm_content=upgrade-pro" target="_blank" rel="noopener noreferrer" class="already-purchased">' esc_html__'Already purchased?''wpforms-lite' ) . '</a>',
                
'button'  => esc_html__'Upgrade to PRO''wpforms-lite' ),
                
'url'     => wpforms_admin_upgrade_link'settings-modal''upgrade-pro' ),
                
'modal'   => wpforms_get_upgrade_modal_text'pro' ),
            ],
            
'elite' => [
                
'title'   => esc_html__'is an Elite Feature''wpforms-lite' ),
                
'message' => '<p>' esc_html__'We\'re sorry, the %name% is not available on your plan. Please upgrade to the Elite plan to unlock all these awesome features.''wpforms-lite' ) . '</p>',
                
'bonus'   => '<p>' .
                    
wp_kses(
                        
__'<strong>Bonus:</strong> WPForms Lite users get <span>50% off</span> regular price, automatically applied at checkout.''wpforms-lite' ),
                        [
                            
'strong' => [],
                            
'span'   => [],
                        ]
                    ) .
                    
'</p>',
                
'doc'     => '<a href="https://wpforms.com/docs/upgrade-wpforms-lite-paid-license/?utm_source=WordPress&amp;utm_medium=link&amp;utm_campaign=liteplugin&amp;utm_content=upgrade-elite" target="_blank" rel="noopener noreferrer" class="already-purchased">' esc_html__'Already purchased?''wpforms-lite' ) . '</a>',
                
'button'  => esc_html__'Upgrade to Elite''wpforms-lite' ),
                
'url'     => wpforms_admin_upgrade_link'settings-modal''upgrade-elite' ),
                
'modal'   => wpforms_get_upgrade_modal_text'elite' ),
            ],
        ];

        return 
$strings;
    }

    
/**
     * Load enqueues.
     *
     * @since 1.5.5
     */
    
public function enqueues() {

        
$min = \wpforms_get_min_suffix();

        \
wp_enqueue_script(
            
'wpforms-settings-education',
            \
WPFORMS_PLUGIN_URL "lite/assets/js/admin/settings-education{$min}.js",
            array( 
'jquery''jquery-confirm' ),
            \
WPFORMS_VERSION,
            
false
        
);
    }

    
/**
     * Display providers.
     *
     * @since 1.5.5
     */
    
public function providers() {

        
$providers wpforms_get_providers_all();

        foreach ( 
$providers as $provider ) {

            
/* translators: %s - addon name. */
            
$modal_name sprintf( \__'%s addon''wpforms-lite' ), $provider['name'] );

            
/* translators: %s - addon name. */
            
$descr sprintf( \__'Integrate %s with WPForms''wpforms-lite' ), $provider['name'] );

            
printf(
                
'<div id="wpforms-integration-%1$s" class="wpforms-settings-provider wpforms-clear focus-out education-modal" data-name="%2$s" data-action="upgrade" data-url="%3$s" data-license="%4$s">
                    <div class="wpforms-settings-provider-header wpforms-clear">
                        <div class="wpforms-settings-provider-logo ">
                            <i class="fa fa-chevron-right"></i>
                            %5$s
                        </div>
                        <div class="wpforms-settings-provider-info">
                            <h3>%6$s</h3>
                            <p>%7$s</p>
                        </div>
                    </div>
                </div>'
,
                \
esc_attr$provider['slug'] ),
                \
esc_attr$modal_name ),
                isset( 
$provider['url'] ) ? \esc_attr$provider['url'] ) : '',
                \
esc_attr$provider['license'] ),
                
'<img src="' . \esc_attrWPFORMS_PLUGIN_URL ) . 'assets/images/' . \esc_attr$provider['img'] ) . '">',
                \
esc_html$provider['name'] ),
                \
esc_html$descr )
            );
        }
    }

    
/**
     * Add Geolocation settings page.
     *
     * @since 1.6.5
     */
    
public function geolocation_settings() {

        ( new 
Geolocation() )->hooks();
    }
}
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586