summaryrefslogtreecommitdiff
blob: be20413cdd4ce0621d4342ebdd7fa934e4148ef6 (plain)
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
<?php

// If uninstall is not called from WordPress, exit
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
    exit();
}

require_once('core/config.php');
require_once('core/class-wmp.php');

$apiKey = WMobilePack_Options::get_setting('premium_api_key');
$isPremiumActive =  WMobilePack_Options::get_setting('premium_active');

if ($apiKey != '' && $isPremiumActive == 1) {

    // check if we have a https connection
    $is_secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443;

    WMobilePack::read_data( ($is_secure ? WMP_APPTICLES_DISCONNECT_SSL : WMP_APPTICLES_DISCONNECT).'?apiKey='.$apiKey);
}

// create uploads folder and define constants
if ( !defined( 'WMP_FILES_UPLOADS_DIR' ) && !defined( 'WMP_FILES_UPLOADS_URL' ) ){
    $WMP_Uploads = new WMobilePack_Uploads();
    $WMP_Uploads->define_uploads_dir();
}

// remove uploaded images and uploads folder
$WMP_Uploads = new WMobilePack_Uploads();
$WMP_Uploads->remove_uploads_dir();

// delete plugin settings
WMobilePack_Options::uninstall();