# learnpress/4.4.8/assets/src/apps/js/admin/pages/tools.js

LearnPress – WordPress LMS Plugin for Create and Sell Online Courses, version 4.4.8. 50 lines.

- Page: https://pluginprobe.com/plugins/learnpress/4.4.8/code/assets/src/apps/js/admin/pages/tools.js
- Raw: https://pluginprobe.com/plugins/learnpress/4.4.8/raw/assets/src/apps/js/admin/pages/tools.js
- Modified: 2026-09-18T11:22:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/learnpress/4.4.8/code/assets/src/apps/js/admin/pages/tools.js#L10-L20`.

```javascript
import getStepsUpgradeStatus from './tools/database/upgrade';
import createIndexes from './tools/database/create_indexs';
import reUpgradeDB from './tools/database/re-upgrade-db';
import cleanDatabases from './tools/database/clean_database';

( function( $ ) {
	const $doc = $( document );

	const clearHardCache = function clearHardCache( e ) {
		e.preventDefault();
		const $button = $( this );

		if ( $button.hasClass( 'disabled' ) ) {
			return;
		}

		$button.addClass( 'disabled' ).html( $button.data( 'cleaning-text' ) );
		$.ajax( {
			url: $button.attr( 'href' ),
			data: {},
			success( response ) {
				$button.removeClass( 'disabled' ).html( $button.data( 'text' ) );
			},
			error() {
				$button.removeClass( 'disabled' ).html( $button.data( 'text' ) );
			},
		} );
	};

	const toggleHardCache = function toggleHardCache() {
		$.ajax( {
			url: 'admin.php?page=lp-toggle-hard-cache-option',
			data: { v: this.checked ? 'yes' : 'no' },
			success( response ) {
			},
			error() {
			},
		} );
	};

	$( function() {
		getStepsUpgradeStatus();
		createIndexes();
		reUpgradeDB();
		cleanDatabases();
		$doc.on( 'click', '#learn-press-clear-cache', clearHardCache )
			.on( 'click', 'input[name="enable_hard_cache"]', toggleHardCache );
	} );
}( jQuery ) );

```
