How to optimize 'select found_rows()' query? Several 'high load average' alerts daily

I have 5,000 regular posts, 6,000 posts in one post type and 2,000 posts in another post type. Needless to say, that has made the wp_posts table quite large. Not to mention, I have custom taxonomies set up to mimic the post types so for every Company A entered into Company post type, there is Company A, I manually entered Company A into Company taxonomy. That way, when I do a regular post about Company A, I can effectively tag …
Category: Web

How to disable cache for the content returned by a shortcode

we have wrote a shortcode that returns a different content based on a timestamp. The typical business case is: "Before the 1st of January, display "registrations will be open on the 1st of January" and after that date "register here"" Therefore, it is quite important that this piece of content does not get cached. Is there a way, from the shortcode code to indicate that this piece of content should not get cached (knowing that the cache mechanism is not …
Category: Web

Wordpress Template Reverts to default template after changing

I am experiencing a problem regarding wordpress page template. after I change the wordpress template to "Home Page", it reverts to default template after update. I tried installing WP Super Cache then purging cache, but still no luck. I also Increased memory limit in server but still reverts to default. are there any fix to this? your help is greatly appreciated.
Category: Web

How can I render shortcode so that its not cached by Caching plugins?

I am developing a plugin and I don't want the output of my shortcode to be cached by popular WordPress caching plugins like W3Ttoalcahe, WPSuperCache, etc. Is there any way I can achieve that or ask my users to configure their caching plugins so that my shortcodes are rendered dynamically and its output is not cached?
Category: Web

Changes not visible when not logged in

I have a wordpress site and 4 hours ago I have made some changes to the home page and an internal page. The changes I can see when I am logged in. When I try to log out, I only see the old pages and not the updated pages. I've tried everything: Total cleaning of the WP Super Cache Manual cache cleanup Disabling all cache of wordpress Browser cache cleaning None of these attempts worked. My version is 5.2.4. What …
Category: Web

Is this Solution for Caches vs Cookies Going to Get Me in Trouble?

I've come up with a provisional solution for a not exactly common, but far from unprecedented problem with the interaction of popular WP caching solutions with cookies, in this case the standard WP comment cookies. My solution also bears on the rarely well-defined "known users" exception to serving cached files. Whether it's usable or not, I figure that explaining it and possibly learning why it's a bad idea might be generally instructive. I've tested my method with WP Super Cache, …
Category: Web

How to cache a custom API call?

I build a little Python API and would like to cache the responses for 24-hrs. As I use it in a shortcode like [google keyword="example"] it will always do the API-call once I open the specific Wordpress site. I use the shortcode more than once, so the pagespeed is kinda slow. There is also a problem with too many requests on the API which I want to prevent by the caching Or is there another workaround? Is there an easy …
Category: Web

How to add support for caching plugins for my own plugin?

Is there a generic way to support caching plugins? For example to set a flag after you update an option that caching plugins watch? For example WP Super Cache has this: function wp_cache_clear_cache() { global $cache_path; prune_super_cache( $cache_path . 'supercache/', true ); prune_super_cache( $cache_path, true ); } But I will have to add custom code for each caching plugin out there. Is there a better way to do it? My plugin has some options and prints a shortcode based on …
Category: Web

Will memcached improve performance with WP Super Cache already running?

I'm working on a WordPress site that is expected to host up to 1000 concurrent users, so I'm exploring ways to make it run as fast as possible. I've heard that memcached helps WordPress sites load faster, but when I read what it does, it seems to have areas of overlap with WP Super Cache, especially if you use it in Expert Mode (where everything is cached in HTML and routed at the .htaccess level, so there are no database …
Category: Web

Update Custom post field by Ajax on cached site

My site cached by "wp-supper cache" plugin and "cloudflare.com" So my php function to count post views working incorrectly. I try to use ajax for it but I'm noob with JS code so I can not know where is wrong. In functions.php I create a simple function: add_action('template_redirect', 'ajax_activation'); function ajax_activation(){ //optional wp_enqueue_script( 'ajax_script', get_template_directory_uri() . '/js/ajax.js', // path to your js file for ajax operations array( 'jquery' ), false ); //end optional wp_localize_script( 'ajax_script', // the name of your …
Category: Web

Page downloads as file in Chrome

I'm looking to see if I could get pointers in where to look to solve this issue. Issue In Chrome, viewing the blog http://www.bitesizeirishgaelic.com/blog/ in Chrome v21, the page downloads as a file "download", rather than opening normally. The rest of the site on the same server loads fine in Chrome. All pages load fine in Firefox. Background I suspected that it was something to do with the APC caching for Apache, and/or WP Super Cache. However, after disabling both, …
Category: Web

How to get Caching Plug-ins to work on localhost with HTTPS?

Working on a localhost version of my https live site. Using the WP Super Cache plug-in. Trying to test it [Test Cache] with the feature with my live sites certificate I get the error Fetching http://localhost/mysite/ to prime cache: FAILED Errors: : cURL error 60: SSL certificate problem: unable to get local issuer certificate Trying it with a self-signed certificate OpenSSL and cacert.pem in a httpd-ssl.conf and php.ini modified localhost WAMP configuration I get the error: Fetching http://localhost/mysite/ to prime …
Category: Web

What is difference between 'Page Cache' and 'Object Cache' in WordPress?

I am optimizing my WordPress website. I am using 2 WordPress plugins right now. First one is 'Autoptimize' for optimizing CSS, JS, and HTML. And another one is 'WP Super Cache' for caching pages. While reading about WordPress optimization, I came across another term called 'Object Caching'. But I still can't figure out the difference between 'Page Cache' and 'Object Cache'. Can someone help me understand this? Is 'Object Cache' needed even if I am using 'Page Cache'?
Category: Web

How do I enable dynamic content in a theme cached with WP Super Cache?

I've been trying to improve my caching strategies in the themes I build, but I'm having trouble understanding how "Enable dynamic caching" works in WP Super Cache. There's very little information on this through searches, and what I have been able to find has been extremely technical, targeted towards one non-cached region, or otherwise not helpful. So far what I've been able to discern is that there are global, secret, tags that get replaced with the dynamic content when a …
Category: Web

Cron and WP Super Cache in Preload Mode

I disabled WordPress Cron and configured a real Cron (Linux Cron) to hit wp-cron.php every 8 hours, but I'm not sure how it affects the behavior of WP Super Cache in Preload Mode. As far as I know, WP Super Cache processes 100 posts, takes a break of 10 seconds, processes another 100 posts, takes a break of 10 seconds, and so on. Suppose a website has 10,000 posts. I'm pretty sure the initial 100 posts will be processed the …
Category: Web

Completely reload style.css

I have inherited a site, and I'm trying to add new styles to the style.css Things I have tried that have NOT worked Reload browser cache delete WP Super Cache cache Disabled WP Super Cache plugin completely add !important to my styles removed 'Version:' from css comment at the top of style.css edited style.css ditrectly from Appearance > Editor rather than push via ftp many combinations of all of these I notice in the web inspector that all styles are …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.