= 1024 && $i < (count($label) - 1); $bytes /= 1024, $i++); return (round($bytes, 2) . " " . $label[$i]); } /** –– * */ /** –– **\ * Notice about performance. * @since 1.0.9 */ function cdp_render_performance_notice() { global $wp_version; global $wpdb; $mysqlVersion = $wpdb->db_version(); $cdp_notice2 = __('%b_start%Please%b_end% copy & paste the following log %a_start%into the forum%a_end% so that we can make the plugin better. Thank you!', 'copy-delete-posts'); $cdp_notice2 = str_replace('%a_start%', '', $cdp_notice2); $cdp_notice2 = str_replace('%a_end%', '', $cdp_notice2); $cdp_notice2 = str_replace('%b_start%', '', $cdp_notice2); $cdp_notice2 = str_replace('%b_end%', '', $cdp_notice2); $logs = get_option('cdp_copy_logs_times', array()); $theLog = ''; $theLog .= 'The OS: ' . PHP_OS . "\n"; $theLog .= 'PHP Version: ' . PHP_VERSION . "\n"; $theLog .= 'WP Version: ' . $wp_version . "\n"; $theLog .= 'MySQL Version: ' . $mysqlVersion . "\n"; $theLog .= 'Directory Separator: ' . DIRECTORY_SEPARATOR . "\n\n"; $theLog .= 'Copy logs:' . "\n"; foreach ($logs as $key => $value) { $amount = isset($value['amount']) ? $value['amount'] : 1; $time = $value['time']; $perOne = $value['perOne']; $data = date('d-m-Y H:i:s', $value['data']); $memory = cdp_human_readable_bytes(intval($value['memory'])); $peak = cdp_human_readable_bytes(intval($value['peak'])); $theLog .= $data . ' - ' . $amount . 'x, [total: ' . $time . ', avg: ' . $perOne . '] (mem: ' . $memory . ' - ' . $value['memory'] . ', peak: ' . $peak . ' - ' . $value['peak'] . ')' . "\n"; } ?>

×