Skip to content

Commit

Permalink
Built release for 4.5.18. For a full change log look at the notes wit…
Browse files Browse the repository at this point in the history
…hin the original/4.5.18 release.
  • Loading branch information
github-actions[bot] committed Jul 28, 2022
1 parent 9323680 commit f0337a1
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 321 deletions.
2 changes: 1 addition & 1 deletion build.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"owner":"humanmade","repo":"aws-analytics","sha":"a1d216b0a0f93ec289b358aa98777c83cc2b4e3e","ref":"refs/tags/4.6.9","tagName":"4.6.9","branch":"gh-actions","tags":["4.6.9"],"updated_at":"2022-07-28T16:02:58.712Z"}
{"owner":"humanmade","repo":"aws-analytics","sha":"12a947dc2fcfb0a896bfabdf761880dbd53ca33f","ref":"refs/tags/4.5.18","tagName":"4.5.18","branch":"gh-actions","tags":["4.5.18"],"updated_at":"2022-07-28T16:20:11.513Z"}
19 changes: 0 additions & 19 deletions inc/blocks/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ function setup() {

// Publication checklist integration.
add_action( 'altis.publication-checklist.register_prepublish_checks', __NAMESPACE__ . '\\check_conversion_goals' );

// Support Excerpts
add_filter( 'excerpt_allowed_wrapper_blocks', __NAMESPACE__ . '\filter_excerpt_allowed_wrapper_blocks' );
}

/**
Expand Down Expand Up @@ -926,19 +923,3 @@ function check_conversion_goals() {
},
] );
}

/**
* Allow the ab-test and personalization blocks to contribute towards an excerpt.
*
* @param array $allowed_blocks The current array of allowed wrapper blocks;
*
* @return array The updated wrapper blocks.
*/
function filter_excerpt_allowed_wrapper_blocks( array $allowed_blocks ) : array {
$allowed_blocks[] = 'altis/ab-test';
$allowed_blocks[] = 'altis/ab-test-variant';
$allowed_blocks[] = 'altis/personalization';
$allowed_blocks[] = 'altis/personalization-variant';

return $allowed_blocks;
}
239 changes: 0 additions & 239 deletions inc/export/cron/namespace.php

This file was deleted.

2 changes: 0 additions & 2 deletions inc/export/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@
function setup() {
$endpoint = new Endpoint();
$endpoint->bootstrap();

Cron\bootstrap();
}
45 changes: 42 additions & 3 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace Altis\Analytics;

use Altis\Analytics\Utils;
use Aws\S3\S3Client;
use DateInterval;
use DateTime;
use Exception;
Expand Down Expand Up @@ -423,9 +424,11 @@ function delete_old_indexes() {
*/
function clean_s3_store() : void {

// Get S3 client.
$client = Utils\get_s3_client();
if ( ! $client ) {
// These constants are required to continue.
if ( ! defined( 'ALTIS_ANALYTICS_PINPOINT_BUCKET_ARN' ) ) {
return;
}
if ( ! defined( 'ALTIS_ANALYTICS_PINPOINT_BUCKET_REGION' ) ) {
return;
}

Expand All @@ -443,6 +446,42 @@ function clean_s3_store() : void {
$date->sub( new DateInterval( 'P' . $max_age . 'D' ) );
$max_age_date = $date->format( 'U' );

// Get S3 client.
$params = [
'version' => '2006-03-01',
'region' => ALTIS_ANALYTICS_PINPOINT_BUCKET_REGION,
];

// Add defined credentials if available.
if ( defined( 'ALTIS_ANALYTICS_S3_KEY' ) && defined( 'ALTIS_ANALYTICS_S3_SECRET' ) ) {
$params['credentials'] = [
'key' => ALTIS_ANALYTICS_S3_KEY,
'secret' => ALTIS_ANALYTICS_S3_SECRET,
];
}

// Allow overriding the S3 endpoint.
if ( defined( 'ALTIS_ANALYTICS_S3_ENDPOINT' ) ) {
$params['endpoint'] = ALTIS_ANALYTICS_S3_ENDPOINT;
}

/**
* Filter the Analytics S3 client params.
*
* @param array $params The parameters used to instantiate the S3Client object.
*/
$params = apply_filters( 'altis.analytics.s3_client_params', $params );

$client = new S3Client( $params );

/**
* Filter the S3 client used by the AWS Analytics plugin.
*
* @param Aws\S3\S3Client $client The S3Client object.
* @param array $params The default params passed to the client.
*/
$client = apply_filters( 'altis.analytics.s3_client', $client, $params );

// Fetch first batch of items.
try {
$max_keys = 1000;
Expand Down
Loading

0 comments on commit f0337a1

Please sign in to comment.