I undid the change I made to @Kjell Iver Johansen's install yesterday and added some debugging to see what's going on. The emails came back this morning. No more than 3 at the same time, surely this can be fixed to send it daily instead..
if ( $daysLeft <= 7 )
{
\IPS\Log::log( [
'withBypass' => [
(new \IPS\DateTime)->diff( \IPS\DateTime::ts( strtotime( $response['expires'] ), TRUE ) ),
(int) (new \IPS\DateTime)->diff( \IPS\DateTime::ts( strtotime( $response['expires'] ), TRUE ) )->format('%r%a'),
],
'withoutBypass' => [
(new \IPS\DateTime)->diff( \IPS\DateTime::ts( strtotime( $response['expires'] ) ) ),
(int) (new \IPS\DateTime)->diff( \IPS\DateTime::ts( strtotime( $response['expires'] ) ) )->format('%r%a')
],
'response' => $response
], 'martinDebug' );
\IPS\core\AdminNotification::send( 'core', 'License', 'expireSoon', FALSE );
}
array (
'withBypass' =>
array (
0 =>
DateInterval::__set_state(array(
'y' => 0,
'm' => 1,
'd' => 18,
'h' => 23,
'i' => 37,
's' => 58,
'f' => 0.948895,
'weekday' => 0,
'weekday_behavior' => 0,
'first_last_day_of' => 0,
'invert' => 0,
'days' => 48,
'special_type' => 0,
'special_amount' => 0,
'have_weekday_relative' => 0,
'have_special_relative' => 0,
)),
1 => 48,
),
'withoutBypass' =>
array (
0 =>
DateInterval::__set_state(array(
'y' => -1,
'm' => 10,
'd' => 11,
'h' => 0,
'i' => 22,
's' => 1,
'f' => 0.051112,
'weekday' => 0,
'weekday_behavior' => 0,
'first_last_day_of' => 0,
'invert' => 1,
'days' => 48,
'special_type' => 0,
'special_amount' => 0,
'have_weekday_relative' => 0,
'have_special_relative' => 0,
)),
1 => -48,
),
'response' =>
array (
'active' => true,
'cloud' => false,
'expires' => '2022-10-28 07:00:00',
'products' =>
array (
'gallery' => true,
'cms' => true,
'forums' => true,
'calendar' => true,
'spam' => true,
),
'chat_limit' => 5,
'support' => 'Standard',
'legacy' => false,
'plan' => NULL,
),
)
As you can see, -48 days since it expired when you don't bypass timezones. You are comparing a unix timestamp with another unix timestamp, so you shouldn't adjust for timezones anyway.