/** * Release the lock. * * Releases a file lock to allow others to use it. * * @since 4.0.0 * * @param string $lock_file file name of lock * * @return bool true if released, false otherwise */ public function release_file_lock($lock_file) { if (ITSEC_Modules::get_setting('global', 'lock_file')) { return true; } require_once ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-directory.php'; $lock_file = ITSEC_Core::get_storage_dir() . '/' . sanitize_text_field($lock_file) . '.lock'; $result = ITSEC_Lib_Directory::remove($lock_file); if (is_wp_error($result)) { return false; } return true; }
/** * Uninstall execution * * @since 4.0 * * @return void * */ private function uninstall_execute() { global $itsec_globals, $wpdb; $this->deactivate_execute(); require_once $itsec_globals['plugin_dir'] . 'core/class-itsec-modules.php'; ITSEC_Modules::run_uninstall(); $itsec_files = ITSEC_Core::get_itsec_files(); $itsec_files->do_deactivate(); delete_site_option('itsec-storage'); delete_site_option('itsec_global'); delete_site_option('itsec_data'); delete_site_option('itsec_initials'); delete_site_option('itsec_jquery_version'); delete_site_option('itsec_message_queue'); $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->base_prefix . "itsec_log;"); $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->base_prefix . "itsec_lockouts;"); $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->base_prefix . "itsec_temp;"); if (is_dir(ITSEC_Core::get_storage_dir())) { require_once ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-directory.php'; ITSEC_Lib_Directory::remove(ITSEC_Core::get_storage_dir()); } ITSEC_Lib::clear_caches(); }