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

Add Sentry feature (via wp-sentry plugin) #104

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16
registry-url: https://registry.npmjs.org/

- uses: actions/download-artifact@v2
Expand Down
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
9 changes: 8 additions & 1 deletion template/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ 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 configuration (https://github.com/stayallive/wp-sentry)
WP_SENTRY_PHP_DSN=''
WP_SENTRY_BROWSER_DSN=''
WP_SENTRY_BROWSER_TRACES_SAMPLE_RATE=false
WP_SENTRY_ENV=''
<%_ } _%>
27 changes: 27 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,33 @@
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_file_path = dirname( __DIR__ ) . '/package.json';
$version = '';
if ( file_exists( $version_file_path ) ) {
$package_content = file_get_contents( $version_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