-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathuninstall.php
46 lines (40 loc) · 1.48 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
<?php
/**
* Fired only when the DCL is uninstalled 😞.
*
* Removes everything that DCL added to your db.
* Please note that we are not deleting Disqus core settings from database.
* The reason why we are not deleting Disqus settings is, on their official
* plugin they are keeping settings in db even after the plugin removal.
*
*
* @category Core
* @package DCL
* @subpackage Uninstall
* @author Joel James <mail@cjoel.com>
* @license http://www.gnu.org/licenses/ GNU General Public License
* @link https://dclwp.com
*/
// If uninstall not called from WordPress, kill.
defined( 'ABSPATH' ) || die( 'K. Bye.' );
// Do not clear setting if Pro version is already active.
if ( ! is_plugin_active( 'disqus-conditional-load-pro/disqus-conditional-load-pro.php' ) ) {
// Attempts to uninstall Disqus official plugin settings.
// @todo Check if official plugin is installed independently.
if ( ! is_plugin_active( 'disqus-comment-system/disqus.php' )
&& file_exists( trailingslashit( dirname( $file ) ) . 'vendor/disqus-comment-system/uninstall.php' )
) {
require_once trailingslashit( dirname( $file ) ) . 'vendor/disqus-comment-system/uninstall.php';
}
// Options registered by DCL.
$dcl_options = array(
'dcl_gnrl_options',
'dcl_do_activation_redirect',
'dcl_version_no',
);
// Loop through each options.
foreach ( $dcl_options as $option ) {
delete_option( $option );
}
}
/******* What if I told you, this is the end of Disqus Conditional Load ********/