Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds a logger API endpoint to Playground.WordPress.net. ## What problem is it solving? It creates a standard place where users can send crash reports. ## How is the problem addressed? A PHP script accepts the log message, validates the format, and sends the log message to a Making WordPress Slack channel. ## Testing Instructions - Start a local PHP server - Copy the `logger.php` file to the server - Follow the readme to get the token and replace the token and channel ID [with these values in logger.php](https://github.com/WordPress/wordpress-playground/pull/1113/files#diff-40d926630e2b7f17f2bff83810ab64c7beb5b2f5333f1c94ee2e3fbb2b0afb2cR3-R4) - Send a request and confirm a message was sent to the Slack channel (replace _http://localhost:10013/logger.php_ with your path) ``` curl --location 'http://localhost:10013/logger.php' \ --form 'message="What happened? Ut consequuntur esse sint sequi sapiente corrupti. Suscipit est facere voluptatem omnis earum necessitatibus molestiae. Exercitationem odio id ut alias voluptatum. Dolor ut dolores labore hic at. Aspernatur provident voluptatem dignissimos et aut minima et aut. Eaque odio aut consequatur quam quidem. Logs [02-Jan-2024 08:08:06 UTC] PHP-WASM Fatal: null function or function signature mismatch Error: null function or function signature mismatch at #handleRequest (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/base-php.ts?t=1710835676492:518:24) at async WebPHP.run (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/base-php.ts?t=1710835676492:211:24) at async #dispatchToPHP (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/php-request-handler.ts?t=1710835676492:178:14) at async PHPRequestHandler.request (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/php-request-handler.ts?t=1710835676492:84:14) at async PHPBrowser.request (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/php-browser.ts:32:22) [19-Mar-2024 08:08:06 UTC] PHP-WASM Fatal: null function or function signature mismatch Error: null function or function signature mismatch at #handleRequest (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/base-php.ts?t=1710835676492:518:24) at async WebPHP.run (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/base-php.ts?t=1710835676492:211:24) at async #dispatchToPHP (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/php-request-handler.ts?t=1710835676492:178:14) at async PHPRequestHandler.request (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/php-request-handler.ts?t=1710835676492:84:14) at async PHPBrowser.request (http://localhost:5400/@fs/Users/bero/Projects/wordpress-playground/packages/php-wasm/universal/src/lib/php-browser.ts:32:22) Url http://localhost:5400/website-server/?php=8.0&wp=latest&storage=none&networking=yes#%7B%20%22landingPage%22:%20%22/wp-admin/%22,%20%22features%22:%20%7B%20%22networking%22:%20true%20%7D,%20%22steps%22:%20%5B%20%7B%20%22step%22:%20%22login%22%20%7D,%20%7B%20%22step%22:%20%22writeFile%22,%20%22path%22:%20%22/wordpress/wp-content/mu-plugins/rewrite.php%22,%20%22data%22:%20%22%3C?php%20add_action(%20'\''shutdown'\'',%20function()%20%7B%20post_message_to_js('\''test'\'');%20%7D%20);%22%20%7D%20%5D%20%7D"' ```
- Loading branch information