Skip to content

Commit

Permalink
[N/A] Misc Adjustments (#908)
Browse files Browse the repository at this point in the history
* [N/A] Update plugins to latest versions

* [N/A] Ending Soon Email Updates

* [N/A] Formatting, I18n

* [N/A] Use correct array merge
  • Loading branch information
bd-viget authored Apr 17, 2024
1 parent c1f5c71 commit 73e2055
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
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}';
}


}
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

0 comments on commit 73e2055

Please sign in to comment.