Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[N/A] Always include Site ID with Auctioneer Requests #909

Merged
merged 7 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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 client-mu-plugins/goodbids/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"wpackagist-plugin/top-bar": "^3.0",
"wpackagist-plugin/user-switching": "^1.7",
"wpackagist-plugin/woocommerce": "^8.6",
"wpackagist-plugin/woocommerce-gateway-stripe": "^8.1",
"wpackagist-plugin/woocommerce-gateway-stripe": "^8.2",
"wpackagist-plugin/woocommerce-services": "^2.5",
"wpackagist-plugin/zapier": "^1.0",
"wpengine/advanced-custom-fields-pro": "^6.2"
Expand Down
36 changes: 18 additions & 18 deletions client-mu-plugins/goodbids/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function update( int $auction_id, array $extra_data = [] ): bool {
private function setup_payload_data( array $payload_data, array $extra_data = [] ): array {
$defaults = [
'requestTime',
'siteId',
];

return array_filter(
Expand Down
3 changes: 1 addition & 2 deletions client-mu-plugins/goodbids/src/classes/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ private function load_config(): bool {
if ( empty( $local['version'] ) || version_compare( $json['version'], $local['version'], '!=' ) ) {
Log::warning( 'Local config file version mismatch.' );
}

$json = array_merge_recursive( $json, $local );
$json = array_merge( $json, $local );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,21 @@ public function __construct() {

/**
* Trigger this email when an Auction is within 4 hours of closing
*
*
* @since 1.0.0
*
*
* @return void
*/
private function cron_check_for_auctions_ending_soon(): void {
add_action(
Auctions::CRON_AUCTION_ENDING_SOON_CHECK_HOOK,
function (): void {
$auctions = goodbids()->auctions->get_auctions_ending_soon_emails();
if (! $auctions){
if ( ! $auctions ) {
return;
}
foreach ($auctions as $auction_id){

foreach ( $auctions as $auction_id ) {
$auction = goodbids()->auctions->get( $auction_id );
$this->send_to_bidders( $auction );
$this->send_to_watchers( $auction );
Expand Down Expand Up @@ -118,5 +119,4 @@ public function get_button_url(): string {
return '{auction.url}';
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ private function get_payload_item( string $item ): mixed {
'requestTime' => current_datetime()->format( 'c' ),
'rewardClaimed' => $this->has_user_claimed_reward(),
'rewardUrl' => goodbids()->rewards->get_claim_reward_url( $this->auction_id ),
'siteId' => get_current_blog_id(),
'socketUrl' => $this->get_socket_url(),
'startTime' => $this->auction->get_start_date_time( 'c' ),
'totalBids' => $this->auction->get_bid_count(),
Expand Down
8 changes: 6 additions & 2 deletions client-mu-plugins/goodbids/views/parts/auction.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
}
$remaining_time = $current_date->diff( $end_date );

$time = __( 'Ending ', 'goodbids' ) . $auction->get_end_date_time( 'M d' ) . ' if nobody else bids';

$time = sprintf(
'%s %s %s',
__( 'Ending', 'goodbids' ),
$auction->get_end_date_time( 'M d' ),
__( 'if nobody else bids', 'goodbids' )
);

if ( $remaining_time->d < 1 && $remaining_time->h >= 1 ) {
$clock_svg = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

// After.
sprintf(
/* translators: %1$s: Site Title, Reward Product Title */
/* translators: %1$s: Site Title, %2$s: Reward Product Title */
esc_html__( 'to support %1$s\'s mission and place a bid for your chance to win the %2$s!', 'goodbids' ),
'{site_title}',
'{reward.title}'
Expand All @@ -54,11 +54,10 @@
<?php
printf(
'%s %s %s <strong>%s</strong> %s',
/* translators: %1$s: Auction total raised, %2$s: current high bid */
esc_html__( 'We\ve already raised', 'goodbids' ),
esc_html__( 'We\'ve already raised', 'goodbids' ),
'{auction.total_raised}',
esc_html__( 'and the', 'goodbids' ),
esc_html__( 'current high bid is ', 'goodbids' ),
esc_html__( 'current high bid is', 'goodbids' ),
'{auction.high_bid}'
);
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

echo "\n\n----------------------------------------\n\n";

esc_html_e( 'Auction', 'goodbids' ) . ': ' . '{auction.title}' . "\n";
esc_html_e( 'Total Raised', 'goodbids' ) . ': ' . '{auction.total_raised}' . "\n";
esc_html_e( 'High Bid', 'goodbids' ) . ': ' . '{auction.high_bid}' . "\n";
echo esc_html__( 'Auction', 'goodbids' ) . ': {auction.title}' . "\n";
echo esc_html__( 'Total Raised', 'goodbids' ) . ': {auction.total_raised}' . "\n";
echo esc_html__( 'High Bid', 'goodbids' ) . ': {auction.high_bid}' . "\n";

echo "\n\n----------------------------------------\n\n";

Expand Down