PluginProbe
Code Profiler – WordPress Performance Profiling and Debugging Made Easy / 1.9.6
Code Profiler – WordPress Performance Profiling and Debugging Made Easy v1.9.6
1.9.6 1.9.5 1.9.4 1.9.3 trunk 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.6 1.6.1 1.6.10 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 All 41 releases
← All changes | index.php +14 -19 1.9.31.9.6 View file →
@@ -4,9 +4,9 @@
4 4 Plugin URI: https://nintechnet.com/codeprofiler/
5 5 Description: A profiler to measure the performance of your WordPress plugins and themes.
6 6 Author: Jerome Bruandet ~ NinTechNet Ltd.
7 7 Author URI: https://nintechnet.com/
8 -Version: 1.9.3
8 +Version: 1.9.6
9 9 Network: true
10 10 License: GPLv3 or later
11 11 Text Domain: code-profiler
12 12 Domain Path: /languages
@@ -11,9 +11,9 @@
11 11 Text Domain: code-profiler
12 12 Domain Path: /languages
13 13 */
14 14
15 -define('CODE_PROFILER_VERSION', '1.9.3');
15 +define('CODE_PROFILER_VERSION', '1.9.6');
16 16 /**
17 17 +=====================================================================+
18 18 | ____ _ ____ __ _ _ |
19 19 | / ___|___ __| | ___ | _ \ _ __ ___ / _(_) | ___ _ __ |
@@ -34,9 +34,9 @@
34 34 require __DIR__ .'/lib/menu.php';
35 35 // Helper (can be already loaded by the MU plugin)
36 36 require_once __DIR__ .'/lib/helper.php';
37 37 // AJAX calls
38 -require __DIR__ .'/lib/ajax.php';
38 +require __DIR__ .'/lib/class-ajax.php';
39 39 // Scheduled tasks
40 40 require_once __DIR__ .'/lib/class-wp-cron.php';
41 41 // =====================================================================
42 42 // Activation: make sure the blog meets the requirements.
@@ -43,14 +43,14 @@
43 43
44 44 function code_profiler_activate() {
45 45
46 46 if (! defined('WP_CLI') && ! current_user_can('activate_plugins') ) {
47 - exit( esc_html__('Your are not allowed to activate plugins.', 'code-profiler') );
47 + wp_die( esc_html__('Your are not allowed to activate plugins.', 'code-profiler') );
48 48 }
49 49
50 50 global $wp_version;
51 51 if ( version_compare( $wp_version, '5.0', '<') ) {
52 - exit( sprintf(
52 + wp_die( sprintf(
53 53 esc_html__('Code Profiler requires WordPress %s or greater but your current version is %s.',
54 54 'code-profiler'),
55 55 '5.0',
56 56 esc_html( $wp_version )
@@ -57,9 +57,9 @@
57 57 ) );
58 58 }
59 59
60 60 if ( version_compare( PHP_VERSION, '7.1', '<') ) {
61 - exit( sprintf(
61 + wp_die( sprintf(
62 62 esc_html__('Code Profiler requires PHP 7.1 or greater but your current version is %s.',
63 63 'code-profiler'),
64 64 esc_html( PHP_VERSION )
65 65 ) );
@@ -66,9 +66,9 @@
66 66 }
67 67
68 68 // If the pro version is active, we refuse to run and throw an error message
69 69 if ( is_plugin_active('code-profiler-pro/index.php') ) {
70 - exit( esc_html__('Code Profiler Pro is active on this site, please disable it first if you '.
70 + wp_die( esc_html__('Code Profiler Pro is active on this site, please disable it first if you '.
71 71 'want to run the free version.', 'code-profiler')
72 72 );
73 73 }
74 74
@@ -90,15 +90,15 @@
90 90 }
91 91
92 92 register_activation_hook( __FILE__, 'code_profiler_activate');
93 93
94 -// ===================================================================== 2023-06-17
94 +// =====================================================================
95 95 // Deactivation.
96 96
97 97 function code_profiler_deactivate() {
98 98
99 99 if (! defined('WP_CLI') && ! current_user_can('activate_plugins') ) {
100 - exit( esc_html__('Your are not allowed to deactivate plugins.', 'code-profiler') );
100 + wp_die( esc_html__('Your are not allowed to deactivate plugins.', 'code-profiler') );
101 101 }
102 102
103 103 // Remove the MU plugin
104 104 if ( file_exists( WPMU_PLUGIN_DIR .'/'. CODE_PROFILER_MUPLUGIN ) ) {
@@ -112,9 +112,9 @@
112 112 }
113 113
114 114 register_deactivation_hook( __FILE__, 'code_profiler_deactivate');
115 115
116 -// ===================================================================== 2023-06-14
116 +// =====================================================================
117 117 // Create Profiler's menu.
118 118
119 119 function code_profiler_admin_menu() {
120 120
@@ -209,10 +209,9 @@
209 209 'code-profiler'),
210 210 'missing_username' =>
211 211 esc_attr__('Please enter the name of the user.', 'code-profiler'),
212 212 'missing_ajax' =>
213 - esc_attr__('Please enter a valid JSON-encoded payload, or change the content-type option. '.
214 - 'If you want to send an empty value, enter: {}', 'code-profiler'),
213 + esc_attr__('Please enter a valid JSON-encoded payload, or change the content-type option. If you want to send an empty value, enter: {}', 'code-profiler'),
215 214 'missing_wpcron' =>
216 215 esc_attr__('There are no cron events available, please select another page to profile.',
217 216 'code-profiler'),
218 217 'multiline_raw' =>
@@ -226,18 +225,14 @@
226 225 'timeout_error' =>
227 226 esc_attr__('You can try to select a lower Accuracy and Precision level in the Settings page',
228 227 'code-profiler'),
229 228 'notfound_error' =>
230 - esc_attr__('The requested page does not seem to exist. Please check the syntax of the URL '.
231 - 'you want to profile',
229 + esc_attr__('The requested page does not seem to exist. Please check the syntax of the URL you want to profile',
232 230 'code-profiler'),
233 231 'forbidden_error' =>
234 - esc_attr__('The server rejected and blocked the requested page. Make sure you are allowed '.
235 - 'to access that page or that there is no security plugin or application blocking it',
236 - 'code-profiler'),
232 + esc_attr__('The server rejected and blocked the requested page. Make sure you are allowed to access that page or that there is no security plugin or application blocking it', 'code-profiler'),
237 233 'internal_error' =>
238 - esc_attr__('This is an internal server error. Please check your server, PHP and Code '.
239 - 'Profiler logs as they may contain more details about the error', 'code-profiler'),
234 + esc_attr__('This is an internal server error. Please check your server, PHP and Code Profiler logs as they may contain more details about the error', 'code-profiler'),
240 235 'unknown_error' =>
241 236 esc_attr__('An unknown error occurred:', 'code-profiler'),
242 237 'preparing_report' =>
243 238 esc_attr__('Preparing the report', 'code-profiler') .'...',