rollbar / rollbar-php-wordpress

Official WordPress plugin from Rollbar, Inc.
https://rollbar.com/
GNU General Public License v2.0
15 stars 20 forks source link

Programmatically configure the plugin #62

Closed andreagioco closed 6 years ago

andreagioco commented 6 years ago

I'm trying to scrub the information sent to Rollbar, like my user's first_name and last_name for example.

I used the "rollbar_plugin_settings" Wordpress filter as mentioned in the documentation. I included it in my function.php file as follow:

function adjust_rollbar_settings($settings)
{
    $settings['scrub_fields'] = [
        'password', 'secret', 'confirm_password', 'password_confirmation',
        'auth_token', 'csrf_token', '_token', 'token', 'bearer', 'Bearer', 'jwt',
        'first_name', 'last_name', 'email', 'mobile', 'phone',
    ];
    return $settings;
}

add_filter('rollbar_plugin_settings', 'adjust_rollbar_settings');

It seems that the plugin calls this configuration function on its constructor, but at that point the function.php file hasn't be included yet.

My data are not scrubed and the configuration is ignored.

rivkahstandig3636 commented 6 years ago

@ArturMoczulski Can you take a look into this?

ArturMoczulski commented 6 years ago

Fixed. Will be included in the next release.