M_Membershiprepair

Addon Name: Membership Verify and Repair Description: Checks and repairs the membership plugins tables Author: Barry (Incsub) Author URI: http://caffeinatedb.com.

Defined (1)

The class is defined in the following location(s).

/app_old/membershipincludes/addons/repairmembership.php  
  1. class M_Membershiprepair { 
  2.  
  3. function __construct() { 
  4. // Add advanced tab 
  5. add_filter('membership_options_menus', array(&$this, 'add_advanced_option')); 
  6. // Add advanced content 
  7. add_action('membership_option_menu_advanced', array(&$this, 'handle_repair_panel')); 
  8.  
  9. function add_advanced_option( $menus ) { 
  10.  
  11. $menus['advanced'] = __('Advanced', 'membership'); 
  12.  
  13. return $menus; 
  14.  
  15. function add_menu() { 
  16. add_submenu_page('membership', __('Membership Repair', 'membership'), __('Repair Membership', 'membership'), 'membershipadminoptions', "membershiprepair", array(&$this, 'handle_repair_panel')); 
  17.  
  18. // Database repair functions 
  19. function handle_repair_panel() { 
  20. global $action, $page, $M_options; 
  21.  
  22. wp_reset_vars( array('action', 'page') ); 
  23.  
  24. ?> 
  25. <div class='wrap nosubsub'> 
  26. <div class="icon32" id="icon-tools"><br></div> 
  27. <h2><?php _e('Repair Membership', 'membership'); ?></h2> 
  28.  
  29. <?php 
  30. if ( isset($_GET['msg']) ) { 
  31. echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>'; 
  32. $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); 
  33. ?> 
  34.  
  35. <p><?php _e('If you are having problems with your membership site, or have recently upgraded and are seeing strange behaviour then try the membership check below to see if there are any issues with your table structure. Click on the repair button if you want to repair any issues found (back up your database first).', 'membership'); ?></p> 
  36. <p> 
  37. <?php echo "<a href='" . wp_nonce_url("?page=" . $page. "&tab=advanced&verify=yes", 'verify-membership') . "' class='button'>" . __('Verify Membership Tables', 'membership') . "</a>  "; ?> 
  38. <?php echo "<a href='" . wp_nonce_url("?page=" . $page. "&tab=advanced&repair=yes", 'repair-membership') . "' class='button'>" . __('Repair Membership Tables', 'membership') . "</a>"; ?> 
  39. </p> 
  40.  
  41. <?php 
  42. if(isset($_GET['verify'])) { 
  43. check_admin_referer('verify-membership'); 
  44. include_once(membership_dir('membershipincludes/classes/upgrade.php') ); 
  45.  
  46. ?> 
  47. <p><strong><?php _e('Verifying', 'membership'); ?></strong></p> 
  48. <?php 
  49.  
  50. M_verify_tables(); 
  51.  
  52. if(isset($_GET['repair'])) { 
  53. check_admin_referer('repair-membership'); 
  54. include_once(membership_dir('membershipincludes/classes/upgrade.php') ); 
  55.  
  56. ?> 
  57. <p><strong><?php _e('Verifying and Repairing', 'membership'); ?></strong></p> 
  58. <?php 
  59.  
  60. M_repair_tables(); 
  61.  
  62. ?> 
  63. </div> <!-- wrap --> 
  64. <?php 
  65.