forked from yffaffy/rollbar
-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
Might be related to, or a dupe of, #41. Looks like this is either a bug in the way the plugin uses the Rollbar PHP library.
In vendor\rollbar\rollbar\src\Config.php::setAccessToken()
you have
if (isset($_ENV['ROLLBAR_ACCESS_TOKEN']) && !isset($config['access_token'])) {
$config['access_token'] = $_ENV['ROLLBAR_ACCESS_TOKEN'];
}
but in practice, $config['access_token']
is always set by the plugin, although it might be "". Thus you're unable to use $_ENV
to set the token.
You can change this to
if (!empty($_ENV['ROLLBAR_ACCESS_TOKEN'])) {
$config['access_token'] = $_ENV['ROLLBAR_ACCESS_TOKEN'];
}
but it might be safer to change the logic upstream in the plugin. I would also note that a more common WordPress pattern is to define strings like these in wp-config.php
, rather than using $_ENV
, so having the plugin support something like
define('ROLLBAR_ACCESS_TOKEN', '...');
would be ideal.
Metadata
Metadata
Assignees
Labels
No labels