Skip to content

Commit

Permalink
Merge pull request #39 from MindscapeHQ/add-ignore-3rd-party-errors-o…
Browse files Browse the repository at this point in the history
…ption

Add ignore third-party errors option
  • Loading branch information
sumitramanga authored Jun 26, 2024
2 parents c0d8808 + 20fd880 commit 8b8ce33
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ function rg4wp_js() {
$script .= 'rg4js("enableCrashReporting", true);' . "\n";
}

if (1 == get_option('rg4wp_js_ignore3rdpartyerrors')) {
$script .= 'rg4js("options", { ignore3rdPartyErrors: true });' . "\n";
}

if (get_option('rg4wp_js_tags')) {
$script .= 'rg4js("withTags",[';
$tags = explode(',', get_option('rg4wp_js_tags'));
Expand Down Expand Up @@ -212,6 +216,7 @@ function rg4wp_register_settings() {
register_setting('rg4wp', 'rg4wp_status');
register_setting('rg4wp', 'rg4wp_404s');
register_setting('rg4wp', 'rg4wp_js');
register_setting('rg4wp', 'rg4wp_js_ignore3rdpartyerrors');
register_setting('rg4wp', 'rg4wp_usertracking');
register_setting('rg4wp', 'rg4wp_ignoredomains');
register_setting('rg4wp', 'rg4wp_pulse');
Expand All @@ -227,11 +232,12 @@ function rg4wp_install() {
add_option('rg4wp_usertracking', '0');
add_option('rg4wp_404s', '1');
add_option('rg4wp_js', '1');
add_option('rg4wp_js_ignore3rdpartyerrors', '1');
add_option('rg4wp_ignoredomains', '');
add_option('rg4wp_pulse', '');
add_option('rg4wp_js_tags', '');
add_option('rg4wp_async', '0');
add_option('rg4wp_noadmintracking', '0');
add_option('rg4wp_noadmintracking', '1');
}

function rg4wp_uninstall() {
Expand All @@ -240,6 +246,7 @@ function rg4wp_uninstall() {
delete_option('rg4wp_status');
delete_option('rg4wp_404s');
delete_option('rg4wp_js');
delete_option('rg4wp_js_ignore3rdpartyerrors');
delete_option('rg4wp_usertracking');
delete_option('rg4wp_ignoredomains');
delete_option('rg4wp_pulse');
Expand Down
7 changes: 7 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
<?php _e("Client-side errors"); ?> (JavaScript)
</label>
<br/>
<label for="rg4wp_js_ignore3rdpartyerrors" style="padding-left: 20px;">
<input type="checkbox" name="rg4wp_js_ignore3rdpartyerrors"
id="rg4wp_js_ignore3rdpartyerrors"<?php echo get_option('rg4wp_js_ignore3rdpartyerrors') ? ' checked="checked"' : ''; ?>
value="1"/>
<?php _e("Ignore third-party errors"); ?>
</label>
<br/>
<br/>
<label for="rg4wp_noadmintracking">
<input type="checkbox" name="rg4wp_noadmintracking"
Expand Down

0 comments on commit 8b8ce33

Please sign in to comment.