Using a single Cloudflare account in Wordpress with WP Super Cache with visible API key Using a single Cloudflare account in Wordpress with WP Super Cache with visible API key wordpress wordpress

Using a single Cloudflare account in Wordpress with WP Super Cache with visible API key


you have to use tokens instead of global api key. you strict token to certain zone only

enter image description here

This only will NOT solve the problem, you have to manually modify wp fastest cache plugin to modify the request to match API tokens usage.the requests can be found in inc\cdn.php

The modified file:https://gist.github.com/ahmed-abdelazim/7c8170f7fc4e821c6b015d770fcbf14a

so

                $header = array("method" => "DELETE",                                'headers' => array(                                                "X-Auth-Email" => $email,                                                "X-Auth-Key" => $key,                                                "Content-Type" => "application/json"                                                ),                                "body" => '{"purge_everything":true}'                                );

is converted to

                $header = array("method" => "DELETE",                                'headers' => array(                                                //"X-Auth-Email" => $email,                                                "Authorization" => "Bearer ".$key,                                                "Content-Type" => "application/json"                                                ),                                "body" => '{"purge_everything":true}'                                );

and this occured five times in the plugin in the cdn.php file


simply creating API Token worked for me. There are some pre made template. There was for wordpress one as well. Just selected and created and added it to wp fastest cache and that worked.