From 5c46cc02a501b5abfc90fad126d419379a2a9c77 Mon Sep 17 00:00:00 2001 From: Philip Downer Date: Fri, 21 Mar 2025 09:35:41 -0600 Subject: [PATCH 1/4] Updates composer-installers to v2.3.0 --- .gitignore | 3 +- composer.json | 13 ++-- composer.lock | 173 ++++++++++++++++++++++++++++++++------------------ 3 files changed, 123 insertions(+), 66 deletions(-) diff --git a/.gitignore b/.gitignore index 5657f6e..0122769 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -vendor \ No newline at end of file +vendor +/.idea \ No newline at end of file diff --git a/composer.json b/composer.json index ef16f14..130d661 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name" : "rarst/wps", + "name" : "philipdowner/whoops", "description": "WordPress plugin for whoops error handler.", "keywords" : [ "wordpress", @@ -20,12 +20,17 @@ "issues": "https://github.com/Rarst/wps/issues" }, "require" : { - "php" : ">=5.5.9", - "composer/installers": "~1.6", + "php" : "^8.0", + "composer/installers": "^v2.3.0", "filp/whoops" : "^2.3.1", "pimple/pimple" : "^3.2.3" }, "autoload" : { "classmap" : ["php/"] + }, + "config": { + "allow-plugins": { + "composer/installers": true + } } -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index 2be8b48..903f372 100644 --- a/composer.lock +++ b/composer.lock @@ -4,39 +4,41 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1e500ce189538c8691f07d5e67ede9ab", + "content-hash": "eec1b513f1bd32ddb938d802a670be96", "packages": [ { "name": "composer/installers", - "version": "v1.6.0", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" + "reference": "12fb2dfe5e16183de69e784a7b84046c43d97e8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", - "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "url": "https://api.github.com/repos/composer/installers/zipball/12fb2dfe5e16183de69e784a7b84046c43d97e8e", + "reference": "12fb2dfe5e16183de69e784a7b84046c43d97e8e", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" + "composer-plugin-api": "^1.0 || ^2.0", + "php": "^7.2 || ^8.0" }, "require-dev": { - "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "^4.8.36" + "composer/composer": "^1.10.27 || ^2.7", + "composer/semver": "^1.7.2 || ^3.4.0", + "phpstan/phpstan": "^1.11", + "phpstan/phpstan-phpunit": "^1", + "symfony/phpunit-bridge": "^7.1.1", + "symfony/process": "^5 || ^6 || ^7" }, "type": "composer-plugin", "extra": { "class": "Composer\\Installers\\Plugin", "branch-alias": { - "dev-master": "1.0-dev" - } + "dev-main": "2.x-dev" + }, + "plugin-modifies-install-path": true }, "autoload": { "psr-4": { @@ -57,7 +59,6 @@ "description": "A multi-framework Composer library installer", "homepage": "https://composer.github.io/installers/", "keywords": [ - "Craft", "Dolibarr", "Eliasis", "Hurad", @@ -65,6 +66,7 @@ "Kanboard", "Lan Management System", "MODX Evo", + "MantisBT", "Mautic", "Maya", "OXID", @@ -72,10 +74,11 @@ "Porto", "RadPHP", "SMF", + "Starbug", "Thelia", + "Whmcs", "WolfCMS", "agl", - "aimeos", "annotatecms", "attogram", "bitrix", @@ -84,6 +87,7 @@ "cockpit", "codeigniter", "concrete5", + "concreteCMS", "croogo", "dokuwiki", "drupal", @@ -94,7 +98,7 @@ "grav", "installer", "itop", - "joomla", + "known", "kohana", "laravel", "lavalite", @@ -102,14 +106,18 @@ "magento", "majima", "mako", + "matomo", "mediawiki", + "miaoxing", "modulework", "modx", "moodle", "osclass", + "pantheon", "phpbb", "piwik", "ppi", + "processwire", "puppet", "pxcms", "reindex", @@ -117,37 +125,55 @@ "shopware", "silverstripe", "sydes", - "symfony", - "typo3", + "sylius", + "tastyigniter", "wordpress", "yawik", "zend", "zikula" ], - "time": "2018-08-27T06:10:37+00:00" + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v2.3.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-06-24T20:46:46+00:00" }, { "name": "filp/whoops", - "version": "2.3.1", + "version": "2.18.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "bc0fd11bc455cc20ee4b5edabc63ebbf859324c7" + "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/bc0fd11bc455cc20ee4b5edabc63ebbf859324c7", - "reference": "bc0fd11bc455cc20ee4b5edabc63ebbf859324c7", + "url": "https://api.github.com/repos/filp/whoops/zipball/a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", + "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0", - "psr/log": "^1.0.1" + "php": "^7.1 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "require-dev": { - "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", @@ -156,7 +182,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.7-dev" } }, "autoload": { @@ -185,33 +211,43 @@ "throwable", "whoops" ], - "time": "2018-10-23T09:00:00+00:00" + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.18.0" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2025-03-15T12:00:00+00:00" }, { "name": "pimple/pimple", - "version": "v3.2.3", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/silexphp/Pimple.git", - "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" + "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", - "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a94b3a4db7fb774b3d78dad2315ddc07629e1bed", + "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed", "shasum": "" }, "require": { - "php": ">=5.3.0", - "psr/container": "^1.0" + "php": ">=7.2.5", + "psr/container": "^1.1 || ^2.0" }, "require-dev": { - "symfony/phpunit-bridge": "^3.2" + "symfony/phpunit-bridge": "^5.4@dev" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "3.4.x-dev" } }, "autoload": { @@ -230,34 +266,37 @@ } ], "description": "Pimple, a simple Dependency Injection Container", - "homepage": "http://pimple.sensiolabs.org", + "homepage": "https://pimple.symfony.com", "keywords": [ "container", "dependency injection" ], - "time": "2018-01-21T07:42:36+00:00" + "support": { + "source": "https://github.com/silexphp/Pimple/tree/v3.5.0" + }, + "time": "2021-10-28T11:13:42+00:00" }, { "name": "psr/container", - "version": "1.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -272,7 +311,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -284,34 +323,38 @@ "container-interop", "psr" ], - "time": "2017-02-14T16:28:37+00:00" + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/log", - "version": "1.1.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -321,7 +364,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -331,17 +374,25 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.5.9" + "php": "^8.0" + }, + "platform-dev": {}, + "platform-overrides": { + "php": "8.2", + "ext-rdkafka": "6.0.3" }, - "platform-dev": [] + "plugin-api-version": "2.6.0" } From 9b3824f055a60531881b610ef74d7408a49d6c2f Mon Sep 17 00:00:00 2001 From: Philip Downer Date: Fri, 21 Mar 2025 09:52:49 -0600 Subject: [PATCH 2/4] Adds docs for creating a fatal error mu-plugin --- README.md | 21 +++++++++++++++++++++ composer.json | 2 +- composer.lock | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 533ddb7..3647572 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,28 @@ $wps['run']->silenceErrorsInPaths( '~^((?!/my-plugin/).)*$~', E_NOTICE | E_WARNI // Silence for plugins _except_ specific plugin. $wps['run']->silenceErrorsInPaths( '~/wp-content/plugins/(?!my-plugin)~', E_NOTICE | E_WARNING ); ``` +### Testing a fatal error state +If you desire a method to test that the plugin is installed correctly, you can create a simple mu-plugin. At `/wp-content/mu-plugins` create the file `trigger-fatal-error.php`. Add the following code: + +```php +/** +* Plugin Name: Trigger Fatal Error +*/ +add_action('wp_loaded', function () { + if( + isset($_GET['triggerFatalError']) && + WP_DEBUG && + WP_DEBUG_DISPLAY + ) { + noSuchFunction(); + } +}, 1); +``` + +On the frontend of your site, trigger an error by appending `?triggerFatalError=true` to your URL. + +Like Whoops, this should only be used in a non-production environment. ## License diff --git a/composer.json b/composer.json index 130d661..7f28f44 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "issues": "https://github.com/Rarst/wps/issues" }, "require" : { - "php" : "^8.0", + "php": "^7.2 || ^8.0", "composer/installers": "^v2.3.0", "filp/whoops" : "^2.3.1", "pimple/pimple" : "^3.2.3" diff --git a/composer.lock b/composer.lock index 903f372..a6444f9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eec1b513f1bd32ddb938d802a670be96", + "content-hash": "ec14e0b2719a6585d2e002fec7ae65b7", "packages": [ { "name": "composer/installers", @@ -387,7 +387,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.0" + "php": "^7.2 || ^8.0" }, "platform-dev": {}, "platform-overrides": { From 5e3d30907cbca239f95578310aa30f9ee920984b Mon Sep 17 00:00:00 2001 From: Philip Downer Date: Fri, 21 Mar 2025 10:02:16 -0600 Subject: [PATCH 3/4] Adds link for mu-plugins to WP docs. Restores Composer namespace --- README.md | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3647572..5fe9ffc 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ $wps['run']->silenceErrorsInPaths( '~/wp-content/plugins/(?!my-plugin)~', E_NOTI ``` ### Testing a fatal error state -If you desire a method to test that the plugin is installed correctly, you can create a simple mu-plugin. At `/wp-content/mu-plugins` create the file `trigger-fatal-error.php`. Add the following code: +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: ```php /** diff --git a/composer.json b/composer.json index 7f28f44..68606d2 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name" : "philipdowner/whoops", + "name" : "rarst/wps", "description": "WordPress plugin for whoops error handler.", "keywords" : [ "wordpress", From 9d33b9b8bfb26ce08ee7a38b929a334a5189dea9 Mon Sep 17 00:00:00 2001 From: Philip Downer Date: Fri, 21 Mar 2025 12:29:00 -0600 Subject: [PATCH 4/4] Adds 2.0.0 version, removes README block and IntelliJ .gitignore directive --- .gitignore | 3 +-- README.md | 22 ---------------------- composer.json | 1 + wps.php | 2 +- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 0122769..5657f6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -vendor -/.idea \ No newline at end of file +vendor \ No newline at end of file diff --git a/README.md b/README.md index 5fe9ffc..88b4fe0 100644 --- a/README.md +++ b/README.md @@ -52,28 +52,6 @@ $wps['run']->silenceErrorsInPaths( '~^((?!/my-plugin/).)*$~', E_NOTICE | E_WARNI // Silence for plugins _except_ specific plugin. $wps['run']->silenceErrorsInPaths( '~/wp-content/plugins/(?!my-plugin)~', E_NOTICE | E_WARNING ); ``` -### Testing a fatal error state - -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: - -```php -/** -* Plugin Name: Trigger Fatal Error -*/ -add_action('wp_loaded', function () { - if( - isset($_GET['triggerFatalError']) && - WP_DEBUG && - WP_DEBUG_DISPLAY - ) { - noSuchFunction(); - } -}, 1); -``` - -On the frontend of your site, trigger an error by appending `?triggerFatalError=true` to your URL. - -Like Whoops, this should only be used in a non-production environment. ## License diff --git a/composer.json b/composer.json index 68606d2..b0c7a15 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "name" : "rarst/wps", + "version" : "2.0.0", "description": "WordPress plugin for whoops error handler.", "keywords" : [ "wordpress", diff --git a/wps.php b/wps.php index a41c2e0..675e51e 100644 --- a/wps.php +++ b/wps.php @@ -4,7 +4,7 @@ Plugin URI: https://github.com/Rarst/wps Description: WordPress plugin for Whoops error handler. Author: Andrey "Rarst" Savchenko -Version: +Version: 2.0.0 Author URI: http://www.rarst.net/ License: MIT