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 | api/webhook.php +5 -5 4.0.214.1.16 View file →
@@ -39,9 +39,9 @@
39 39 $license_key = berqwp_get_license_key();
40 40 global $berq_log;
41 41
42 42 if (empty($license_key_hash) || empty($license_key) || $license_key_hash !== md5($license_key)) {
43 - echo json_encode(['status' => 'error', 'msg' => 'Request authentication failed']);
43 + echo wp_json_encode(['status' => 'error', 'msg' => 'Request authentication failed']);
44 44 http_response_code(403);
45 45 exit;
46 46 }
47 47
@@ -47,15 +47,15 @@
47 47
48 48 if ($status == 'success' && !empty($page_url) && $event == 'store_cache') {
49 49
50 50 if (!bwp_can_optimize_page_url($page_url)) {
51 - echo json_encode(['status' => 'error', 'msg' => 'Invalid page url.']);
51 + echo wp_json_encode(['status' => 'error', 'msg' => 'Invalid page url.']);
52 52 exit;
53 53 }
54 54
55 55 if (empty($html_url)) {
56 56 $berq_log->info("Empty html url: $page_url");
57 - echo json_encode(['status' => 'error', 'msg' => 'Empty html url']);
57 + echo wp_json_encode(['status' => 'error', 'msg' => 'Empty html url']);
58 58 exit;
59 59 }
60 60
61 61 // Download the HTML
@@ -64,9 +64,9 @@
64 64
65 65 // Check for errors
66 66 if (is_wp_error($response) || $response_code !== 200) {
67 67 $berq_log->info("Failed to download cache: $page_url");
68 - echo json_encode(['status' => 'error', 'msg' => "Could not download html cache, $html_url"]);
68 + echo wp_json_encode(['status' => 'error', 'msg' => "Could not download html cache, $html_url"]);
69 69 exit;
70 70 }
71 71
72 72 $html = wp_remote_retrieve_body($response);
@@ -87,8 +87,8 @@
87 87 if ($check_connection['status'] == 'error') {
88 88 delete_transient('berqwp_connection_status');
89 89 }
90 90
91 - echo json_encode(['status' => 'success']);
91 + echo wp_json_encode(['status' => 'success']);
92 92 exit;
93 93 }
94 94 }