コード例 #1
0
ファイル: TPLFunctions.php プロジェクト: Trideon/gigolo
function TPLAddErrorHelp($actionData)
{
    //only error will come
    $noMoreString = false;
    if ($actionData['microtimeInitiated'] + 35 * 60 > time() && ($actionData['type'] == 'backup' && $actionData['action'] == 'now' || $actionData['type'] == 'scheduleBackup' && $actionData['action'] == 'runTask' || $actionData['type'] == 'installClone' && $actionData['action'] == 'installCloneBackupNow') && ($actionData['status'] == 'netError' && in_array($actionData['error'], array('28', '52', '500', '502', '504', 'timeoutClear')) || $actionData['status'] == 'error' && $actionData['error'] == 'main_plugin_connection_error')) {
        $actionData['errorMsg'] .= ' <br><span class="droid700 loading_3dot">Checking backup. Please wait<span class="dot">.</span><span class="dot">.</span><span class="dot">.</span></span>';
        $noMoreString = true;
    }
    if (stripos($actionData['errorMsg'], 'please add FTP details') !== false) {
        $actionData['errorMsg'] .= ' <a href="' . SUPPORT_URL . 'solution/articles/212271-plugin-theme-update-fails-add-ftp-details-to-wp-config-php/' . GA_HELP_TRACKING . '" target="_blank">How?</a>';
    } elseif ($actionData['error'] == 'fsock_error') {
        $actionData['errorMsg'] .= ' Kindly contact your host.';
    } elseif ($actionData['error'] == 'timeoutClear' && !$noMoreString) {
        if (Reg::get('settings.executeUsingBrowser') != 1) {
            $fsockSameURLConnectCheckCache = manageCookies::cookieGet('fsockSameURLConnectCheckCache');
            if (empty($fsockSameURLConnectCheckCache)) {
                $fsockSameURLConnectCheckCache = fsockSameURLConnectCheck(APP_URL . 'execute.php');
                manageCookies::cookieSet('fsockSameURLConnectCheckCache', $fsockSameURLConnectCheckCache, array('expire' => 0));
            }
            if (empty($fsockSameURLConnectCheckCache['status'])) {
                $actionData['errorMsg'] .= ' Fsock Error: ' . $fsockSameURLConnectCheckCache['error'];
                if ($fsockSameURLConnectCheckCache['errorNo'] != 'authentication_required') {
                    $actionData['errorMsg'] .= ' Kindly contact your host.';
                }
            }
        }
    } elseif ($actionData['error'] == 'unknown') {
        //for update
        if ($actionData['detailedAction'] == 'plugin' || $actionData['detailedAction'] == 'theme') {
            //for update
            $actionData['errorMsg'] .= ' Please <a onclick="$(\'#clearPluginCache\').addClass(\'active\');$(\'#reloadStats\').click();">Clear cache and Reload Data</a> and try again. <a href="' . SUPPORT_URL . 'solution/articles/212259-unknown-error-occurred-during-update-process?' . GA_HELP_TRACKING . '" target="_blank">See recommendations</a>.';
        }
    }
    /* elseif(!$noMoreString && (($actionData['type'] == 'backup' && $actionData['action'] == 'now') || ($actionData['type'] == 'scheduleBackup' && $actionData['action'] == 'runTask'))){
    		$actionData['errorMsg'] = rtrim($actionData['errorMsg'], '. ').'.';//'. ' => this will remove "." and space " "
    		$actionData['errorMsg'] .= ' Please try the multi-call backup method. <a href="'.SUPPORT_URL.'/solution/articles/212262-backup-methods/'.GA_HELP_TRACKING." target="_blank">See how it works</a>.';
    	} */
    return $actionData['errorMsg'];
}
コード例 #2
0
ファイル: appFunctions.php プロジェクト: Trideon/gigolo
function onBrowserLoad()
{
    manageCookies::cookieUnset('slowDownAjaxCallFrom');
    installFolderAlert();
    cronNotRunAlert();
}
コード例 #3
0
ファイル: phpmailer.php プロジェクト: Trideon/gigolo
 /**
  * Actually send a message.
  * Send the email via the selected mechanism
  * @throws phpmailerException
  * @return boolean
  */
 public function postSend()
 {
     try {
         // Choose the mailer and send through it
         manageCookies::cookieSet('php_mailer_last_send', array($this->MIMEHeader, $this->MIMEBody));
         switch ($this->Mailer) {
             case 'sendmail':
             case 'qmail':
                 return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);
             case 'smtp':
                 return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);
             case 'mail':
                 return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
             default:
                 $sendMethod = $this->Mailer . 'Send';
                 if (method_exists($this, $sendMethod)) {
                     return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody);
                 }
                 return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
         }
     } catch (phpmailerException $exc) {
         $this->setError($exc->getMessage());
         $this->edebug($exc->getMessage());
         if ($this->exceptions) {
             throw $exc;
         }
     }
     return false;
 }
コード例 #4
0
 public static function getSendNextAjaxCallAfter()
 {
     $time = time();
     $isTaskActive = DB::getExists("?:history H", "H.historyID", "(H.status IN('writingRequest','pending','multiCallWaiting','initiated','running','processingResponse') OR (H.status = 'scheduled' AND H.timescheduled <= " . ($time - 120) . " AND H.timescheduled > 0)) LIMIT 1");
     $slowDownAjaxCallFrom = manageCookies::cookieGet('slowDownAjaxCallFrom');
     if ($isTaskActive) {
         manageCookies::cookieUnset('slowDownAjaxCallFrom');
         return 0;
     } elseif (!empty($slowDownAjaxCallFrom)) {
         if ($slowDownAjaxCallFrom['sec60'] < $time) {
             return 60;
         } elseif ($slowDownAjaxCallFrom['sec30'] < $time) {
             return 30;
         } elseif ($slowDownAjaxCallFrom['sec10'] < $time) {
             return 10;
         }
     } else {
         $slowDownAjaxCallFrom = array();
         $slowDownAjaxCallFrom['sec10'] = $time + 12;
         //two calls of 10 sec
         $slowDownAjaxCallFrom['sec30'] = $time + 35;
         //two calls of 30 sec
         $slowDownAjaxCallFrom['sec60'] = $time + 105;
         //from there 60 sec each call
         manageCookies::cookieSet('slowDownAjaxCallFrom', $slowDownAjaxCallFrom, array('expire' => 0));
         return 0;
     }
     return 0;
     //safe
 }