Skip to content
Snippets Groups Projects
Commit 3486ccfa authored by lechuck's avatar lechuck Committed by lechuck
Browse files

fix to sentry plugin

parent 7b286d62
No related branches found
No related tags found
No related merge requests found
Showing
with 26 additions and 4 deletions
...@@ -10,15 +10,14 @@ class WP_Raven_Client extends Raven_Client { ...@@ -10,15 +10,14 @@ class WP_Raven_Client extends Raven_Client {
function __construct() { function __construct() {
$this->settings = get_option( 'sentry-settings' );
if ( !isset( $this->settings['dsn'] )) return; if ( !isset( $this->settings['dsn'] )) return;
if ( $this->settings['dsn'] == '' ) return; if ( $this->settings['dsn'] == '' ) return;
parent::__construct( $this->settings['dsn'] ); parent::__construct('http://ae2f418cf46f4910bf2c549335828557:9fc4940e00b34b9dade1bf0636846eec@evasione-vpn:3000/11');
$this->setErrorReportingLevel( $this->settings['reporting_level'] ); $this->setErrorReportingLevel( 'E_ALL );
$this->setHandlers(); $this->setHandlers();
......
...@@ -14,36 +14,10 @@ class WPSentry extends WP_Raven_Client { ...@@ -14,36 +14,10 @@ class WPSentry extends WP_Raven_Client {
function WPSentry() { function WPSentry() {
add_action( 'admin_menu', array( $this, 'addOptionsPage' ));
if ( is_admin() && $_POST )
$this->saveOptions();
parent::__construct(); parent::__construct();
} }
function addOptionsPage() {
add_options_page('Sentry Error Reporting Settings', 'Sentry', 8, 'sentrysettings', array( $this, 'printOptionsHTML' ));
}
function printOptionsHTML() {
extract( $this->settings );
require_once( dirname(__FILE__).'/optionspage.html.php' );
}
function saveOptions() {
if ( !isset( $_POST[ 'sentry_dsn' ] ) || !isset( $_POST[ 'sentry_reporting_level' ]))
return;
update_option('sentry-settings', array(
'dsn' => $_POST[ 'sentry_dsn' ],
'reporting_level' => $_POST[ 'sentry_reporting_level' ]
));
}
} }
add_action('plugins_loaded', create_function(null, '$wps = new WPSentry(); ') ); add_action('plugins_loaded', create_function(null, '$wps = new WPSentry(); ') );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment