function wiziapp_upgrading_finish() { $GLOBALS['WiziappLog']->write('debug', "The upgrading is finished, letting the admin know", "post_upgrade.wiziapp_upgrading_finish"); // Send the profile again, and allow it to fail since it's just an update $cms = new WiziappCms(); $cms->activate(); $status = TRUE; $header = array('action' => 'upgrading_finish', 'status' => $status, 'code' => $status ? 200 : 500, 'message' => ''); echo json_encode(array('header' => $header)); exit; }
/** * Revert the installation to remove everything the plugin added */ public function uninstall() { WiziappDB::getInstance()->uninstall(); // Remove scheduled tasks wp_clear_scheduled_hook('wiziapp_daily_function_hook'); wp_clear_scheduled_hook('wiziapp_weekly_function_hook'); wp_clear_scheduled_hook('wiziapp_monthly_function_hook'); // Deactivate the blog with the global services try { $cms = new WiziappCms(); $cms->deactivate(); } catch (Exception $e) { // If it failed, it's ok... move on } // Remove all options - must be done last delete_option('wiziapp_screens'); delete_option('wiziapp_components'); delete_option('wiziapp_pages'); delete_option('wiziapp_last_processed'); WiziappConfig::getInstance()->uninstall(); }
public function testToken() { // If we don't have a token, try to get it again $activated = !empty(WiziappConfig::getInstance()->app_token); if (!$activated) { $cms = new WiziappCms(); $activated = $cms->activate(); } if (!$activated) { $errors = new WiziappError(); if (!$this->testedConnection) { $connTest = $this->testConnection(); if (WiziappError::isError($connTest)) { $errors = $connTest; } } if (!$this->hadConnectionError) { // If we already had connections errors, we are showing the problems from those errors // Else... $this->critical = TRUE; $errors->add('missing_token', __('Oops! It seems that the main server is not responding. Please make sure that your internet connection is working, and try again.', 'wiziapp')); } return $errors; } return TRUE; }
function wiziapp_batch_processing_finish() { $GLOBALS['WiziappLog']->write('debug', "The batch processing is finished, marking as finished", "post_install.wiziapp_batch_processing_finish"); // Send the profile again, and allow it to fail since it's just an update $cms = new WiziappCms(); $cms->activate(); // Mark the processing as finished WiziappConfig::getInstance()->finished_processing = TRUE; $status = TRUE; $header = array('action' => 'batch_processing_finish', 'status' => $status, 'code' => $status ? 200 : 500, 'message' => ''); $GLOBALS['WiziappLog']->write('debug', "The batch processing is finished, marked as finished", "post_install.wiziapp_batch_processing_finish"); echo json_encode(array('header' => $header)); exit; }