|
1 | | -# %namespace% |
| 1 | +# xrDebug WordPress Plugin |
2 | 2 |
|
3 | 3 | > 🔔 Subscribe to the [newsletter](https://chv.to/chevere-newsletter) to don't miss any update regarding Chevere. |
4 | 4 |
|
5 | | - |
| 5 | +<a href="https://xrdebug.com"><img alt="xrDebug" src="xr.svg" width="40%"></a> |
6 | 6 |
|
7 | | -[](https://github.com/chevere/reponame/actions) |
8 | | - |
9 | | -[](LICENSE) |
| 7 | +[](https://github.com/xrdebug/wordpress/actions) |
| 8 | + |
| 9 | +[](LICENSE) |
10 | 10 | [](https://phpstan.org/) |
11 | | -[](https://dashboard.stryker-mutator.io/reports/github.com/chevere/reponame/%branch%) |
12 | 11 |
|
13 | | -[](https://sonarcloud.io/dashboard?id=chevere_reponame) |
14 | | -[](https://sonarcloud.io/dashboard?id=chevere_reponame) |
15 | | -[](https://sonarcloud.io/dashboard?id=chevere_reponame) |
16 | | -[](https://sonarcloud.io/dashboard?id=chevere_reponame) |
17 | | -[](https://sonarcloud.io/dashboard?id=chevere_reponame) |
18 | | -[](https://sonarcloud.io/dashboard?id=chevere_reponame) |
19 | | -[](https://www.codefactor.io/repository/github/chevere/reponame) |
| 12 | +## Summary |
20 | 13 |
|
21 | | -## Documentation |
| 14 | +WordPress plugin for debugging with [xrDebug](https://xrdebug.com). This plugin uses the [xrDebug PHP library](https://github.com/xrdebug/php) and it adds WordPress-specific features. |
22 | 15 |
|
23 | | -Documentation is available at [chevere.org](https://chevere.org/). |
| 16 | +## Installation |
| 17 | + |
| 18 | +1. Go to [latest release](https://github.com/xrdebug/wordpress/releases/latest) and download `xrdebug.zip`. |
| 19 | +2. Go to your WordPress admin panel, click on `Plugins` and then `Add New`. |
| 20 | +3. Click on `Upload Plugin` and select the downloaded zip file. |
| 21 | +4. Click on `Install Now` and then `Activate`. |
| 22 | + |
| 23 | +## Debug Helpers |
| 24 | + |
| 25 | +In addition to the [PHP xrDebug helpers](https://github.com/xrdebug/php?tab=readme-ov-file#debug-helpers) this plugin adds the following WordPress-specific debug helpers. |
| 26 | + |
| 27 | +### wp_xri |
| 28 | + |
| 29 | +Use function `wp_xri` to access the xrDebug WordPress inspector instance, which can be used to control the WordPress inspector logging features. |
| 30 | + |
| 31 | +| Method | Toggles | |
| 32 | +| --------------------------- | --------------- | |
| 33 | +| [showErrors](#showerrors) | Showing errors | |
| 34 | +| [showHooks](#showhooks) | Showing hooks | |
| 35 | +| [showMails](#showmails) | Showing emails | |
| 36 | +| [showQueries](#showqueries) | Showing queries | |
| 37 | + |
| 38 | +#### showErrors |
| 39 | + |
| 40 | +Use method `showErrors` to show the PHP errors during the WordPress request. |
| 41 | + |
| 42 | +```php |
| 43 | +wp_xri()->showErrors(); |
| 44 | +``` |
| 45 | + |
| 46 | +To stop showing errors pass `FALSE` as argument. |
| 47 | + |
| 48 | +```php |
| 49 | +wp_xri()->showErrors(FALSE); |
| 50 | +``` |
| 51 | + |
| 52 | +#### showHooks |
| 53 | + |
| 54 | +Use method `showHooks` to show the WordPress hooks executed during the WordPress request. |
| 55 | + |
| 56 | +```php |
| 57 | +wp_xri()->showHooks(); |
| 58 | +``` |
| 59 | + |
| 60 | +To stop showing hooks pass `FALSE` as argument. |
| 61 | + |
| 62 | +```php |
| 63 | +wp_xri()->showHooks(FALSE); |
| 64 | +``` |
| 65 | + |
| 66 | +#### showMails |
| 67 | + |
| 68 | +Use method `showMails` to show the emails sent during the WordPress request. |
| 69 | + |
| 70 | +```php |
| 71 | +wp_xri()->showMails(); |
| 72 | +``` |
| 73 | + |
| 74 | +To stop showing emails pass `FALSE` as argument. |
| 75 | + |
| 76 | +```php |
| 77 | +wp_xri()->showMails(FALSE); |
| 78 | +``` |
| 79 | + |
| 80 | +#### showQueries |
| 81 | + |
| 82 | +Use method `showQueries` to show the SQL queries executed during the WordPress request. |
| 83 | + |
| 84 | +```php |
| 85 | +wp_xri()->showQueries(); |
| 86 | +``` |
| 87 | + |
| 88 | +To stop showing queries pass `FALSE` as argument. |
| 89 | + |
| 90 | +```php |
| 91 | +wp_xri()->showQueries(FALSE); |
| 92 | +``` |
24 | 93 |
|
25 | 94 | ## License |
26 | 95 |
|
|
0 commit comments