AlkubotDB::getStoreData(), "method" => "PATCH" ]; wp_remote_request(ALKUBOT_UPDATE_STORE_URL, $data); } } } } /** * This method runs when Alkubot plugin is activated. * Sends activation request to Alkubot server. */ public static function onActivate() { AlkubotDB::init(); if (!empty(AlkubotDB::getToken())) { $data = [ "body" => AlkubotDB::getStoreData(), "method" => "PATCH" ]; wp_remote_request(ALKUBOT_UPDATE_STORE_URL, $data); } } /** * This method runs when Alkubot plugin is deactivated * Sends deactivation request to Alkubot server. */ public static function onDeactivate() { $data = [ "body" => AlkubotDB::getStoreData(), "method" => "PATCH" ]; wp_remote_request(ALKUBOT_DEACTIVATE_STORE_URL, $data); } /** * This method runs when Alkubot plugin is deleted * Sends delete request to Alkubot server. And cleanup DB. */ public static function onUninstall() { $data = [ "body" => AlkubotDB::getStoreData(), "method" => "PATCH" ]; wp_remote_request(ALKUBOT_DELETE_STORE_URL, $data); } }