Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Add Sentry feature (via plugin)
Browse files Browse the repository at this point in the history
Add the plugin https://github.com/stayallive/wp-sentry in SAO and configure constants
  • Loading branch information
Lucas Simeon committed May 9, 2022
1 parent 69a65b8 commit 7a0ee56
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
3 changes: 3 additions & 0 deletions saofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = {
{ name: 'Wordfence', value: 'wordfence' },
{ name: 'WP Rocket', value: 'wpRocket' },
{ name: 'Rank Math', value: 'rankMath' },
{ name: 'Sentry', value: 'sentry' },
],
default: ['acf', 'wpRocket', 'classicEditor'],
},
Expand All @@ -64,13 +65,15 @@ module.exports = {
const wordfence = features.includes('wordfence');
const wpRocket = features.includes('wpRocket');
const rankMath = features.includes('rankMath');
const sentry = features.includes('sentry');

return {
acf,
classicEditor,
wordfence,
wpRocket,
rankMath,
sentry,
};
},
actions() {
Expand Down
10 changes: 9 additions & 1 deletion template/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,19 @@ AUTH_SALT=''
SECURE_AUTH_SALT=''
LOGGED_IN_SALT=''
NONCE_SALT=''

<%_ if (wpRocket) { _%>

# WP Rocket config
WP_ROCKET_EMAIL=''
WP_ROCKET_KEY=''
WP_CACHE=false
<%_ } _%>
<%_ if (sentry) { _%>

# Sentry config (https://github.com/stayallive/wp-sentry)
WP_SENTRY_PHP_DSN=''
WP_SENTRY_BROWSER_DSN=''
WP_SENTRY_BROWSER_TRACES_SAMPLE_RATE=false
WP_SENTRY_ENV=''
WP_SENTRY_VERSION=''
<%_ } _%>
26 changes: 26 additions & 0 deletions template/bin/source/wp-config-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,32 @@
define( 'WP_ROCKET_KEY', getenv( 'WP_ROCKET_KEY' ) );
define( 'WP_CACHE', getenv( 'WP_CACHE' ) === 'true' );
<%_ } _%>
<%_ if (sentry) { _%>

/**
* Sentry config
* @see https://github.com/stayallive/wp-sentry
*/

$version = '';
if ( file_exists( $file_path ) ) {
$package_content = file_get_contents( $file_path );

if ($package_content) {
$package = json_decode( $package_content );

if ( is_object( $package ) && isset( $package->name, $package->version ) ) {
$version = $package->name . '@' . $package->version;
}
}
}

define( 'WP_SENTRY_VERSION', $version );
define( 'WP_SENTRY_PHP_DSN', getenv( 'WP_SENTRY_PHP_DSN' ) );
define( 'WP_SENTRY_BROWSER_DSN', getenv( 'WP_SENTRY_BROWSER_DSN' ) );
define( 'WP_SENTRY_BROWSER_TRACES_SAMPLE_RATE', getenv( 'WP_SENTRY_BROWSER_TRACES_SAMPLE_RATE' ) );
define( 'WP_SENTRY_ENV', (getenv('WP_SENTRY_ENV')) ? getenv('WP_SENTRY_ENV') : getenv('APP_ENV') );
<%_ } _%>

/* Set default theme */
define( 'WP_DEFAULT_THEME', '<%= slug %>' );
Expand Down
3 changes: 3 additions & 0 deletions template/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<%_ if (rankMath) { _%>
"wpackagist-plugin/seo-by-rank-math": "^1.0",
<%_ } _%>
<%_ if (sentry) { _%>
"stayallive/wp-sentry": "^4.16",
<%_ } _%>
<%_ if (acf) { _%>
"studiometa/advanced-custom-fields-pro": "^5.9.6",
"stoutlogic/acf-builder": "^1.10",
Expand Down

0 comments on commit 7a0ee56

Please sign in to comment.