/var/www/(Del)hsihk.com/wp-content/plugins/ninja-forms/includes/admin/pages/system-status-html.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<div class="nf-box">
    <div>
        <h4><?php _e'Please include this information when requesting support:''ninja-forms' ); ?> </h4>
        <p class="submit debug-report"><a href="#" class="button-primary"><?php _e'Get System Report''ninja-forms' ); ?></a></p>
    </div>
    <div id="debug-report"><textarea readonly="readonly"></textarea></div>
</div>
<br/>
<table class="nf-status-table" cellspacing="0">
    <thead>
        <tr>
            <th colspan="2"><?php _e'Environment''ninja-forms' ); ?></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><?php _e'Home URL','ninja-forms' ); ?>:</td>
            <td><?php echo home_url(); ?></td>
        </tr>
        <tr>
            <td><?php _e'Site URL','ninja-forms' ); ?>:</td>
            <td><?php echo site_url(); ?></td>
        </tr>
        <tr>
            <td><?php _e'Ninja Forms Version','ninja-forms' ); ?>:</td>
            <td><?php echo esc_htmlNF_PLUGIN_VERSION ); ?></td>
        </tr>
        <tr>
            <td><?php _e'WP Version','ninja-forms' ); ?>:</td>
            <td><?php bloginfo('version'); ?></td>
        </tr>
        <tr>
            <td><?php _e'WP Multisite Enabled','ninja-forms' ); ?>:</td>
            <td><?php if ( is_multisite() ) echo __'Yes''ninja-forms' ); else echo __'No''ninja-forms' ); ?></td>
        </tr>
        <tr>
            <td><?php _e'Web Server Info','ninja-forms' ); ?>:</td>
            <td><?php echo esc_html$_SERVER['SERVER_SOFTWARE'] ); ?></td>
        </tr>
        <tr>
            <td><?php _e'PHP Version','ninja-forms' ); ?>:</td>
            <td><?php if ( function_exists'phpversion' ) ) echo esc_htmlphpversion() ); ?></td>
        </tr>
        <tr>
            <td><?php _e'MySQL Version','ninja-forms' ); ?>:</td>
            <td>
                <?php
                
/** @global wpdb $wpdb */
                
global $wpdb;
                echo 
$wpdb->db_version();
                
?>
            </td>
        </tr>
        <tr>
            <td><?php _e'PHP Locale','ninja-forms' ); ?>:</td>
            <td><?php
                $locale 
localeconv();
                foreach ( 
$locale as $key => $val )
                    if ( 
is_string$val ) )
                        echo 
$key ': ' $val '</br>';
            
?></td>
        </tr>
        <tr>
            <td><?php _e'WP Memory Limit','ninja-forms' ); ?>:</td>
            <td><?php
                $memory 
ninja_forms_letters_to_numbersWP_MEMORY_LIMIT );
                echo 
size_format$memory );
                
