/** * Generate the system information * * @since 3.1 */ function wprss_system_info() { global $wpdb; ?> <h3><?php _e('System Information', WPRSS_TEXT_DOMAIN); ?> </h3> <?php $form_url = admin_url('edit.php?post_type=wprss_feed&page=wprss-debugging'); $nonce_url = wp_nonce_url($form_url, 'wprss-sysinfo'); ?> <form action="<?php echo esc_url($nonce_url); ?> " method="post"> <textarea readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="wprss-sysinfo" title="<?php _e('To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', WPRSS_TEXT_DOMAIN); ?> "><?php wprss_print_system_info(); ?> </textarea> <p class="submit"> <input type="hidden" name="wprss-action" value="download_sysinfo" /> <?php submit_button(__('Download System Info File', WPRSS_TEXT_DOMAIN), 'primary', 'wprss-download-sysinfo', false); ?> </p> </form> <?php }
/** * Creates and returns the support request email's message body. * * @since 4.7 */ function wprss_create_support_message() { // Get the WP RSS Aggregator log. $log = 'Customer did not send log'; if ($_GET['support-include-log'] === 'true') { $log = wprss_get_log(); } // Get the system information. $sys_info = 'Customer did not send system information'; if ($_GET['support-include-sys'] === 'true') { ob_start(); wprss_print_system_info(); $sys_info = ob_get_contents(); ob_end_clean(); } // Get the license keys. $keys = json_encode(get_option('wprss_settings_license_keys', array()), JSON_PRETTY_PRINT); // Get the message they entered. $message = sanitize_text_field($_GET['support-message']); // Remove any generated system data that may be present from previous form submission attempts. $idx = strpos($message, "----------------------------------------------"); if ($idx !== FALSE) { $message = substr($message, 0, $idx); } // Append the generated system data. $message .= "\n\n----------------------------------------------\n"; $message .= "\nLicense Information:\n" . $keys; $message .= "\n\n\nError Log:\n" . $log; $message .= "\n\n\nSystem Information:\n" . $sys_info . "\n"; $message = apply_filters('wprss_support_message', $message); return $message; }