Conditions | 36 |
Paths | > 20000 |
Total Lines | 373 |
Code Lines | 262 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
62 | public static function jetpack_debug_display_handler() { |
||
63 | if ( ! current_user_can( 'manage_options' ) ) |
||
64 | wp_die( esc_html__('You do not have sufficient permissions to access this page.', 'jetpack' ) ); |
||
65 | |||
66 | $current_user = wp_get_current_user(); |
||
67 | |||
68 | $user_id = get_current_user_id(); |
||
69 | $user_tokens = Jetpack_Options::get_option( 'user_tokens' ); |
||
70 | if ( is_array( $user_tokens ) && array_key_exists( $user_id, $user_tokens ) ) { |
||
71 | $user_token = $user_tokens[$user_id]; |
||
72 | } else { |
||
73 | $user_token = '[this user has no token]'; |
||
74 | } |
||
75 | unset( $user_tokens ); |
||
76 | |||
77 | $debug_info = "\r\n"; |
||
78 | foreach ( array( |
||
79 | 'CLIENT_ID' => 'id', |
||
80 | 'BLOG_TOKEN' => 'blog_token', |
||
81 | 'MASTER_USER' => 'master_user', |
||
82 | 'CERT' => 'fallback_no_verify_ssl_certs', |
||
83 | 'TIME_DIFF' => 'time_diff', |
||
84 | 'VERSION' => 'version', |
||
85 | 'OLD_VERSION' => 'old_version', |
||
86 | 'PUBLIC' => 'public', |
||
87 | ) as $label => $option_name ) { |
||
88 | $debug_info .= "\r\n" . esc_html( $label . ": " . Jetpack_Options::get_option( $option_name ) ); |
||
89 | } |
||
90 | |||
91 | $debug_info .= "\r\n" . esc_html( "USER_ID: " . $user_id ); |
||
92 | $debug_info .= "\r\n" . esc_html( "USER_TOKEN: " . $user_token ); |
||
93 | $debug_info .= "\r\n" . esc_html( "PHP_VERSION: " . PHP_VERSION ); |
||
94 | $debug_info .= "\r\n" . esc_html( "WORDPRESS_VERSION: " . $GLOBALS['wp_version'] ); |
||
95 | $debug_info .= "\r\n" . esc_html( "JETPACK__VERSION: " . JETPACK__VERSION ); |
||
96 | $debug_info .= "\r\n" . esc_html( "JETPACK__PLUGIN_DIR: " . JETPACK__PLUGIN_DIR ); |
||
97 | $debug_info .= "\r\n" . esc_html( "SITE_URL: " . site_url() ); |
||
98 | $debug_info .= "\r\n" . esc_html( "HOME_URL: " . home_url() ); |
||
99 | $debug_info .= "\r\n" . esc_html( "PLAN: " . self::what_jetpack_plan() ); |
||
100 | |||
101 | $debug_info .= "\r\n"; |
||
102 | require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-modules.php'; |
||
103 | $sync_module = Jetpack_Sync_Modules::get_module( 'full-sync' ); |
||
104 | $sync_statuses = $sync_module->get_status(); |
||
105 | $human_readable_sync_status = array(); |
||
106 | foreach( $sync_statuses as $sync_status => $sync_status_value ) { |
||
107 | $human_readable_sync_status[ $sync_status ] = |
||
108 | in_array( $sync_status, array( 'started', 'queue_finished', 'send_started', 'finished' ) ) |
||
109 | ? date( 'r', $sync_status_value ) : $sync_status_value ; |
||
110 | } |
||
111 | |||
112 | $debug_info .= "\r\n". sprintf( esc_html__( 'Jetpack Sync Full Status: `%1$s`', 'jetpack' ), print_r( $human_readable_sync_status, 1 ) ); |
||
113 | |||
114 | require_once JETPACK__PLUGIN_DIR. 'sync/class.jetpack-sync-sender.php'; |
||
115 | |||
116 | $queue = Jetpack_Sync_Sender::get_instance()->get_sync_queue(); |
||
117 | |||
118 | $debug_info .= "\r\n". sprintf( esc_html__( 'Sync Queue size: %1$s', 'jetpack' ), $queue->size() ); |
||
119 | $debug_info .= "\r\n". sprintf( esc_html__( 'Sync Queue lag: %1$s', 'jetpack' ), self::seconds_to_time( $queue->lag() ) ); |
||
120 | |||
121 | $full_sync_queue = Jetpack_Sync_Sender::get_instance()->get_full_sync_queue(); |
||
122 | |||
123 | $debug_info .= "\r\n". sprintf( esc_html__( 'Full Sync Queue size: %1$s', 'jetpack' ), $full_sync_queue->size() ); |
||
124 | $debug_info .= "\r\n". sprintf( esc_html__( 'Full Sync Queue lag: %1$s', 'jetpack' ), self::seconds_to_time( $full_sync_queue->lag() ) ); |
||
125 | |||
126 | require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-functions.php'; |
||
127 | $idc_urls = array( |
||
128 | 'home' => Jetpack_Sync_Functions::home_url(), |
||
129 | 'siteurl' => Jetpack_Sync_Functions::site_url(), |
||
130 | 'WP_HOME' => Jetpack_Constants::is_defined( 'WP_HOME' ) ? Jetpack_Constants::get_constant( 'WP_HOME' ) : '', |
||
131 | 'WP_SITEURL' => Jetpack_Constants::is_defined( 'WP_SITEURL' ) ? Jetpack_Constants::get_constant( 'WP_SITEURL' ) : '', |
||
132 | ); |
||
133 | $debug_info .= "\r\n". esc_html( sprintf( 'Sync IDC URLs: %s', json_encode( $idc_urls ) ) ); |
||
134 | $debug_info .= "\r\n". esc_html( sprintf( 'Sync error IDC option: %s', json_encode( Jetpack_Options::get_option( 'sync_error_idc' ) ) ) ); |
||
135 | $debug_info .= "\r\n". esc_html( sprintf( 'Sync IDC Optin: %s', (string) Jetpack::sync_idc_optin() ) ); |
||
136 | |||
137 | $debug_info .= "\r\n"; |
||
138 | |||
139 | foreach ( array ( |
||
140 | 'HTTP_HOST', |
||
141 | 'SERVER_PORT', |
||
142 | 'HTTPS', |
||
143 | 'GD_PHP_HANDLER', |
||
144 | 'HTTP_AKAMAI_ORIGIN_HOP', |
||
145 | 'HTTP_CF_CONNECTING_IP', |
||
146 | 'HTTP_CLIENT_IP', |
||
147 | 'HTTP_FASTLY_CLIENT_IP', |
||
148 | 'HTTP_FORWARDED', |
||
149 | 'HTTP_FORWARDED_FOR', |
||
150 | 'HTTP_INCAP_CLIENT_IP', |
||
151 | 'HTTP_TRUE_CLIENT_IP', |
||
152 | 'HTTP_X_CLIENTIP', |
||
153 | 'HTTP_X_CLUSTER_CLIENT_IP', |
||
154 | 'HTTP_X_FORWARDED', |
||
155 | 'HTTP_X_FORWARDED_FOR', |
||
156 | 'HTTP_X_IP_TRAIL', |
||
157 | 'HTTP_X_REAL_IP', |
||
158 | 'HTTP_X_VARNISH', |
||
159 | 'REMOTE_ADDR' |
||
160 | ) as $header ) { |
||
161 | if ( isset( $_SERVER[ $header ] ) ) { |
||
162 | $debug_info .= "\r\n" . esc_html( $header . ": " . $_SERVER[ $header ] ); |
||
163 | } |
||
164 | } |
||
165 | |||
166 | $debug_info .= "\r\n" . esc_html( "PROTECT_TRUSTED_HEADER: " . json_encode( get_site_option( 'trusted_ip_header' ) ) ); |
||
167 | |||
168 | $debug_info .= "\r\n\r\nTEST RESULTS:\r\n\r\n"; |
||
169 | $debug_raw_info = ''; |
||
170 | |||
171 | |||
172 | $tests = array(); |
||
173 | |||
174 | $tests['HTTP']['result'] = wp_remote_get( preg_replace( '/^https:/', 'http:', JETPACK__API_BASE ) . 'test/1/' ); |
||
175 | $tests['HTTP']['fail_message'] = esc_html__( 'Your site isn’t reaching the Jetpack servers.', 'jetpack' ); |
||
176 | |||
177 | $tests['HTTPS']['result'] = wp_remote_get( preg_replace( '/^http:/', 'https:', JETPACK__API_BASE ) . 'test/1/' ); |
||
178 | $tests['HTTPS']['fail_message'] = esc_html__( 'Your site isn’t securely reaching the Jetpack servers.', 'jetpack' ); |
||
179 | |||
180 | $identity_crisis_message = ''; |
||
181 | if ( $identity_crisis = Jetpack::check_identity_crisis() ) { |
||
182 | $identity_crisis_message .= sprintf( |
||
183 | __( 'Your url is set as `%1$s`, but your WordPress.com connection lists it as `%2$s`!', 'jetpack' ), |
||
184 | $identity_crisis['home'], |
||
185 | $identity_crisis['wpcom_home'] |
||
186 | ); |
||
187 | $identity_crisis = new WP_Error( 'identity-crisis', $identity_crisis_message, $identity_crisis ); |
||
188 | } else { |
||
189 | $identity_crisis = 'PASS'; |
||
190 | } |
||
191 | $tests['IDENTITY_CRISIS']['result'] = $identity_crisis; |
||
192 | $tests['IDENTITY_CRISIS']['fail_message'] = esc_html__( 'Something has gotten mixed up in your Jetpack Connection!', 'jetpack' ); |
||
193 | |||
194 | $self_xml_rpc_url = site_url( 'xmlrpc.php' ); |
||
195 | |||
196 | $testsite_url = Jetpack::fix_url_for_bad_hosts( JETPACK__API_BASE . 'testsite/1/?url=' ); |
||
197 | |||
198 | add_filter( 'http_request_timeout', array( 'Jetpack_Debugger', 'jetpack_increase_timeout' ) ); |
||
199 | |||
200 | $tests['SELF']['result'] = wp_remote_get( $testsite_url . $self_xml_rpc_url ); |
||
201 | if ( is_wp_error( $tests['SELF']['result'] ) && 0 == strpos( $tests['SELF']['result']->get_error_message(), 'Operation timed out' ) ){ |
||
202 | $tests['SELF']['fail_message'] = esc_html__( 'Your site did not get a response from our debugging service in the expected timeframe. If you are not experiencing other issues, this could be due to a slow connection between your site and our server.', 'jetpack' ); |
||
203 | } else { |
||
204 | $tests['SELF']['fail_message'] = esc_html__( 'It looks like your site can not communicate properly with Jetpack.', 'jetpack' ); |
||
205 | } |
||
206 | |||
207 | remove_filter( 'http_request_timeout', array( 'Jetpack_Debugger', 'jetpack_increase_timeout' ) ); |
||
208 | |||
209 | ?> |
||
210 | <div class="wrap"> |
||
211 | <h2><?php esc_html_e( 'Jetpack Debugging Center', 'jetpack' ); ?></h2> |
||
212 | <?php if ( isset( $can_disconnect ) && $can_disconnect ) : ?> |
||
|
|||
213 | <div id="message" class="updated notice notice-success is-dismissible"><p><?php esc_html_e( 'This site was successfully disconnected.', 'jetpack' ) ?> <a href="<?php echo esc_url( Jetpack::admin_url() ); ?>"><?php esc_html_e( 'Go to connection screen.', 'jetpack' ); ?></a></p> |
||
214 | <button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.', 'jetpack' ); ?></span></button></div> |
||
215 | <?php else: ?> |
||
216 | <h3><?php _e( "Testing your site's compatibility with Jetpack...", 'jetpack' ); ?></h3> |
||
217 | <div class="jetpack-debug-test-container"> |
||
218 | <?php |
||
219 | ob_start(); |
||
220 | foreach ( $tests as $test_name => $test_info ) : |
||
221 | if ( 'PASS' !== $test_info['result'] && ( is_wp_error( $test_info['result'] ) || |
||
222 | false == ( $response_code = wp_remote_retrieve_response_code( $test_info['result'] ) ) || |
||
223 | '200' != $response_code ) ) { |
||
224 | $debug_info .= $test_name . ": FAIL\r\n"; |
||
225 | ?> |
||
226 | <div class="jetpack-test-error"> |
||
227 | <p> |
||
228 | <a class="jetpack-test-heading" href="#"><?php echo $test_info['fail_message']; ?> |
||
229 | <span class="noticon noticon-collapse"></span> |
||
230 | </a> |
||
231 | </p> |
||
232 | <pre class="jetpack-test-details"><?php echo esc_html( $test_name ); ?>: |
||
233 | <?php echo esc_html( is_wp_error( $test_info['result'] ) ? $test_info['result']->get_error_message() : print_r( $test_info['result'], 1 ) ); ?></pre> |
||
234 | </div><?php |
||
235 | } else { |
||
236 | $debug_info .= $test_name . ": PASS\r\n"; |
||
237 | } |
||
238 | $debug_raw_info .= "\r\n\r\n" . $test_name . "\r\n" . esc_html( is_wp_error( $test_info['result'] ) ? $test_info['result']->get_error_message() : print_r( $test_info['result'], 1 ) ); |
||
239 | ?> |
||
240 | <?php endforeach; |
||
241 | $html = ob_get_clean(); |
||
242 | |||
243 | if ( '' == trim( $html ) ) { |
||
244 | echo '<div class="jetpack-tests-succed">' . esc_html__( 'Your Jetpack setup looks a-okay!', 'jetpack' ) . '</div>'; |
||
245 | } else { |
||
246 | echo '<h3>' . esc_html__( 'There seems to be a problem with your site’s ability to communicate with Jetpack!', 'jetpack' ) . '</h3>'; |
||
247 | echo $html; |
||
248 | } |
||
249 | $debug_info .= "\r\n\r\nRAW TEST RESULTS:" . $debug_raw_info ."\r\n"; |
||
250 | ?> |
||
251 | </div> |
||
252 | <?php endif; ?> |
||
253 | |||
254 | <div class="entry-content"> |
||
255 | <h3><?php esc_html_e( 'Trouble with Jetpack?', 'jetpack' ); ?></h3> |
||
256 | <h4><?php esc_html_e( 'It may be caused by one of these issues, which you can diagnose yourself:', 'jetpack' ); ?></h4> |
||
257 | <ol> |
||
258 | <li><b><em><?php esc_html_e( 'A known issue.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Some themes and plugins have <a href="%1$s" target="_blank">known conflicts</a> with Jetpack – check the <a href="%2$s" target="_blank">list</a>. (You can also browse the <a href="%3$s" target="_blank">Jetpack support pages</a> or <a href="%4$s" target="_blank">Jetpack support forum</a> to see if others have experienced and solved the problem.)', 'jetpack' ), 'http://jetpack.com/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.com/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.com/support/', 'https://wordpress.org/support/plugin/jetpack' ); ?></li> |
||
259 | <li><b><em><?php esc_html_e( 'An incompatible plugin.', 'jetpack' ); ?></em></b> <?php esc_html_e( "Find out by disabling all plugins except Jetpack. If the problem persists, it's not a plugin issue. If the problem is solved, turn your plugins on one by one until the problem pops up again – there's the culprit! Let us know, and we'll try to help.", 'jetpack' ); ?></li> |
||
260 | <li> |
||
261 | <b><em><?php esc_html_e( 'A theme conflict.', 'jetpack' ); ?></em></b> |
||
262 | <?php |
||
263 | $default_theme = wp_get_theme( WP_DEFAULT_THEME ); |
||
264 | |||
265 | if ( $default_theme->exists() ) { |
||
266 | /* translators: %s is the name of a theme */ |
||
267 | echo esc_html( sprintf( __( "If your problem isn't known or caused by a plugin, try activating %s (the default WordPress theme).", 'jetpack' ), $default_theme->get( 'Name' ) ) ); |
||
268 | } else { |
||
269 | esc_html_e( "If your problem isn't known or caused by a plugin, try activating the default WordPress theme.", 'jetpack' ); |
||
270 | } |
||
271 | ?> |
||
272 | <?php esc_html_e( "If this solves the problem, something in your theme is probably broken – let the theme's author know.", 'jetpack' ); ?> |
||
273 | </li> |
||
274 | <li><b><em><?php esc_html_e( 'A problem with your XMLRPC file.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Load your <a href="%s">XMLRPC file</a>. It should say “XML-RPC server accepts POST requests only.” on a line by itself.', 'jetpack' ), site_url( 'xmlrpc.php' ) ); ?> |
||
275 | <ul> |
||
276 | <li>- <?php esc_html_e( "If it's not by itself, a theme or plugin is displaying extra characters. Try steps 2 and 3.", 'jetpack' ); ?></li> |
||
277 | <li>- <?php esc_html_e( "If you get a 404 message, contact your web host. Their security may block XMLRPC.", 'jetpack' ); ?></li> |
||
278 | </ul> |
||
279 | </li> |
||
280 | <?php if ( current_user_can( 'jetpack_disconnect' ) && Jetpack::is_active() ) : ?> |
||
281 | <li> |
||
282 | <strong><em><?php esc_html_e( 'A connection problem with WordPress.com.', 'jetpack' ); ?></em></strong> |
||
283 | <?php |
||
284 | echo wp_kses( |
||
285 | sprintf( |
||
286 | __( 'Jetpack works by connecting to WordPress.com for a lot of features. Sometimes, when the connection gets messed up, you need to disconnect and reconnect to get things working properly. <a href="%s">Disconnect from WordPress.com</a>', 'jetpack' ), |
||
287 | wp_nonce_url( |
||
288 | Jetpack::admin_url( array( 'page' => 'jetpack-debugger', 'disconnect' => true ) ), |
||
289 | 'jp_disconnect', |
||
290 | 'nonce' |
||
291 | ) |
||
292 | ), |
||
293 | array( 'a' => array( 'href' => array(), 'class' => array() ) ) |
||
294 | ); |
||
295 | ?> |
||
296 | </li> |
||
297 | <?php endif; ?> |
||
298 | </ol> |
||
299 | <?php if ( self::is_jetpack_support_open() ): ?> |
||
300 | <p class="jetpack-show-contact-form"><?php echo sprintf( __( 'If none of these help you find a solution, <a href="%s">click here to contact Jetpack support</a>. Tell us as much as you can about the issue and what steps you\'ve tried to resolve it, and one of our Happiness Engineers will be in touch to help.', 'jetpack' ), Jetpack::admin_url( array( 'page' => 'jetpack-debugger', 'contact' => true ) ) ); ?> |
||
301 | </p> |
||
302 | <?php endif; ?> |
||
303 | <hr /> |
||
304 | <?php if ( Jetpack::is_active() ) : ?> |
||
305 | <div id="connected-user-details"> |
||
306 | <h3><?php esc_html_e( 'More details about your Jetpack settings', 'jetpack' ); ?></h3> |
||
307 | <p><?php printf( |
||
308 | /* translators: %s is an e-mail address */ |
||
309 | __( 'The primary connection is owned by <strong>%s</strong>\'s WordPress.com account.', 'jetpack' ), |
||
310 | esc_html( Jetpack::get_master_user_email() ) |
||
311 | ); ?></p> |
||
312 | </div> |
||
313 | <?php else : ?> |
||
314 | <div id="dev-mode-details"> |
||
315 | <p><?php printf( |
||
316 | __( 'Would you like to use Jetpack on your local development site? You can do so thanks to <a href="%s">Jetpack\'s development mode</a>.', 'jetpack' ), |
||
317 | 'https://jetpack.com/support/development-mode/' |
||
318 | ); ?></p> |
||
319 | </div> |
||
320 | <?php endif; ?> |
||
321 | <?php if ( |
||
322 | current_user_can( 'jetpack_manage_modules' ) |
||
323 | && ( Jetpack::is_development_mode() || Jetpack::is_active() ) |
||
324 | ) { |
||
325 | printf( |
||
326 | '<p><a href="%1$s">%2$s</a></p>', |
||
327 | Jetpack::admin_url( 'page=jetpack_modules' ), |
||
328 | esc_html__( 'Access the full list of Jetpack modules available on your site.', 'jetpack' ) |
||
329 | ); |
||
330 | } ?> |
||
331 | </div> |
||
332 | <div id="contact-message" <?php if( ! isset( $_GET['contact'] ) ) {?> style="display:none" <?php } ?>> |
||
333 | <?php if ( self::is_jetpack_support_open() ): ?> |
||
334 | <form id="contactme" method="post" action="https://jetpack.com/contact-support/"> |
||
335 | <input type="hidden" name="action" value="submit"> |
||
336 | <input type="hidden" name="jetpack" value="needs-service"> |
||
337 | |||
338 | <input type="hidden" name="contact_form" id="contact_form" value="1"> |
||
339 | <input type="hidden" name="blog_url" id="blog_url" value="<?php echo esc_attr( site_url() ); ?>"> |
||
340 | <?php |
||
341 | $subject_line = sprintf( |
||
342 | /* translators: %s is the URL of the site */ |
||
343 | _x( 'from: %s Jetpack contact form', 'Support request email subject line', 'jetpack' ), |
||
344 | esc_attr( site_url() ) |
||
345 | ); |
||
346 | |||
347 | if ( Jetpack::is_development_version() ) { |
||
348 | $subject_line = 'BETA ' . $subject_line; |
||
349 | } |
||
350 | |||
351 | $subject_line_input = printf( |
||
352 | '<input type="hidden" name="subject" id="subject" value="%s"">', |
||
353 | $subject_line |
||
354 | ); |
||
355 | ?> |
||
356 | <div id="category_div" class="formbox"> |
||
357 | <label class="h" for="category"><?php esc_html_e( 'What do you need help with?', 'jetpack' ); ?></label> |
||
358 | <ul> |
||
359 | <?php |
||
360 | /** |
||
361 | * Set up an array of ticket categories. |
||
362 | * (reasons why a user would contact us.) |
||
363 | */ |
||
364 | $categories = array( |
||
365 | 'Connection' => esc_html__( "I'm having trouble connecting Jetpack to WordPress.com", 'jetpack' ), |
||
366 | 'Billing' => esc_html__( 'I have a billing or plans question', 'jetpack' ), |
||
367 | 'Backups' => esc_html__( 'I need help with backing up or restoring my site', 'jetpack' ), |
||
368 | 'Security' => esc_html__( 'I have security concerns / my site is hacked', 'jetpack' ), |
||
369 | 'Priority' => esc_html__( "My site is down / I can't access my site", 'jetpack' ), |
||
370 | /* translators: Last item in a list of reasons to contact Jetpack support. */ |
||
371 | 'Other' => esc_html__( 'Something Else', 'jetpack' ), |
||
372 | ); |
||
373 | |||
374 | foreach ( $categories as $value => $label ) { ?> |
||
375 | <li><label for="<?php echo esc_attr( $value ); ?>"> |
||
376 | <input |
||
377 | id="<?php echo esc_attr( $value ); ?>" |
||
378 | name="category" |
||
379 | type="radio" |
||
380 | value="<?php echo esc_attr( $value ); ?>" |
||
381 | <?php checked( esc_attr( $value ), 'Other' ); ?> |
||
382 | /> |
||
383 | <?php echo esc_html( $label ); ?> |
||
384 | </label></li> |
||
385 | <?php } ?> |
||
386 | </ul> |
||
387 | </div> |
||
388 | |||
389 | <div class="formbox"> |
||
390 | <label for="message" class="h"><?php esc_html_e( 'Please describe the problem you are having.', 'jetpack' ); ?></label> |
||
391 | <textarea name="message" cols="40" rows="7" id="did"></textarea> |
||
392 | </div> |
||
393 | |||
394 | <div id="name_div" class="formbox"> |
||
395 | <label class="h" for="your_name"><?php esc_html_e( 'Name', 'jetpack' ); ?></label> |
||
396 | <span class="errormsg"><?php esc_html_e( 'Let us know your name.', 'jetpack' ); ?></span> |
||
397 | <input name="your_name" type="text" id="your_name" value="<?php esc_html_e( $current_user->display_name, 'jetpack'); ?>" size="40"> |
||
398 | </div> |
||
399 | |||
400 | <div id="email_div" class="formbox"> |
||
401 | <label class="h" for="your_email"><?php esc_html_e( 'Email', 'jetpack' ); ?></label> |
||
402 | <span class="errormsg"><?php esc_html_e( 'Use a valid email address.', 'jetpack' ); ?></span> |
||
403 | <input name="your_email" type="text" id="your_email" value="<?php esc_html_e( $current_user->user_email, 'jetpack'); ?>" size="40"> |
||
404 | </div> |
||
405 | |||
406 | <div id="toggle_debug_form_info" class="formbox"> |
||
407 | <p><?php _e( 'The test results and some other useful debug information will be sent to the support team. Please feel free to <a href="#">review/modify</a> this information.', 'jetpack' ); ?></p> |
||
408 | </div> |
||
409 | |||
410 | <div id="debug_info_form_div" class="formbox" style="display:none"> |
||
411 | <label class="h" for="debug_info"><?php esc_html_e( 'Debug Info', 'jetpack' ); ?></label> |
||
412 | <textarea name="debug_info" cols="40" rows="7" id="debug_form_info"><?php echo esc_attr( $debug_info ); ?></textarea> |
||
413 | </div> |
||
414 | |||
415 | <div style="clear: both;"></div> |
||
416 | |||
417 | <div id="blog_div" class="formbox"> |
||
418 | <div id="submit_div" class="contact-support"> |
||
419 | <input type="submit" name="submit" value="<?php esc_html_e( 'Submit »', 'jetpack' ); ?>"> |
||
420 | </div> |
||
421 | </div> |
||
422 | <div style="clear: both;"></div> |
||
423 | </form> |
||
424 | <?php endif; ?> |
||
425 | </div> <!-- contact-message, hidden by default. --> |
||
426 | <hr /> |
||
427 | <div id="toggle_debug_info"><a href="#"><?php _e( 'View Advanced Debug Results', 'jetpack' ); ?></a></div> |
||
428 | <div id="debug_info_div" style="display:none"> |
||
429 | <h4><?php esc_html_e( 'Debug Info', 'jetpack' ); ?></h4> |
||
430 | <div id="debug_info"><pre><?php echo esc_html( $debug_info ) ; ?></pre></div> |
||
431 | </div> |
||
432 | </div> |
||
433 | <?php |
||
434 | } |
||
435 | |||
618 |
This check looks for calls to
isset(...)
orempty()
on variables that are yet undefined. These calls will always produce the same result and can be removed.This is most likely caused by the renaming of a variable or the removal of a function/method parameter.