| 开发者 |
arturmoczulski
jorbin danielmorell |
|---|---|
| 更新时间 | 2025年10月18日 23:16 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 6.8 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
Plugins → Add New.Rollbar by Rollbar in the search results.Install Now next to the Rollbar plugin.Plugins → Installed plugins find Rollbar and click Activate underneath.rollbar/rollbar-php
library. In complex projects, this might lead to version conflicts between dependencies and other plugins/packages. If
this is an issue in your project, we recommend the "Packagist" installation method.
Through Packagist
Note: this only works if your WordPress project is managed with Composer.
Read Using Composer with WordPress for more details.
This is a recommended way to install the Rollbar plugin for advanced projects. This way ensures the plugin and all of
its dependencies are managed by Composer.
You can install the plugin by running the following command in the root directory of your WordPress project:
txt
composer require rollbar/rollbar-php-wordpress:^3.0
Through WPackagist
Note: if your WordPress project is managed with Composer, we strongly recommend installing the plugin through
Packagist instead.
Installing the plugin from wpackagist.org instead of packagist.org will result in the plugin being managed by
Composer. However, the downside is that it's dependencies will not be managed by composer. Instead they will be packaged
in the plugin's vendor directory not in your project's vendor directory. This has the potential to cause name
collisions if other plugins or your project use different versions of the same dependencies.
To install the plugin from wpackagist.org run the following steps command in the root directory of your WordPress
project:
txt
composer require wpackagist-plugin/rollbar
Configuration
The plugin can be configured in the WordPress Admin or programmatically.
WordPress Admin
The plugin provides a settings page in the WordPress Admin that allows you to configure the plugin. This settings page
can be disabled by setting the ROLLBAR_DISABLE_ADMIN constant to true in your wp-config.php file.
Plugins → Installed plugins find Rollbar and click Activate underneath.Settings → Project Access Tokens.post_client_item and post_server_item.Settings → Rollbar:PHP error logging and/or Javascript error logging depending on your needs.Access Token section.Environment. By default, the environment will be taken from WP_ENV
environment variable if it's set otherwise it's blank. We recommend to fill this out either with development or
production.Save Changes.Yes, of course. Additionally, you can assign different environments to each of your blogs.
Yes. It's actually the recommended method of installation. You can install the rollbar/rollbar-php-wordpress package
using composer.
ROLLBAR_DISABLE_ADMIN to remove the plugin settings page from the admin.ROLLBAR_SETTINGS to configure the plugin without the admin page.ROLLBAR_CLIENT_ACCESS_TOKEN constant or environment variable to set the client access token.WP_PROXY_BYPASS_HOSTS, WP_PROXY_USERNAME, and WP_PROXY_PASSWORD for better proxy management.rollbar_api_admin_permission filter to allow custom authorization of the admin API.rollbar_user_can_view_admin filter to allow custom disabling of the admin page.rollbar_php_config filter to allow more exact control over Rollbar PHP configurations.rollbar_telemetry_actions filter to allow control of which actions are logged via telemetry.rollbar_telemetry_custom_handlers filter to allow custom control over what is logged in telemetry messages.plugins_loaded hook to the invocation of the main plugin file (https://github.com/rollbar/rollbar-php-wordpress/issues/73)Enable as a Must-Use plugin settings (https://github.com/rollbar/rollbar-php-wordpress/issues/73)rollbar_plugin_settings filter