You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+98-7Lines changed: 98 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,13 +60,75 @@ For manual source installation:
60
60
61
61
### Install the Perfbase extension
62
62
63
-
The plugin depends on the native Perfbase PHP extension. Install it with:
63
+
The plugin depends on the native Perfbase PHP extension. Installing that extension requires shell/server access and permission to copy a native extension into PHP's extension directory and add an ini file. Perfbase for WordPress is intended for advanced or server-managed WordPress environments. Many shared hosting and restricted managed WordPress environments do not support custom PHP extensions; in those environments the plugin can be installed, but profiling will not run until the extension is available.
64
+
65
+
Automated installer for supported server environments:
Replace `8.3` with your PHP major/minor version and replace `amd64` with `arm64` when using ARM64 Linux.
109
+
110
+
Find PHP's extension directory and loaded ini scan directories:
111
+
112
+
```bash
113
+
php -i | grep '^extension_dir'
114
+
php --ini
115
+
```
116
+
117
+
Copy the extension binary into PHP's extension directory, then create `perfbase.ini` in one of the loaded ini scan directories:
118
+
119
+
```ini
120
+
extension=perfbase.ext
121
+
```
122
+
123
+
Replace `perfbase.ext` with the downloaded filename, such as `perfbase.so` or `perfbase.dylib`.
124
+
125
+
Restart PHP-FPM, Apache, Nginx Unit, or any long-lived PHP worker after installing the extension, then verify it:
126
+
127
+
```bash
128
+
php -m | grep perfbase
129
+
```
130
+
131
+
For a specific pinned build instead of the mutable latest build, replace `/extension/latest/` with a versioned path such as `/extension/v123/`.
70
132
71
133
## Quick start
72
134
@@ -241,10 +303,26 @@ The plugin also adds context through WordPress hooks such as:
241
303
242
304
Cache profiling itself is handled by the native Perfbase extension via feature flags rather than by WordPress cache hooks.
243
305
244
-
For safety and lower cardinality:
306
+
Perfbase can send:
307
+
308
+
- function call trees, function names, source file paths and line numbers, timing, CPU, memory, and host resource metrics
309
+
- host operating system, kernel, hostname, CPU architecture, CPU details, disk capacity details, memory usage, CPU usage, disk I/O, and network I/O samples
310
+
- capped process-list snapshots when enabled, containing process ID, executable basename, OS user, CPU usage, memory usage, and process runtime, without command-line arguments
311
+
- additional native trace metadata such as normalized SQL query text, database DSN/host/database/username/port metadata, MongoDB or Elasticsearch query/filter payload summaries, Redis or Memcached keys and fields, HTTP URL or URI metadata that may include query strings depending on the PHP API or HTTP library used, HTTP method/status/timing/byte-count metadata, file paths and file operation metadata, mail recipient and subject metadata, shell/process command strings, AWS operation names, OPcache and JIT statistics, PHP error or exception samples, compiled file paths, magic method counts, and truncated function argument values when argument capture is separately configured. These fields depend on enabled extension features, loaded PHP libraries, and which code paths run during the trace
312
+
- WordPress request metadata such as action name, HTTP method, request URL without query string, HTTP status code, user IP address, user agent, logged-in user ID when available, hostname, environment, application version, PHP version, WordPress version, and Perfbase plugin version
313
+
- WordPress context metadata such as AJAX action, REST route, admin page, post/page identifiers, post type/status, taxonomy context, template and theme information, conditional page type flags, plugin lifecycle context, and WooCommerce page, cart, product, or order context when available
314
+
- operational summaries such as memory usage, database query count and timing summaries when available, and sanitized outbound HTTP request metadata when HTTP tracking is enabled
315
+
316
+
Perfbase does not collect:
245
317
246
-
- outbound HTTP attributes are stored as sanitized `scheme://host/path` values without query strings or fragments
247
-
- database visibility is limited to aggregate shutdown-time stats such as total query count, slow query count, and total query time
318
+
- source code
319
+
- request bodies, full POST payloads (`$_POST`), arbitrary form fields, or uploaded file contents
320
+
- cookie values (`$_COOKIE`) or PHP session data (`$_SESSION`)
321
+
- authorization header values
322
+
- passwords, API keys, nonces, or session IDs from WordPress request, cookie, or session data
323
+
- command-line arguments for process-list snapshots
324
+
325
+
Feature flags control the extra native trace metadata listed under "Perfbase can send", including outbound HTTP URLs or URIs with query strings for some HTTP libraries and truncated function argument values if argument capture is separately configured. Review enabled Perfbase extension feature flags before profiling sensitive workloads, especially flags that capture arguments, errors, exceptions, database/cache/HTTP/file metadata, mail metadata, process metadata, OPcache metadata, or host resource metadata.
248
326
249
327
## Request metadata
250
328
@@ -273,7 +351,20 @@ The plugin keeps action names low-cardinality and avoids leaking sensitive query
273
351
-`wordpress.admin_page`
274
352
- template, theme, post, taxonomy, and conditional-tag attributes when available
275
353
276
-
`http_url` is stored without the query string. Important WordPress query parameters are broken out into dedicated attributes instead.
354
+
`http_url` for the inbound WordPress request is stored without the query string. Important WordPress query parameters are broken out into dedicated attributes instead. Native HTTP metadata may still include full outbound URLs or URIs with query strings depending on enabled extension features and the HTTP library used.
355
+
356
+
### Data Perfbase does not collect
357
+
358
+
Perfbase does not collect:
359
+
360
+
- source code
361
+
- request bodies, full POST payloads (`$_POST`), arbitrary form fields, or uploaded file contents
362
+
- cookie values (`$_COOKIE`) or PHP session data (`$_SESSION`)
363
+
- authorization header values
364
+
- passwords, API keys, nonces, or session IDs from WordPress request, cookie, or session data
365
+
- command-line arguments for process-list snapshots
366
+
367
+
Database metadata added by the WordPress plugin is limited to aggregate query counts and timing information when available. Native HTTP metadata can include outbound URLs or URIs with query strings. The native profiler may capture additional context depending on enabled Perfbase extension feature flags and application code.
277
368
278
369
## Example production setup
279
370
@@ -305,7 +396,7 @@ php -m | grep perfbase
305
396
php --ini
306
397
```
307
398
308
-
If needed, reinstall it:
399
+
If the extension is missing, repeat the manual extension installation steps above or run the automated installer on a supported server:
fwrite(STDERR, "Unable to read packaged metadata\n");
86
88
exit(1);
87
89
}
@@ -97,6 +99,52 @@ php -r '
97
99
$expect((bool) preg_match("/^define\('\''PERFBASE_PLUGIN_VERSION'\'',\s*'\''" . preg_quote($version, "/") . "'\''\);$/m", $plugin), "Plugin constant version does not match {$version}");
98
100
$expect((bool) preg_match("/^Stable tag:\s*" . preg_quote($version, "/") . "$/m", $readme), "Readme stable tag does not match {$version}");
99
101
$expect((bool) preg_match("/^= " . preg_quote($version, "/") . " =$/m", $readme), "Readme changelog or upgrade notice does not include {$version}");
$expect(strpos($readme, "full query strings, passwords") === false, "Readme should not claim full query strings are excluded from native traces");
126
+
$expect(strpos($readme, "Feature flags control the extra native trace metadata") !== false, "Readme is missing native feature flag metadata disclosure");
127
+
$expect(strpos($readme, "enabled Perfbase extension feature flags") !== false, "Readme is missing feature flag caveat");
128
+
$expect(strpos($readme, "shell/server access is required") !== false, "Readme is missing server access installation warning");
$expect(strpos($readme, "Automated installer") < strpos($readme, "Manual extension installation"), "Readme should show automated installer before manual instructions");
145
+
$expect(strpos($admin, "normalized SQL query text") !== false, "Admin privacy text is missing SQL metadata disclosure");
146
+
$expect(strpos($admin, "HTTP URL or URI metadata that may include query strings") !== false, "Admin privacy text is missing native HTTP URL query disclosure");
147
+
$expect(strpos($admin, "Perfbase does not collect source code") !== false, "Admin privacy text is missing source code exclusion disclosure");
0 commit comments