?>
            </td>
        </tr>
        <tr>
            <td><?php _e'WP Debug Mode''ninja-forms' ); ?>:</td>
            <td><?php if ( defined('WP_DEBUG') && WP_DEBUG ) echo __'Yes''ninja-forms' ); else echo __'No''ninja-forms' ); ?></td>
        </tr>
        <tr>
            <td><?php _e'WP Language''ninja-forms' ); ?>:</td>
            <td><?php if ( defined'WPLANG' ) && WPLANG ) echo WPLANG; else  _e'Default''ninja-forms' ); ?></td>
        </tr>
        <tr>
            <td><?php _e'WP Max Upload Size','ninja-forms' ); ?>:</td>
            <td><?php echo size_formatwp_max_upload_size() ); ?></td>
        </tr>
        <?php if ( function_exists'ini_get' ) ) : ?>
            <tr>
                <td><?php _e('PHP Post Max Size','ninja-forms' ); ?>:</td>
                <td><?php echo size_formatninja_forms_letters_to_numbersini_get('post_max_size') ) ); ?></td>
            </tr>
            <tr>
                <td><?php _e('Max Input Nesting Level','ninja-forms' ); ?>:</td>
                <td><?php echo ini_get('max_input_nesting_level'); ?></td>
            </tr>
            <tr>
                <td><?php _e('PHP Time Limit','ninja-forms' ); ?>:</td>
                <td><?php echo ini_get('max_execution_time'); ?></td>
            </tr>
            <tr>
                <td><?php _e'PHP Max Input Vars','ninja-forms' ); ?>:</td>
                <td><?php echo ini_get('max_input_vars'); ?></td>
            </tr>
            <tr>
                <td><?php _e'SUHOSIN Installed','ninja-forms' ); ?>:</td>
                <td><?php echo extension_loaded'suhosin' ) ? __'Yes''ninja-forms' ) : __'No''ninja-forms' ); ?></td>
            </tr>
            <tr>
                <td><?php _e'SMTP','ninja-forms' ); ?>:</td>
                <td><?php echo ini_get('SMTP'); ?></td>
            </tr>
            <tr>
                <td><?php _e'smtp_port','ninja-forms' ); ?>:</td>
                <td><?php echo ini_get('smtp_port'); ?></td>
            </tr>
        <?php endif; ?>
        <tr>
            <td><?php _e'Default Timezone','ninja-forms' ); ?>:</td>
            <td><?php
                $default_timezone 
date_default_timezone_get();
                if ( 
'UTC' !== $default_timezone ) {
                    echo 
sprintf__'Default timezone is %s - it should be UTC''ninja-forms' ), $default_timezone );
                } else {
                    echo 
sprintf__'Default timezone is %s''ninja-forms' ), $default_timezone );
                } 
?>
            </td>
        </tr>
        <?php
            $posting 
= array();

            
// fsockopen/cURL
            
$posting['fsockopen_curl']['name'] = __'fsockopen/cURL','ninja-forms');
            if ( 
function_exists'fsockopen' ) || function_exists'curl_init' ) ) {
                if ( 
function_exists'fsockopen' ) && function_exists'curl_init' )) {
                    
$posting['fsockopen_curl']['note'] = __('Your server has fsockopen and cURL enabled.''ninja-forms' );
                } elseif ( 
function_exists'fsockopen' )) {
                    
$posting['fsockopen_curl']['note'] = __'Your server has fsockopen enabled, cURL is disabled.''ninja-forms' );
                } else {
                    
$posting['fsockopen_curl']['note'] = __'Your server has cURL enabled, fsockopen is disabled.''ninja-forms' );
                }
                
$posting['fsockopen_curl']['success'] = true;
            } else {
                
$posting['fsockopen_curl']['note'] = __'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.''ninja-forms' );
                
$posting['fsockopen_curl']['success'] = false;
            }

            
// SOAP
            
$posting['soap_client']['name'] = __'SOAP Client','ninja-forms' );
            if ( 
class_exists'SoapClient' ) ) {
                
$posting['soap_client']['note'] = __('Your server has the SOAP Client class enabled.''ninja-forms' );
                
$posting['soap_client']['success'] = true;
            } else {
                
$posting['soap_client']['note'] = sprintf__'Your server does not have the <a href="%s">SOAP Client</a> class enabled - some gateway plugins which use SOAP may not work as expected.''ninja-forms' ), 'http://php.net/manual/en/class.soapclient.php' );
                
$posting['soap_client']['success'] = false;
            }

            
// WP Remote Post Check
            
$posting['wp_remote_post']['name'] = __'WP Remote Post','ninja-forms');
            
$request['cmd'] = '_notify-validate';
            
$params = array(
                
'sslverify'     => false,
                
'timeout'         => 60,
                
'user-agent'    => 'Ninja Forms/' NF_PLUGIN_VERSION,
                
'body'            => $request
            
);
            
$response wp_remote_post'https://www.paypal.com/cgi-bin/webscr'$params );

            if ( ! 
is_wp_error$response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
                
$posting['wp_remote_post']['note'] = __('wp_remote_post() was successful - PayPal IPN is working.''ninja-forms' );
                
$posting['wp_remote_post']['success'] = true;
            } elseif ( 
is_wp_error$response ) ) {
                
$posting['wp_remote_post']['note'] = __'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider. Error:''ninja-forms' ) . ' ' $response->get_error_message();
                
