[ Index ]

MailPress 544

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/ -> uninstall.php (source)

   1  <?php
   2  
   3  if (!defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN')) die();
   4  
   5  class MP_uninstall
   6  {
   7  	function __construct()
   8      {
   9          global $wpdb;
  10  
  11          $wpdb->mp_mails     = $wpdb->prefix . 'mailpress_mails';
  12          $wpdb->mp_mailmeta  = $wpdb->prefix . 'mailpress_mailmeta';
  13          $wpdb->mp_users     = $wpdb->prefix . 'mailpress_users';
  14          $wpdb->mp_usermeta  = $wpdb->prefix . 'mailpress_usermeta';
  15          $wpdb->mp_stats     = $wpdb->prefix . 'mailpress_stats';
  16          $wpdb->mp_tracks       = $wpdb->prefix . 'mailpress_tracks';
  17          $wpdb->mp_forms        = $wpdb->prefix . 'mailpress_forms';
  18          $wpdb->mp_fields    = $wpdb->prefix . 'mailpress_formfields';
  19  
  20  // taxonomies
  21          $taxonomies = array('MailPress_mailing_list', 'MailPress_autoresponder');
  22          foreach($taxonomies as $taxonomy)
  23          {
  24              $queries[] = "DELETE FROM $wpdb->terms              WHERE term_id IN (SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy');";
  25              $queries[] = "DELETE FROM $wpdb->term_relationships WHERE term_id IN (SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy');";
  26              $queries[] = "DELETE FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy';";
  27          }
  28  // postmeta
  29          $queries[] = "DELETE FROM $wpdb->postmeta WHERE meta_key like '%_MailPress%';";        
  30          $queries[] = "DELETE FROM $wpdb->postmeta WHERE meta_key like '%_mailpress%';";
  31  // usermeta
  32          $queries[] = "DELETE FROM $wpdb->usermeta WHERE meta_key like '%_MailPress%';";        
  33          $queries[] = "DELETE FROM $wpdb->usermeta WHERE meta_key like '%_mailpress%';";
  34  // options
  35          $queries[] = "DELETE FROM $wpdb->options WHERE option_name like '%MailPress%';";        
  36          $queries[] = "DELETE FROM $wpdb->options WHERE option_name like '%mailpress%';";
  37  // mailpress tables
  38          $queries[] = "DROP TABLE $wpdb->mp_stats;";
  39          $queries[] = "DROP TABLE $wpdb->mp_mails;";
  40          $queries[] = "DROP TABLE $wpdb->mp_mailmeta;";        
  41          $queries[] = "DROP TABLE $wpdb->mp_users;";        
  42          $queries[] = "DROP TABLE $wpdb->mp_usermeta;";
  43          $queries[] = "DROP TABLE $wpdb->mp_tracks;";    
  44          $queries[] = "DROP TABLE $wpdb->mp_forms;";    
  45          $queries[] = "DROP TABLE $wpdb->mp_fields;";    
  46  
  47          foreach($queries as $query) $wpdb->query($query);
  48      }
  49  }
  50  new MP_uninstall(); 


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1