Closed rkaiser0324 closed 5 years ago
@rkaiser0324 thanks for bringing this to our attention.
@ArturMoczulski can you investigate when you get a chance?
This has been implemented in master
and released in 2.4.10
The plugin should respect both ROLLBAR_ACCESS_TOKEN
environment variable and a constant with the same name.
The docs have been updated: https://docs.rollbar.com/docs/wordpress#section-setting-the-access-token-in-your-source-code-or-server-configuration
Might be related to, or a dupe of, https://github.com/rollbar/rollbar-php-wordpress/issues/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 havebut 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
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 likewould be ideal.