$posting['wp_remote_post']['success'] = false;
            } else {
                
$posting['wp_remote_post']['note'] = __'wp_remote_post() failed. PayPal IPN may not work with your server.''ninja-forms' );
                
$posting['wp_remote_post']['success'] = false;
            }
        
?>
    </tbody>
    <thead>
        <tr>
            <th colspan="2"><?php _e'Plugins''ninja-forms' ); ?></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><?php _e'Installed Plugins','ninja-forms' ); ?>:</td>
            <td><?php
                $active_plugins 
= (array) get_option'active_plugins', array() );

                if ( 
is_multisite() )
                    
$active_plugins array_merge$active_pluginsget_site_option'active_sitewide_plugins', array() ) );

                
$all_plugins = array();

                foreach ( 
$active_plugins as $plugin ) {

                    
$plugin_data    = @get_plugin_dataWP_PLUGIN_DIR '/' $plugin );
                    
$dirname        dirname$plugin );
                    
$version_string '';

                    if ( ! empty( 
$plugin_data['Name'] ) ) {

                        
// link the plugin name to the plugin url if available
                        
$plugin_name $plugin_data['Name'];
                        if ( ! empty( 
$plugin_data['PluginURI'] ) ) {
                            
$plugin_name '<a href="' $plugin_data['PluginURI'] . '" title="' __'Visit plugin homepage' 'ninja-forms' ) . '">' $plugin_name '</a>';
                        }

                        
$all_plugins[] = $plugin_name ' ' __'by''ninja-forms' ) . ' ' $plugin_data['Author'] . ' ' __'version''ninja-forms' ) . ' ' $plugin_data['Version'] . $version_string;

                    }
                }

                if ( 
sizeof$all_plugins ) == )
                    echo 
'-';
                else
                    echo 
implode', <br/>'$all_plugins );

            
?></td>
        </tr>
    </tbody>

</table>

<script type="text/javascript">
    /*
    @var i string default
    @var l how many repeat s
    @var s string to repeat
    @var w where s should indent
    */
    jQuery.wc_strPad = function(i,l,s,w) {
        var o = i.toString();
        if (!s) { s = '0'; }
        while (o.length < l) {
            // empty
            if(w == 'undefined'){
                o = s + o;
            }else{
                o = o + s;
            }
        }
        return o;
    };


    jQuery('.debug-report a').click(function(){

        var paragraphContainer = jQuery( this ).parent();
        var report = "";

        jQuery('.nf-status-table thead, .nf-status-table tbody').each(function(){

            if ( jQuery( this ).is('thead') ) {

                report = report + "\n### " + jQuery.trim( jQuery( this ).text() ) + " ###\n\n";

            } else {

                jQuery('tr', jQuery( this )).each(function(){

                    var the_name    = jQuery.wc_strPad( jQuery.trim( jQuery( this ).find('td:eq(0)').text() ), 25, ' ' );
                    var the_value   = jQuery.trim( jQuery( this ).find('td:eq(1)').text() );
                    var value_array = the_value.split( ', ' );

                    if ( value_array.length > 1 ){

                        // if value have a list of plugins ','
                        // split to add new line
                        var output = '';
                        var temp_line ='';
                        jQuery.each( value_array, function(key, line){
                            var tab = ( key == 0 )?0:25;
                            temp_line = temp_line + jQuery.wc_strPad( '', tab, ' ', 'f' ) + line +'\n';
                        });

                        the_value = temp_line;
                    }

                    report = report +''+ the_name + the_value + "\n";
                });

            }
        } );

        try {
            jQuery("#debug-report").slideDown();
            jQuery("#debug-report textarea").val( report ).focus().select();
            paragraphContainer.slideUp();
            return false;
        } catch(e){ console.log( e ); }

        return false;
    });
</script>