PluginProbe ʕ •ᴥ•ʔ
WP Fastest Cache – WordPress Cache Plugin / 1.0.7
WP Fastest Cache – WordPress Cache Plugin v1.0.7
1.4.9 1.4.8 trunk 0.8.6.6 0.8.6.7 0.8.6.8 0.8.6.9 0.8.7.0 0.8.7.1 0.8.7.2 0.8.7.3 0.8.7.4 0.8.7.5 0.8.7.6 0.8.7.7 0.8.7.8 0.8.7.9 0.8.8.0 0.8.8.1 0.8.8.2 0.8.8.3 0.8.8.4 0.8.8.5 0.8.8.6 0.8.8.7 0.8.8.8 0.8.8.9 0.8.9.0 0.8.9.1 0.8.9.2 0.8.9.3 0.8.9.4 0.8.9.5 0.8.9.6 0.8.9.7 0.8.9.8 0.8.9.9 0.9.0.0 0.9.0.1 0.9.0.2 0.9.0.3 0.9.0.4 0.9.0.5 0.9.0.6 0.9.0.7 0.9.0.8 0.9.0.9 0.9.1.0 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 0.9.1.5 0.9.1.6 0.9.1.7 0.9.1.8 0.9.1.9 0.9.2 0.9.3 0.9.4 0.9.5 0.9.6 0.9.7 0.9.8 0.9.9 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7
wp-fastest-cache / inc / clearing-specific-pages.php
wp-fastest-cache / inc Last commit date
admin-toolbar.php 5 years ago admin.php 3 years ago cache.php 3 years ago cdn.php 3 years ago clearing-specific-pages.php 3 years ago cli.php 3 years ago column.php 6 years ago css-utilities.php 3 years ago index.html 11 years ago js-utilities.php 3 years ago preload.php 3 years ago single-preload.php 3 years ago wp-polls.php 9 years ago
clearing-specific-pages.php
114 lines
1 <?php
2 class ClearingSpecificPagesWPFC{
3
4 public static function remove(){
5 if(!wp_verify_nonce($_POST["security"], 'wpfc-save-csp-ajax-nonce')){
6 die( 'Security check' );
7 }
8
9 $_POST["order"] = sanitize_text_field($_POST["order"]);
10
11 $urls = get_option("WpFastestCacheCSP");
12
13 if(!empty($urls)){
14 foreach ($urls as $key => $value) {
15 if($value->order == ($_POST["order"])){
16 unset($urls[$key]);
17 }
18 }
19 }
20
21 if(empty($urls)){
22 delete_option("WpFastestCacheCSP");
23 }else{
24 update_option("WpFastestCacheCSP", $urls, 1, "no");
25 }
26
27 wp_send_json_success();
28 }
29
30 public function check_url(){
31 $home_url = parse_url(get_option("home"), PHP_URL_HOST);
32 $specific_url = parse_url($_POST["url"], PHP_URL_HOST);
33
34 if($home_url == $specific_url){
35 return true;
36 }
37
38 return false;
39 }
40
41 public function check_wild_card(){
42 if(preg_match("/[^\/]\(\.\*\)/", $_POST["url"])){
43 return false;
44 }
45
46 if(substr_count($_POST["url"], "(.*)") > 1){
47 return false;
48 }
49
50 return true;
51 }
52
53 public static function save(){
54 if(!wp_verify_nonce($_POST["security"], 'wpfc-save-csp-ajax-nonce')){
55 die( 'Security check' );
56 }
57
58 if(!self::check_url()){
59 wp_send_json_error("The URL must start with ".parse_url(get_option("home"), PHP_URL_SCHEME)."//".parse_url(get_option("home"), PHP_URL_HOST));
60 }
61
62 if(!self::check_wild_card()){
63 wp_send_json_error("Wrong Wild Card Usage");
64 }
65
66 $_POST["url"] = sanitize_url($_POST["url"]);
67 $_POST["order"] = sanitize_text_field($_POST["order"]);
68
69 $urls = get_option("WpFastestCacheCSP");
70 $url = (object)array("url" => $_POST["url"], "order" => $_POST["order"]);
71
72 if(!is_array($urls)){
73 $urls = array();
74
75 array_push($urls, $url);
76
77 add_option("WpFastestCacheCSP", $urls, 1, "no");
78 }else{
79 $is_update = false;
80
81 foreach ($urls as $key => &$value) {
82 if($value->order == ($_POST["order"])){
83 $is_update = true;
84 $value->url = $_POST["url"];
85 }
86 }
87
88 if(!$is_update){
89 array_push($urls, $url);
90 }
91
92 update_option("WpFastestCacheCSP", $urls, 1, "no");
93 }
94
95 wp_send_json_success();
96 }
97
98 public static function get_list(){
99 if(!wp_verify_nonce($_POST["security"], 'wpfc-save-csp-ajax-nonce')){
100 die( 'Security check' );
101 }
102
103 $urls = get_option("WpFastestCacheCSP");
104
105 if(!is_array($urls)){
106 $urls = array();
107 }
108
109 wp_send_json_success($urls);
110
111 }
112
113 }
114 ?>