callback = array(AdminNoticesController::getInstance(), 'proposeUpgradePopup'); parent::load(); } protected function checkTrigger() { $quotaController = QuotaController::getInstance(); if ($quotaController->hasQuota() === true) return false; // $quotaData = $quotaController->getQuota(); $this->reset('MSG_UPGRADE_MONTH'); $this->reset('MSG_UPGRADE_BULK'); return true; } protected function getMessage() { $statsControl = StatsController::getInstance(); $averageCompression = $statsControl->getAverageCompression(); $quotaController = QuotaController::getInstance(); $keyControl = ApiKeyController::getInstance(); //$keyModel->loadKey(); $login_url = 'https://shortpixel.com/login/'; $friend_url = $login_url; if ($keyControl->getKeyForDisplay()) { $login_url .= $keyControl->getKeyForDisplay() . '/spio-unlimited'; $friend_url = $login_url . 'tell-a-friend'; } $message = '
'; if($averageCompression) { $message .= '
' . __('Average image
reduction until now:','shortpixel-image-optimiser') . '
'; } $message .= '

' . __('Quota Exceeded','shortpixel-image-optimiser') . '

'; $quota = $quotaController->getQuota(); $creditsUsed = number_format($quota->monthly->consumed + $quota->onetime->consumed); $totalOptimized = $statsControl->find('total', 'images'); $totalImagesToOptimize = number_format($statsControl->totalImagesToOptimize()); $message .= '

' . sprintf(__('The plugin has optimized %s images and has been stopped because it has reached the available quota limit.','shortpixel-image-optimiser'), $creditsUsed); if($totalImagesToOptimize > 0) { $message .= sprintf(__(' %s images and thumbnails have not been optimized by ShortPixel yet.','shortpixel-image-optimiser'), $totalImagesToOptimize ); } $message .= sprintf('

' . __('Upgrade','shortpixel-image-optimiser') . '
', $login_url); $message .= '
'; /// closing div return $message; } }