PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 4.1.16
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v4.1.16
4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 1.9.3 1.9.4 1.9.5 1.9.6 All 170 releases
← All changes | admin/save-settings.php +46 -6 4.0.304.1.16 View file →
@@ -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", [
@@ -460,8 +456,52 @@
460 456 update_option('berqwp_disable_emojis', 1);
461 457 } else {
462 458 update_option('berqwp_disable_emojis', 0);
463 459 }
460 +
461 + if (isset($_POST['berqwp_heartbeat_mode'])) {
462 + $heartbeat_mode = sanitize_text_field($_POST['berqwp_heartbeat_mode']);
463 + if (!in_array($heartbeat_mode, ['default', 'restrict', 'throttle', 'disable'], true)) {
464 + $heartbeat_mode = 'default';
465 + }
466 + update_option('berqwp_heartbeat_mode', $heartbeat_mode);
467 + }
468 +
469 + if (isset($_POST['berqwp_heartbeat_interval'])) {
470 + $heartbeat_interval = max(15, min(300, (int) sanitize_text_field($_POST['berqwp_heartbeat_interval'])));
471 + update_option('berqwp_heartbeat_interval', $heartbeat_interval);
472 + }
473 +
474 + foreach ([
475 + 'berqwp_disable_embeds',
476 + 'berqwp_disable_xmlrpc',
477 + 'berqwp_remove_rest_head_links',
478 + 'berqwp_remove_head_meta',
479 + 'berqwp_disable_self_pingbacks',
480 + ] as $bwp_debloat_option) {
481 + update_option($bwp_debloat_option, isset($_POST[$bwp_debloat_option]) ? 1 : 0);
482 + }
483 +
484 + if (isset($_POST['berqwp_db_schedule_frequency'])) {
485 + $db_schedule_frequency = sanitize_text_field($_POST['berqwp_db_schedule_frequency']);
486 + if (!in_array($db_schedule_frequency, ['daily', 'weekly', 'monthly'], true)) {
487 + $db_schedule_frequency = 'weekly';
488 + }
489 + update_option('berqwp_db_schedule_frequency', $db_schedule_frequency);
490 + }
491 +
492 + if (isset($_POST['berqwp_db_revision_limit'])) {
493 + update_option('berqwp_db_revision_limit', max(0, (int) sanitize_text_field($_POST['berqwp_db_revision_limit'])));
494 + }
495 +
496 + $_POST['berqwp_db_scheduled_tasks'] = $_POST['berqwp_db_scheduled_tasks'] ?? [];
497 + if (is_array($_POST['berqwp_db_scheduled_tasks'])) {
498 + update_option('berqwp_db_scheduled_tasks', array_map('sanitize_text_field', wp_unslash($_POST['berqwp_db_scheduled_tasks'])));
499 + }
500 +
501 + update_option('berqwp_db_schedule_enabled', isset($_POST['berqwp_db_schedule_enabled']) ? 1 : 0);
502 +
503 + do_action('berqwp_reschedule_db_cron');
464 504
465 505 // If the option is changed require flush cache
466 506 if (bwp_is_option_updated('berqwp_lazyload_youtube_embed')) {
467 507 $berq_log->info('Updated berqwp_lazyload_youtube_embed');