function dropbox_backup($args) { extract($args); if ($this->iwp_mmb_function_exists('curl_init')) { if (isset($consumer_secret) && !empty($consumer_secret)) { require_once $GLOBALS['iwp_mmb_plugin_dir'] . '/lib/dropbox.php'; $dropbox = new IWP_Dropbox($consumer_key, $consumer_secret); $dropbox->setOAuthTokens($oauth_token, $oauth_token_secret); if ($dropbox_site_folder == true) { $dropbox_destination .= '/' . $this->site_name . '/' . basename($backup_file); } else { $dropbox_destination .= '/' . basename($backup_file); } try { $dropbox->upload($backup_file, $dropbox_destination, true); } catch (Exception $e) { $this->_log($e->getMessage()); return array('error' => $e->getMessage(), 'partial' => 1); } return true; } else { return array('error' => 'Please connect your InfiniteWP panel with your Dropbox account.', 'error_code' => 'please_connect_dropbox_account_with_panel'); } } else { return array('error' => 'You cannot use Dropbox on your server. Please enable curl first.', 'partial' => 1, 'error_code' => 'cannot_use_dropbox_enable_curl_first'); } }