-
Notifications
You must be signed in to change notification settings - Fork 3
/
uninstall.php
executable file
·56 lines (47 loc) · 1.35 KB
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Fired when the plugin is uninstalled.
*
* @author WP-Translations Team
* @link http:wp-translations.org
* @since 1.0.0
*
* @package WPT_transifex_Updater
*/
defined( 'WP_UNINSTALL_PLUGIN' ) or die( 'Cheatin’ uh?' );
// Delete all user meta related to WPT transifex updater.
delete_metadata( 'user', '', 'wptxu_transifex_auth', '', true );
delete_metadata( 'user', '', 'wptxu_transifex_user', '', true );
// Delete all project meta related to WPT transifex updater.
delete_metadata( 'post', '', 'wptxu_mo_filename', '', true );
// Delete plugin transients.
delete_transient( 'wptxu_license_data' );
delete_transient( 'wptxu_license_error' );
// Delete plugin options.
delete_option( 'wptxu_license_key' );
delete_option( 'wptxu_license_status' );
/**
* Remove all mo files
*
* @param string $dir filename.
* @since 1.0.0
*/
function wptxu_rrmdir( $dir ) {
if ( ! is_dir( $dir ) ) {
// @codingStandardsIgnoreStart
unlink( $dir );
// @codingStandardsIgnoreEnd
return;
}
if ( $globs = glob( $dir . '/*', GLOB_NOSORT ) ) {
foreach ( $globs as $file ) {
// @codingStandardsIgnoreStart
is_dir( $file ) ? wptxu_rrmdir( $file ) : unlink( $file );
// @codingStandardsIgnoreEnd
}
}
// @codingStandardsIgnoreStart
rmdir( $dir );
// @codingStandardsIgnoreStart
}
wpt_customofile_rrmdir( WPTXU_CONTENT_PATH );