/** * Attempt to migrate registration to a new domain when the sites domain changes. * * @since 2.1.0 * @global $swp_user_options * @return void */ function swp_migrate_registration() { global $swp_user_options; $options = $swp_user_options; // Bail if we don't have the data we need to continue. if (empty($options['premiumCode']) || empty($options['emailAddress'])) { return; } $url = swp_get_site_url(); $email = $options['emailAddress']; $code = $options['premiumCode']; // Unregister and re-register if our current key doesn't match the database. if (swp_get_registration_key($url, 'db') !== $code) { swp_unregister_plugin($email, $code); swp_register_plugin($email, $url); } }
</p> </div> <div class="sw-grid sw-col-300"> <input name="emailAddress" type="text" class="sw-admin-input" placeholder="*****@*****.**" value="<?php echo $email; ?> " /> </div> <input name="premiumCode" type="text" class="sw-admin-input sw-hidden" value="<?php echo $premium_code; ?> " /> <input name="regCode" type="text" class="sw-admin-input sw-hidden" value="<?php echo swp_get_registration_key(swp_get_site_url()); ?> " /> <div class="sw-grid sw-col-300 sw-fit"></div> <div class="sw-clearfix"></div> <div class="sw-grid sw-col-300"> <p class="sw-authenticate-label"> <?php esc_html_e('Activate Registration', 'social-warfare'); ?> </p> </div> <div class="sw-grid sw-col-300">