formWidget->data->tinypng_developer_key; if ($key) { try { \Tinify\setKey($key); \Tinify\validate(); $validKey = true; $compressionsThisMonth = (int) \Tinify\compressionCount(); $remainingFree = max(0, 500 - $compressionsThisMonth); } catch(\Tinify\Exception $e) { } } $currentDate = new DateTime(date('Y-m-d')); $currentDate->add(new DateInterval('P1M')); $firstDayOfNextMonth = $currentDate->format('Y-m-1'); $firstDayOfNextMonth = new DateTime($firstDayOfNextMonth); $now = new DateTime(); $interval = $now->diff($firstDayOfNextMonth); $daysUntilRenew = $interval->format('%a'); if ($validKey) { ?>
=$daysUntilRenew?>