예제 #1
0
if (isset($_POST["mm_selected_currency"])) {
    //update default currency
    if (in_array($_POST['mm_selected_currency'], array_keys(MM_CurrencyUtil::getSupportedCurrencies()))) {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CURRENCY, $_POST["mm_selected_currency"]);
    }
    if (isset($_POST["mm_postfix_iso_to_currency"]) && $_POST["mm_postfix_iso_to_currency"] == "1") {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CURRENCY_FORMAT_POSTFIX_ISO, true);
    } else {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CURRENCY_FORMAT_POSTFIX_ISO, false);
    }
}
$currentCurrency = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_CURRENCY);
$postfixIsoToCurrency = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_CURRENCY_FORMAT_POSTFIX_ISO);
$postfixIsoToCurrency = empty($postfixIsoToCurrency) ? false : $postfixIsoToCurrency;
//check the support of the active payment services for the currently selected currency
$activePaymentServices = MM_PaymentServiceFactory::getAvailablePaymentServices();
$unsupportedPaymentServices = array();
foreach ($activePaymentServices as $aps) {
    if (!$aps->isSupportedCurrency($currentCurrency)) {
        $unsupportedPaymentServices[] = $aps->getName();
    }
}
$warningMsg = "";
$warningBox = "";
$numUnsupported = count($unsupportedPaymentServices);
if ($numUnsupported > 0) {
    $lastService = "";
    if ($numUnsupported > 1) {
        $lastService = array_pop($unsupportedPaymentServices);
        $lastService = " and {$lastService}";
    }
예제 #2
0
 private function insertMMDefaultData()
 {
     global $wpdb, $current_user;
     // insert default option values
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ACCT_SECURITY_ENABLED, MM_OptionUtils::$DEFAULT_ACCT_SECURITY_ENABLED);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ACCT_SECURITY_MAX_IPS, MM_OptionUtils::$DEFAULT_ACCT_SECURITY_MAX_IPS);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ON_LOGIN_USE_WP_FRONTPAGE, MM_OptionUtils::$DEFAULT_ON_LOGIN_USE_WP_FRONTPAGE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_AFTER_LOGIN_USE_WP_FRONTPAGE, MM_OptionUtils::$DEFAULT_AFTER_LOGIN_USE_WP_FRONTPAGE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_SHOW_LOGIN_LOGOUT_LINK, MM_OptionUtils::$DEFAULT_SHOW_LOGIN_LOGOUT_LINK);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_HIDE_PROTECTED_MENU_ITEMS, MM_OptionUtils::$DEFAULT_HIDE_PROTECTED_MENU_ITEMS);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_LOGIN_PAGE, MM_OptionUtils::$DEFAULT_USE_MM_LOGIN_PAGE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_RESET_PASSWORD_PAGE, MM_OptionUtils::$DEFAULT_USE_MM_RESET_PASSWORD_PAGE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_COUNTRY_SELECTIONS, MM_OptionUtils::$DEFAULT_COUNTRY_SELECTIONS);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_SUBJECT, MM_OptionUtils::$DEFAULT_FORGOT_PASSWORD_SUBJECT);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_BODY, MM_OptionUtils::$DEFAULT_FORGOT_PASSWORD_BODY);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_AFFILIATE, MM_OptionUtils::$DEFAULT_AFFILIATE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_SUB_AFFILIATE, MM_OptionUtils::$DEFAULT_SUB_AFFILIATE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_AFFILIATE_LIFESPAN, MM_OptionUtils::$DEFAULT_AFFILIATE_LIFESPAN);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_LOGIN_TOKEN_LIFESPAN, MM_OptionUtils::$DEFAULT_LOGIN_TOKEN_LIFESPAN);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_CHECKOUT_FORM_TEST_DATA, MM_OptionUtils::$DEFAULT_USE_CHECKOUT_FORM_TEST_DATA);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_WIDTH, MM_OptionUtils::$DEFAULT_PURCHASE_CONFIRMATION_DIALOG_WIDTH);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_HEIGHT, MM_OptionUtils::$DEFAULT_PURCHASE_CONFIRMATION_DIALOG_HEIGHT);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_DEFAULT_CHECKOUT_ITEM_TYPE, MM_OptionUtils::$DEFAULT_CHECKOUT_ITEM_TYPE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_DEFAULT_CHECKOUT_ITEM_ID, MM_OptionUtils::$DEFAULT_CHECKOUT_ITEM_ID);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_SHOW_PREVIEW_BAR, MM_OptionUtils::$DEFAULT_SHOW_PREVIEW_BAR);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_HIDE_ADMIN_BAR, MM_OptionUtils::$DEFAULT_HIDE_ADMIN_BAR);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ENABLE_WP_AUTOP, MM_OptionUtils::$DEFAULT_ENABLE_WP_AUTOP);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ENABLE_USERNAME_CHANGE, MM_OptionUtils::$DEFAULT_ENABLE_USERNAME_CHANGE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ALLOW_LOGGED_OUT_PURCHASES, MM_OptionUtils::$DEFAULT_ALLOW_LOGGED_OUT_PURCHASES);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ALLOW_DUPLICATE_SUBSCRIPTIONS, MM_OptionUtils::$DEFAULT_ALLOW_DUPLICATE_SUBSCRIPTIONS);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_CHECKOUT_PAID_MESSAGE, MM_OptionUtils::$DEFAULT_CHECKOUT_PAID_MESSAGE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_CHECKOUT_FREE_MESSAGE, MM_OptionUtils::$DEFAULT_CHECKOUT_FREE_MESSAGE);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_CHECKOUT_MESSAGE_CSS, MM_OptionUtils::$DEFAULT_CHECKOUT_MESSAGE_CSS);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_CURRENCY, MM_OptionUtils::$DEFAULT_CURRENCY);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_JQUERY_UI, MM_OptionUtils::$DEFAULT_USE_JQUERY_UI);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ALLOW_OVERDUE_ACCESS, MM_OptionUtils::$DEFAULT_ALLOW_OVERDUE_ACCESS);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_CAPTCHA_ENABLED, MM_OptionUtils::$DEFAULT_CAPTCHA_ENABLED);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_RESET_PASSWORD, MM_OptionUtils::$DEFAULT_USE_MM_CSS);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_DIAGNOSTIC_MODE, MM_DiagnosticLog::$MODE_OFF);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_FORCE_USE_DB_CACHE, 0);
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_CURRENCY_FORMAT_POSTFIX_ISO, 'false');
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_AFFILIATE_ALIAS, "");
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_SUB_AFFILIATE_ALIAS, "");
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_AFFILIATE_LIFESPAN, "");
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_SITE_IN_TEST_MODE, "0");
     //0 for false, 1 for true
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_CAPTCHA_KEY, "");
     MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_CAPTCHA_PRIVATE_KEY, "");
     // options that vary based on if this is an upgrade versus a new install
     $lastMajorVersion = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_MAJOR_VERSION);
     if (empty($lastMajorVersion)) {
         // set options for new installs
         // for 2.0.7 release
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_DISABLE_EXPLICIT_LINKS, MM_OptionUtils::$DEFAULT_DISABLE_EXPLICIT_LINKS);
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_PURCHASE_LINK_STYLE, MM_OptionUtils::$DEFAULT_PURCHASE_LINK_STYLE);
         // for 2.0.8 release
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_SMARTTAG_VERSION, MM_OptionUtils::$DEFAULT_SMARTTAG_VERSION);
         // for 2.0.9 release
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ACTIVITY_LOG_CLEANUP_ENABLED, MM_OptionUtils::$DEFAULT_ACTIVITY_LOG_CLEANUP_ENABLED);
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ACTIVITY_LOG_CLEANUP_INTERVAL, MM_OptionUtils::$DEFAULT_ACTIVITY_LOG_CLEANUP_INTERVAL);
         // for 2.1.2 release
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_CHECKOUT, MM_OptionUtils::$DEFAULT_USE_MM_CSS);
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_MY_ACCOUNT, MM_OptionUtils::$DEFAULT_USE_MM_CSS);
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_LOGIN, MM_OptionUtils::$DEFAULT_USE_MM_CSS);
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_FORGOT_PASSWORD, MM_OptionUtils::$DEFAULT_USE_MM_CSS);
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ENABLE_MEMBERSHIP_PRORATION, MM_OptionUtils::$DEFAULT_ENABLE_MEMBERSHIP_PRORATION);
     } else {
         // set options for existing installs
         // for 2.0.7 release
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_DISABLE_EXPLICIT_LINKS, "0");
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_PURCHASE_LINK_STYLE, MM_LINK_STYLE_EXPLICIT);
         // for 2.0.8 release
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_SMARTTAG_VERSION, "2.0");
         // for 2.0.9 release
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ACTIVITY_LOG_CLEANUP_ENABLED, "0");
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ACTIVITY_LOG_CLEANUP_INTERVAL, "");
         // for 2.1.2 release
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_CHECKOUT, "0");
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_MY_ACCOUNT, "0");
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_LOGIN, "0");
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_FORGOT_PASSWORD, "0");
         MM_OptionUtils::setDefaultValue(MM_OptionUtils::$OPTION_KEY_ENABLE_MEMBERSHIP_PRORATION, "0");
     }
     MM_Role::addRoles();
     // create default employee account if one doesn't exist, using the current user
     $install_sql = "select * from " . MM_TABLE_EMPLOYEE_ACCOUNTS . " where is_default='1' LIMIT 1;";
     $row = $wpdb->get_row($install_sql);
     if ($row == null) {
         //the current user isn't an employee
         $install_sql = "insert into " . MM_TABLE_EMPLOYEE_ACCOUNTS . " set display_name='%s', email='%s', is_default='%d', role_id='%s', user_id='%d'";
         $displayName = !empty($current_user->display_name) ? $current_user->display_name : "Support";
         $wpdb->query($wpdb->prepare($install_sql, $displayName, $current_user->user_email, 1, MM_Role::$ROLE_ADMINISTRATOR, $current_user->ID));
         $emailId = $wpdb->insert_id;
     } else {
         $emailId = $row->id;
     }
     // install default overdue payment notification email
     $crntValue = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_OVERDUE_PAYMENT_NOTIFICATION_INSTALLED);
     if ($crntValue === false || $crntValue === "") {
         $action = new MM_Action();
         $action->setEventType(MM_Event::$MEMBER_STATUS_CHANGE);
         $action->setActionType(MM_Action::$MM_ACTION_SEND_EMAIL);
         $emailToId = MM_Action::$CURRENT_MEMBER_PLACEHOLDER;
         $emailFromId = $emailId;
         $emailCC = "";
         $emailSubject = MM_OptionUtils::$DEFAULT_OVERDUE_PAYMENT_SUBJECT;
         $emailBody = MM_OptionUtils::$DEFAULT_OVERDUE_PAYMENT_BODY;
         $action->setActionValue(MM_Action::prepareSendEmailValue($emailToId, $emailFromId, $emailCC, $emailSubject, $emailBody));
         // set attributes
         $attributes = array();
         $attributes["status_id"] = MM_Status::$OVERDUE;
         $action->setEventAttributes($attributes);
         $result = $action->commitData();
         if (MM_Response::isSuccess($result)) {
             MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_OVERDUE_PAYMENT_NOTIFICATION_INSTALLED, "1");
         }
     }
     // create default membership level
     if (!$this->hasRecords(MM_TABLE_MEMBERSHIP_LEVELS, 'is_default', '1')) {
         $install_sql = "INSERT INTO " . MM_TABLE_MEMBERSHIP_LEVELS . " SET " . "\tname = 'Free Membership'," . "\tis_free='1'," . "\tis_default='1'," . "\tstatus='1'," . "\tdescription='Default Free Membership'," . "\temail_subject='%s'," . "\temail_body='%s'," . "\temail_from_id='%d'" . "";
         $wpdb->query($wpdb->prepare($install_sql, MM_MembershipLevel::$DFLT_EMAIL_SUBJECT, MM_MembershipLevel::$DFLT_EMAIL_BODY, $emailId));
     }
     // create default commission profile
     if (!$this->hasRecords(MM_TABLE_COMMISSION_PROFILES, 'is_default', '1')) {
         $install_sql = "INSERT INTO " . MM_TABLE_COMMISSION_PROFILES . " SET " . "\tname = 'Standard Commission Profile'," . "\tis_default='1'," . "\tdescription='This is the default commission profile'," . "\tinitial_commission_enabled='1'," . "\trebill_commissions_enabled='0'," . "\trebill_commission_type='default'," . "\trebill_commission_value='0'," . "\tdo_limit_rebill_commissions='0'," . "\trebill_commission_limit='0', " . "\tdo_reverse_commissions='1'" . "";
         $wpdb->query($install_sql);
     }
     // make sure active payment services are updated
     if (class_exists('MM_PaymentServiceFactory') && class_exists('MM_PaymentService')) {
         $services = MM_PaymentServiceFactory::getAvailablePaymentServices();
         foreach ($services as $service) {
             if ($service instanceof MM_PaymentService) {
                 $service->install();
             }
         }
     }
     //add smart tags
     $this->addSmartTags();
     $sql = "select count(*) as total from " . MM_TABLE_API_KEYS;
     $row = $wpdb->get_row($sql);
     if ($row->total <= 0) {
         $sql = "insert into " . MM_TABLE_API_KEYS . " set " . "name='Default Access', " . "api_key='" . MM_Utils::createRandomString(10) . "',\t" . "api_secret='" . MM_Utils::createRandomString(10) . "', " . "status='1'";
         $wpdb->query($sql);
     }
     $sql = array();
     require_once MM_PLUGIN_ABSPATH . "/data/countries.sql.php";
     $numCountries = count($sql);
     $countryCheckSql = "select count(*) as total from " . MM_TABLE_COUNTRIES;
     $row = $wpdb->get_row($countryCheckSql);
     if ($row->total < $numCountries) {
         foreach ($sql as $query) {
             if ($wpdb->query($query) === false) {
                 return false;
             }
         }
     }
     unset($sql);
     $sql = array();
     require_once MM_PLUGIN_ABSPATH . "/data/country_subdivisions.sql.php";
     $numCountrySubdivisions = count($sql);
     $countrySubdivisionCheckSql = "select count(*) as total from " . MM_TABLE_COUNTRY_SUBDIVISIONS;
     $row = $wpdb->get_row($countrySubdivisionCheckSql);
     if ($row->total < $numCountrySubdivisions) {
         foreach ($sql as $query) {
             if ($wpdb->query($query) === false) {
                 return false;
             }
         }
     }
     unset($sql);
     $result = $this->setupCorePages();
     if (!$result) {
         return false;
     }
     $cacheWriteable = @MM_Utils::cacheIsWriteable();
     $sql = array();
     //TODO TRANSIENT: in version 2.0.1 renamed WordPress Mail to None. Once all customers have been upgraded to None then this
     // if statement can be removed
     if ($this->hasRecords(MM_TABLE_EMAIL_SERVICE_PROVIDERS, 'provider_token', 'default')) {
         $sql[] = "UPDATE " . MM_TABLE_EMAIL_SERVICE_PROVIDERS . " SET provider_name='None' WHERE provider_token='default';";
     } else {
         $sql[] = "INSERT IGNORE INTO " . MM_TABLE_EMAIL_SERVICE_PROVIDERS . " SET provider_name='None', provider_token='default', active='1';";
     }
     //email service providers
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_EMAIL_SERVICE_PROVIDERS . " SET provider_name='MailChimp', provider_token='mailchimp', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_EMAIL_SERVICE_PROVIDERS . " SET provider_name='iContact', provider_token='icontact', api_key='" . MM_IContactEmailServiceProvider::$API_KEY . "'";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_EMAIL_SERVICE_PROVIDERS . " SET provider_name='AWeber', provider_token='aweber', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_EMAIL_SERVICE_PROVIDERS . " SET provider_name='GetResponse', provider_token='getresponse', active='0';";
     //affiliate providers
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_AFFILIATE_PROVIDERS . " SET provider_name='None', provider_token='default', active='1';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_AFFILIATE_PROVIDERS . " SET provider_name='iDevAffiliate', provider_token='idevaffiliate';";
     //payment services
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='PAYPAL', name='PayPal', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='AUTHORIZENET', name='Authorize.net', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='AUTHORIZENETCIM', name='Authorize.net CIM', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='BRAINTREE', name='Braintree', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='CHARGIFY', name='Chargify', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='LIMELIGHT', name='Lime Light', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='STRIPE', name='Stripe', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='TWOCHECKOUT', name='2Checkout', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='CLICKBANK', name='ClickBank', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='LITLE', name='Litle', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='COINBASE', name='Coinbase (Wallet Required)', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='COINBASEMINIMAL', name='Coinbase (Wallet Ignored)', settings='', active='0';";
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_PAYMENT_SERVICES . " SET token='TEST', name='Test Payment Service', settings='', active='0';";
     //shipping methods
     $sql[] = "INSERT IGNORE INTO " . MM_TABLE_SHIPPING_METHODS . " SET token='FLATRATE', name='Flat Rate', settings='', active='1';";
     //active by default
     foreach ($sql as $query) {
         $wpdb->query($query);
     }
     unset($sql);
     //apply any updates that may have been made to the schemas of the active payment services
     $activePaymentServices = MM_PaymentServiceFactory::getAvailablePaymentServices();
     foreach ($activePaymentServices as $ps) {
         $ps->install();
     }
     // Need to search and replace and remnance of [MM_Member_Data name='password'] in
     // Forgot Password email with the new Reset Password Core Page Link Smart Tag
     $pattern = "\\[mm_member_data name=(['|\"]{1})password(['|\"]{1})\\]";
     $forgotPasswordBody = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_BODY);
     $forgotPasswordBody = preg_replace("/{$pattern}/i", "<a href=\"[MM_CorePage_Link type='resetpassword']\">click here to reset your password</a>", $forgotPasswordBody);
     MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_BODY, $forgotPasswordBody);
     return true;
 }