Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
- Add initial promo delay to 6 hours
- Add 21 days delay between two promos
  • Loading branch information
abaicus authored Oct 25, 2024
2 parents fd95cbb + 06aa414 commit c6dbb23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Modules/Promotions.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function load( $product ) {

$last_dismiss_time = $this->get_last_dismiss_time();

if ( ! $this->debug && is_int( $last_dismiss_time ) && ( time() - $last_dismiss_time ) < WEEK_IN_SECONDS ) {
if ( ! $this->debug && is_int( $last_dismiss_time ) && ( time() - $last_dismiss_time ) < ( 3 * WEEK_IN_SECONDS ) ) {
return;
}

Expand Down Expand Up @@ -539,7 +539,7 @@ private function filter_by_screen_and_merge() {

$product_install_time = (int) $this->product->get_install_time();
$is_older = time() > ( $product_install_time + ( 3 * DAY_IN_SECONDS ) );
$is_newer = time() < ( $product_install_time + ( 5 * MINUTE_IN_SECONDS ) );
$is_newer = time() < ( $product_install_time + ( 6 * HOUR_IN_SECONDS ) );

foreach ( $this->promotions as $slug => $promos ) {
foreach ( $promos as $key => $data ) {
Expand All @@ -548,9 +548,9 @@ private function filter_by_screen_and_merge() {

if (
! $this->debug &&
(
(
( $data['delayed'] === true && ! $is_older ) || // Skip promotions that are delayed for 3 days.
$is_newer // Skip promotions for the first 5 minutes after install.
$is_newer // Skip promotions for the first 6 hours after install.
)
) {
unset( $this->promotions[ $slug ][ $key ] );
Expand Down

0 comments on commit c6dbb23

Please sign in to comment.