Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tom/rollup changes #40

Merged
merged 5 commits into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@ Changelog

## TBD

* Add WordPress version string to report and session payloads (device.runtimeVersions)
[#39](https://github.com/bugsnag/bugsnag-wordpress/pull/39)
### Enhancements

* Add WordPress version string to report payloads (device.runtimeVersions) [#39](https://github.com/bugsnag/bugsnag-wordpress/pull/39)

### Fixes

* Added ability to define API key as constant [chrisatomix](https://github.com/chrisatomix) [#18](https://github.com/bugsnag/bugsnag-wordpress/issues/18) [#40](https://github.com/bugsnag/bugsnag-wordpress/pull/40)
* Removed form action to prevent deprecation warnings [fiskhandlarn](https://github.com/fiskhandlarn) [#36](https://github.com/bugsnag/bugsnag-wordpress/issues/36) [#40](https://github.com/bugsnag/bugsnag-wordpress/pull/40)
* Fixed broken links on settings page bugsnag.com [#40](https://github.com/bugsnag/bugsnag-wordpress/pull/40)
* Made bugsnagWordpress global to make available for CLI scripts [#23](https://github.com/bugsnag/bugsnag-wordpress/issues/23) [#40](https://github.com/bugsnag/bugsnag-wordpress/pull/40)
13 changes: 13 additions & 0 deletions bugsnag.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,17 @@ public function __call($method, $arguments)
}
}

/**
* Add ability to define Bugsnag API Key as constant in wp-config.php
*
* @return either the API from wp-config or false (to use the option value)
*/
function bugsnag_define_api_key()
{
return defined('BUGSNAG_API_KEY') ? BUGSNAG_API_KEY : false;
}
add_filter('pre_option_bugsnag_api_key', 'bugsnag_define_api_key');
add_filter('pre_site_option_bugsnag_api_key', 'bugsnag_define_api_key');

global $bugsnagWordpress;
$bugsnagWordpress = new Bugsnag_Wordpress();
10 changes: 5 additions & 5 deletions views/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Bugsnag automatically detects errors & crashes on your WordPress site, plugins & themes.
</p>
<p>
Errors are sent to your <a href="https://bugsnag.com">Bugsnag Dashboard</a> for you to view and debug, and we'll also notify you by email, chat, sms or create a ticket in your issue tracking system if you use one. We'll also show you exactly how many times each error occurred, and how many users were impacted by each crash.
Errors are sent to your <a href="https://app.bugsnag.com">Bugsnag Dashboard</a> for you to view and debug, and we'll also notify you by email, chat, sms or create a ticket in your issue tracking system if you use one. We'll also show you exactly how many times each error occurred, and how many users were impacted by each crash.
</p>

<?php if (function_exists('is_plugin_active_for_network') && is_plugin_active_for_network($this->pluginBase)) { ?>
<form method='post'>
<?php } else { ?>
<form method="post" action="options.php">
<form method="post">
<?php } ?>
<?php if(empty($this->apiKey)) { ?>

Expand All @@ -19,7 +19,7 @@
<h3>Please configure your Bugsnag API Key to enable this plugin</h3>

<p>
Sign up for a <a href="https://bugsnag.com/user/sign_up">Bugsnag Account</a> and create a project with type <i>WordPress</i>,<br>
Sign up for a <a href="https://app.bugsnag.com/user/new">Bugsnag Account</a> and create a project with type <i>WordPress</i>,<br>
you'll then be shown your API Key, which you should paste here:
</p>

Expand All @@ -44,7 +44,7 @@
<input type="text" id="bugsnag_api_key" name="bugsnag_api_key" value="<?php echo $this->apiKey ?>" class="regular-text code" /><br>

<p class="description">
You can find your API Key on your <a href="https://bugsnag.com">Bugsnag Dashboard</a>.
You can find your API Key on your <a href="https://app.bugsnag.com">Bugsnag Dashboard</a>.
</p>
</td>
</tr>
Expand Down Expand Up @@ -108,7 +108,7 @@

// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
$.post(ajaxurl, data, function(response) {
alert('Sent notification. Visit https://bugsnag.com/ to see it in your dashboard');
alert('Sent notification. Visit https://app.bugsnag.com/ to see it in your dashboard');
});

});
Expand Down