| @@ -12,9 +12,9 @@ | ||
| 12 | 12 | |
| 13 | 13 | $plugin_name = defined('BERQWP_PLUGIN_NAME') ? BERQWP_PLUGIN_NAME : 'BerqWP'; |
| 14 | 14 | |
| 15 | 15 | // if (!empty($_POST['berqwp_intro_page']) && !berqwp_is_license_managed_by_network()) { |
| 16 | - if (!berqwp_is_license_managed_by_network()) { | |
| 16 | + if (!berqwp_is_license_managed_by_network() && !empty($_POST['berqwp_optimization_method'])) { | |
| 17 | 17 | $optimization_method = sanitize_text_field($_POST['berqwp_optimization_method']); |
| 18 | 18 | |
| 19 | 19 | if ($optimization_method == 'local') { |
| 20 | 20 | $email = sanitize_email($_POST['berqwp_local_user_email']); |
| @@ -45,13 +45,9 @@ | ||
| 45 | 45 | $berqwp_configs = $berqconfigs->get_configs(); |
| 46 | 46 | $site_id = $berqwp_configs['site_id']; |
| 47 | 47 | |
| 48 | 48 | if (empty($site_id)) { |
| 49 | - $blog_id = get_current_blog_id(); | |
| 50 | - $network_id = function_exists('get_current_network_id') ? get_current_network_id() : 1; | |
| 51 | - $siteurl = get_option('siteurl'); | |
| 52 | - $site_id = md5("berqwp|$network_id|$blog_id|$siteurl"); | |
| 53 | - | |
| 49 | + $site_id = berqwp_generate_site_id(); | |
| 54 | 50 | $berqconfigs->update_configs(['site_id' => $site_id]); |
| 55 | 51 | } |
| 56 | 52 | |
| 57 | 53 | // $lic_response = wp_remote_post(BerqWP::$endpoint."authenticate", [ |