Last updated on July 29, 2018
The solution to the conflict between the invalid WP Postviews count and WP Super Cache: because the WP theme used by this site is too large, the number of plug-ins is increasing day by day, which directly leads to the gradual decline of website access speed. In order to reduce the server load and speed up the website response, I chose to install the cache plug-in WP Super Cache. Mm-hmm. After the installation, the login and refresh speed is good~
But the next day, I found a problem. The number of views of articles every day is not counted, and refreshing is useless. Naturally, I wonder if wp postviews conflicts with the Wp Super Cache plug-in just installed? Baidu has a look, and it really has this precedent. To sum up, there are four solutions to this problem:
Scheme I:
Since we need to record the access of each page, we just need to disable caching in logs and pages. Find the "Accepted Filenames&Rejected URIs" in the WP Super Cache background, and then click Single Posts and Pages to save according to the following settings.
In this way, the cache will not be enabled for log pages and independent pages, and the access can be recorded normally. The disadvantage is that these two pages can no longer accelerate the cache. Comments: This scheme is equivalent to abolishing the basic functions of the plug-in. So, the following
Scheme II:
① Disable the WP Super Cache plug-in in the background.
② Delete the wp super cache directory of the/wp content/plugins/directory.
③ Delete the cache directory under the wp content directory.
Don't forget the last and most important step!
Modify wp-config.php in the root directory and delete the following line:
define(’WP_CACHE’, true);
Well, now the articles can be counted again.
Comment: The plug-in has been removed. Of course, everything is back to normal. If they are not abolished, can they coexist harmoniously? See below
Scheme III:
Enter the plug-in wp postviews, open the file wp postviews. php, and find the code
if(defined(’WP_CACHE’) && WP_CACHE)
Replace with
if((defined(’WP_CACHE’) && WP_CACHE) || (defined(’COSMETA’) && COSMETA))
The test is valid. Note: This method is still valid for the secondary development of WP PostViews Plus.