-
Notifications
You must be signed in to change notification settings - Fork 2
/
load.php
60 lines (55 loc) · 1.57 KB
/
load.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* Altis Cloud Module Loader.
*
* @package altis/cloud
*/
namespace Altis\Cloud; // phpcs:ignore
use Altis;
add_action( 'altis.modules.init', function () {
$is_cloud = is_cloud();
$default_settings = [
'enabled' => true,
'cavalcade' => true,
's3-uploads' => true,
'aws-ses-wp-mail' => $is_cloud,
'batcache' => $is_cloud,
'redis' => true,
'memcached' => Altis\get_environment_architecture() === 'ec2',
'ludicrousdb' => true,
'healthcheck' => true,
'xray' => true,
'email-from-address' => null,
'email-region' => false,
'audit-log-to-cloudwatch' => $is_cloud,
'php-errors-to-cloudwatch' => $is_cloud,
'cdn-media-purge' => false,
'page-cache' => [
'ignored-query-string-params' => [
'utm_campaign',
'utm_medium',
'utm_source',
'utm_term',
'utm_content',
'mc_cid',
'mc_eid',
'fbclid',
'_ga',
],
'unique-headers' => [
'cloudfront-viewer-country',
],
'unique-cookies' => [],
],
];
$options = [
'defaults' => $default_settings,
];
Altis\register_module( 'cloud', __DIR__, 'Cloud', $options, __NAMESPACE__ . '\\bootstrap' );
} );
// Early hook for logging AWS SDK HTTP requests.
add_filter( 'altis.aws_sdk.params', __NAMESPACE__ . '\\add_aws_sdk_xray_callback' );
add_filter( 's3_uploads_s3_client_params', __NAMESPACE__ . '\\add_aws_sdk_xray_callback' );
add_filter( 'aws_ses_wp_mail_ses_client_params', __NAMESPACE__ . '\\add_aws_sdk_xray_callback' );
// Ensure debug display is off in cloud environments.
add_action( 'altis.loaded_autoloader', __NAMESPACE__ . '\\set_wp_debug_constants', 0 );