Sometimes, you don't have Laravel projects only but also run a classic Wordpress blog. Do you want to monitor this blog with Flare, too? We got you covered!
Wordpress doesn't use composer out-of-the-box, but there are many guides on how you can do that. For this article, we go with the most straightforward way and composer default. It might not be the best option to add composer to your Wordpress setup, but if you are already using Wordpress and composer, you don't have this issue anyway.
Flare itself has been designed for Laravel projects and so has Ignition. Ignition depends on many Laravel internals and if you want to use Flare with Wordpress, you can use the Generic PHP SDK that powers Ignition.
Install the Generic PHP SDK for Flare
composer require facade/flare-client-php
If you run this command in the root directory of your Wordpress project, this creates a composer.json file and downloads the SDK. Before we can register the Flare error handlers, we need to make sure Wordpress loads the packages that composer manages. Open the wp-config.php file that is unique per installation and does not get updated if a new version of Wordpress is available. The file lives in your root folder.
Add the following two lines to the top of your Wordpress config file to load composer dependencies and register the Flare error handlers. Make sure to add your own key there.
require_once(__DIR__.'/vendor/autoload.php');
Facade\FlareClient\Flare::register('D2lRPxchfWMCYNyoWawQgSRuGtEhygpK')->registerFlareHandlers();
Test your integration by changing the database connection to something that doesn't work and refresh your Wordpress blog. This should trigger an error that you receive in Flare.
Continue reading
Introducing Flare’s next big feature: performance monitoring
Flare's new Performance Monitoring feature is now live, giving you complete visibility into your Laravel app's HTTP routes, queued jobs, Artisan commands, and database queries.
Freek
Lessons from the deep end
20 months ago, we started building Performance Monitoring as Flare’s next big feature, never expecting Laravel’s rapid commercial growth to put us in direct competition with their own tools. This is our honest take on those 20 months went, how we’re adapting to this new reality, and where we’re heading next while staying true to who we are. A dive into the deep end, without knowing how far down it goes.
Alex
Subscribe to Backtrace, our quarterly Flare newsletter
No spam, just news & product updates