Skip to content

Commit a17473f

Browse files
philipdownerPhilip Downer
andauthored
v1.3.0 - Fixes Composer version issues, updates naming, installs as mu-plugin (#1)
* Updates composer-installers to v2.3.0 * Adds docs for creating a fatal error mu-plugin * Adds link for mu-plugins to WP docs. Restores Composer namespace * v1.3.0 - Fixes Composer version issues, updates naming, installs as mu-plugin --------- Co-authored-by: Philip Downer <[email protected]>
1 parent 13babd7 commit a17473f

File tree

6 files changed

+161
-70
lines changed

6 files changed

+161
-70
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
vendor
1+
vendor
2+
/.idea

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ This change log adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
55

66
## Unreleased
77

8+
## 1.3.0 - 2025-03-21
9+
- [Merges PR #16](https://github.com/Rarst/wps/pull/16) submitted to Rarst/wps to update `composer-installers` version
10+
- Installs plugin as a `mu-plugin` to better support development on WordPress multi-site
11+
- Renames plugin from `wps` to `wpWhoops` to make it more identifiable on WP Admin screens
12+
- Adds version number string to plugin file header and composer.json
13+
814
## 1.2 - 2018-12-18
915

1016
### Added

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,28 @@ $wps['run']->silenceErrorsInPaths( '~^((?!/my-plugin/).)*$~', E_NOTICE | E_WARNI
5252
// Silence for plugins _except_ specific plugin.
5353
$wps['run']->silenceErrorsInPaths( '~/wp-content/plugins/(?!my-plugin)~', E_NOTICE | E_WARNING );
5454
```
55+
### Testing a fatal error state
5556

57+
If you desire a method to test that the plugin is installed correctly, you can [create a simple mu-plugin](https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/). At `/wp-content/mu-plugins` create the file `trigger-fatal-error.php`. Add the following code:
58+
59+
```php
60+
/**
61+
* Plugin Name: Trigger Fatal Error
62+
*/
63+
add_action('wp_loaded', function () {
64+
if(
65+
isset($_GET['triggerFatalError']) &&
66+
WP_DEBUG &&
67+
WP_DEBUG_DISPLAY
68+
) {
69+
noSuchFunction();
70+
}
71+
}, 1);
72+
```
73+
74+
On the frontend of your site, trigger an error by appending `?triggerFatalError=true` to your URL.
75+
76+
Like Whoops, this should only be used in a non-production environment.
5677

5778
## License
5879

composer.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,43 @@
11
{
2-
"name" : "rarst/wps",
2+
"name" : "philipdowner/wp-whoops",
33
"description": "WordPress plugin for whoops error handler.",
4+
"version": "1.3.0",
45
"keywords" : [
56
"wordpress",
7+
"wordpress-plugin",
68
"whoops",
79
"error"
810
],
9-
"type" : "wordpress-plugin",
11+
"type" : "wordpress-muplugin",
1012
"homepage" : "https://github.com/Rarst/wps",
1113
"license" : "MIT",
1214
"authors" : [
1315
{
1416
"name" : "Andrey Savchenko",
1517
"email" : "[email protected]",
1618
"homepage": "http://www.Rarst.net/"
19+
},
20+
{
21+
"name": "Philip Downer",
22+
"email": "[email protected]",
23+
"homepage": "https://philipdowner.com"
1724
}
1825
],
1926
"support" : {
2027
"issues": "https://github.com/Rarst/wps/issues"
2128
},
2229
"require" : {
23-
"php" : ">=5.5.9",
24-
"composer/installers": "~1.6",
30+
"php": "^7.2 || ^8.0",
31+
"composer/installers": "^v2.3.0",
2532
"filp/whoops" : "^2.3.1",
2633
"pimple/pimple" : "^3.2.3"
2734
},
2835
"autoload" : {
2936
"classmap" : ["php/"]
37+
},
38+
"config": {
39+
"allow-plugins": {
40+
"composer/installers": true
41+
}
3042
}
31-
}
43+
}

0 commit comments

Comments
 (0)