v-wordpress-plugin-updater/v-wp-updater/uninstall.php
copilot-swe-agent[bot] 1070d9a61f Add Project: UpdateAPI / Author: Vontainment headers to all production PHP files
Co-authored-by: djav1985 <174835544+djav1985@users.noreply.github.com>
2026-03-06 03:16:09 +00:00

63 lines
1.4 KiB
PHP

<?php
/**
* Project: UpdateAPI
* Author: Vontainment <services@vontainment.com>
* License: https://opensource.org/licenses/MIT MIT License
* Link: https://vontainment.com
* Version: 2.0.0
*
* File: uninstall.php
* Description: V WordPress Plugin Updater
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Main uninstallation function that handles all plugin cleanup tasks.
*
* This function performs the complete uninstallation:
* - Clears all scheduled cron jobs
* - Deletes plugin options
*
* @since 2.0.0
* @return void
*/
function vwpu_uninstall_cleanup(): void {
// Clear all scheduled cron jobs.
vwpu_clear_plugin_update_schedule();
vwpu_clear_theme_update_schedule();
// Delete plugin options.
delete_option( 'vwpu-plup' );
delete_option( 'vwpu-thup' );
}
/**
* Clears the scheduled plugin update event.
*
* Removes the scheduled event for plugin updates if it exists.
*
* @since 1.0.0
* @return void
*/
function vwpu_clear_plugin_update_schedule(): void {
if ( wp_next_scheduled( 'vwpu_plugin_updater_check_updates' ) ) {
wp_clear_scheduled_hook( 'vwpu_plugin_updater_check_updates' );
}
}
/**
* Clears the scheduled theme update event.
*
* Removes the scheduled event for theme updates if it exists.
*
* @since 1.0.0
* @return void
*/
function vwpu_clear_theme_update_schedule(): void {
if ( wp_next_scheduled( 'vwpu_theme_updater_check_updates' ) ) {
wp_clear_scheduled_hook( 'vwpu_theme_updater_check_updates' );
}
}