Questions tagged [performance]

Writing efficient code leads to better performance of a site, which is usually measured in the speed with which pages are served.

1
vote
1answer
1k views

Wordpress performance - W3 Total Cache and memcached/APCu

I have freshly installed Wordpress, Nginx with PHP-FPM, W3 Total Cache (plugin), memcached and APCu on PHP 5.5. I will run a benchmark on my local mac against the aforementioned AWS server using ...
1
vote
1answer
211 views

Does registering multiple shortcodes impact performance?

There are a range of plugins that register multiple shortcodes, sometimes up to 30. What are the performance implications of having multiple shortcodes registered? I would assume that having a huge ...
1
vote
1answer
535 views

One query to get posts and their taxonomy terms

I am building a map of posts and taxonomies to do some more intensive processing later on. Right now I am querying the posts with WP_Query and iterating over each one to get their taxonomy terms and ...
1
vote
1answer
255 views

Getting a PHP Notice when using Pods with WPML [closed]

I have Pods and WPML installed, and I have SitePress Multilingual CMS extension installed for WPML, and I have many custom post types which I've added using Pods. Recently when I was checking the ...
1
vote
2answers
379 views

I have over 4000 posts, will querying some of them cause performance issues?

I am wondering if querying posts like this: <?php $args = array('numberposts' => 19, 'orderby' => 'rand' ); $posts = get_posts( $args ); foreach($posts as $post) { $...
1
vote
1answer
2k views

Is there a real benefit in using wordpress optimized hosting?

I'm building a site for a client. This site often takes a long time to load initially, but is rather fast when loading the next page because of WP Super Cache plugin. But still, the majority of ...
1
vote
1answer
210 views

What is better to use, user meta, custom taxonomies or new database structure? [closed]

I am looking for some advice. I will be working on user follow system (like twitter) for my site. I expect it to have a large number of users using this system. So, I would like to know what is ...
1
vote
1answer
1k views

how to find and correct plugin query performance issues

I have recently uploaded a new site I've been working on for a while - which is working and performing very well on the localhost - there is no notable sluggishness to the load-times. Once uploaded ...
1
vote
2answers
906 views

Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?

There are a few plugins which can assist you in building your CPT's, and these can usually handle your taxonomies and sometimes postmeta also. Some even take it further than that. I know that as with ...
1
vote
1answer
1k views

Correct way to perform non-cacheable DB query

Consider the code function getNow() { global $wpdb; $now = $wpdb->get_var("SELECT NOW()"); $wpdb->flush(); return $now; } I am using the above method to avoid caching effect ...
1
vote
1answer
519 views

What's the best way to implement AJAX in WordPress?

WordPress has a framework in place for handling AJAX which is well documented here: http://codex.wordpress.org/AJAX_in_Plugins My concern with this is that every time you execute an AJAX query, (even ...
1
vote
1answer
1k views

Do WP_debug notices explain why my site runs so slow?

When I enable WP_DEBUG, I get lots of the following kinds of notices (see below). Of course, I normally don't have the debugging turned on, but I'm wondering if these are a clue as to why it takes so ...
1
vote
1answer
3k views

How to disable Vary cache header on W3Total Cache plugin [closed]

I've hired incapsula.com performance services for my wordpress blog, and one of their techs is telling me this about the performance of my website: On important note, yoursite.org returns the Vary ...
1
vote
1answer
949 views

Point static content like css and js to cookieless subdomain

How can I change the links that WordPress generates for all static content like css, js, png, jpg, gif, etc to a cookieless subdomain? I don't want to use mod_rewrite. I want the PHP code to replace ...
1
vote
1answer
194 views

Faster way to put images into a blog post by using Add Media dialog

One of the most time consuming things for me in blogging with Wordpress is adding images to the blog post. For each image, the user needs to click first "Add Media" button. Then, the user waits for ...
1
vote
1answer
229 views

Reasonable Size Limit to options entry

I have a set of ~4700 records that I need to have locally searchable for my plugin via an auto-complete (it's the Google Product Search categories). Would it be okay to store this data in the options ...
1
vote
2answers
257 views

upper limit on concurrent editing?

I am about to install a multi-site wordpress and was wondering if there is a big performance degradation if there are multiple concurrent editors using the system at the same time, or what the average ...
1
vote
1answer
916 views

Pros and cons of using [taxonomy name] in place of [category name]?

We are currently in development on a new site. Categories (& tags) are pretty much meaningless for us because we've implemented custom posts & taxonomies. By default, because I have enabled ...
1
vote
1answer
19 views

Including post thumbnail url in loop's post object to reduce number of queries

I'm working now on high performance Wordpress website and it requires me to analyze a lot of queries, caching options etc. I've discovered that if you use get_the_post_thumbnail() even within the loop,...
1
vote
1answer
16 views

Is there a way to append meta data without creating a race condition?

Our site has a lengthy AJAX function that appends content to the user's cart, which is stored as an array in the usermeta table. The function looks something like this: $cart = get_user_meta($userID,...
1
vote
0answers
9 views

How to cache a different page version based on HTTP header?

My website has an HTTP response header generated by Cloudflare that contain the visitor country code, and i can use that header in PHP to generate a dynamic content based on the visitor country, now i'...
1
vote
0answers
43 views

how to solve slow WordPress site caused by attachment_metadata

My WordPress sites starting to become slower by time, after two years they become very slow. I tried many things, such as: improved my DB, used cache plugins (WP Rocket and W3 Total Cache) which both ...
1
vote
1answer
56 views

Side effects of Script and Iframe in post

I am writing a post on HTML. Afcorse the post will have Codes in it. So for showing results in the post, I am taking help of JSFiddle, by embedding results of the code. JSFiddle gives two methods for ...
1
vote
1answer
47 views

Display tags with random thumbnail from selection of posts with that tag

What I want to achieve consists of two parts: First a set of containers that display each tag (with name, description and link). This is easily achieved with a get_tags and foreach loop. <?php $...
1
vote
1answer
317 views

Will Gutenberg Have a Negative Impact on Page Speed?

When WordPress includes Gutenberg by default, will WordPress sites suffer from slower page loading times? While it’s easy to test on a clean install, other factors, such as themes and plugins can ...
1
vote
1answer
23 views

Can the page load time depend on incidence of visiting?

Is it possible that page which is not visited frequently requires more time to first load after an activity than the site which is visited often? I have a one particular page which is visited from ...
1
vote
0answers
114 views

Preload Cache for thousands of posts may be on non-production environment

I have a setup of three wordpress environments: Local: My Development machine (using docker) Staging: An AWS Free Tier EC2 machine Production: An AWS Free Tier EC2 machine I use git/git-hooks to ...
1
vote
1answer
341 views

Nav and logo loading each time causing menu to move JointsWP - Foundation 6

Hi I was wondering if anyone could help. I'm creating a site using JointsWP Foundation 6 theme and have created a new fixed side menu which includes the logo and social links. My problem is ...
1
vote
0answers
29 views

Performance optimization of tree like structure

I have a category page as below: and when a category is clicked, using the following code $sql_categories = $wpdb->prepare ("SELECT * FROM ".$wpdb->prefix."wtd_art_categories WHERE Parent = %...
1
vote
0answers
35 views

Should wp_query automatic meta and term cache priming be used in an enviroment with an object caching

This is kind of followup question to Explanation of update_post_(meta/term)_cache which discusses the disabling of automatic meta and term caches by setting to false both update_post_meta_cache and ...
1
vote
0answers
40 views

Page Loading Issue [closed]

I created a test page that has the below code page link is site.com/testing <?php wp_head(); ?> <?php wp_footer();?> Page taking much time to load. GTmetrix can't able to give result of ...
1
vote
0answers
139 views

XMLRPC slow and weird websites/services

I have a relatively new wordpress setup ~1mth old after installing NewRelic, I notice it tells me XMLRPC.php is causing slowdown. When I looked at the details I notice its connecting to some weird ...
1
vote
0answers
667 views

Loop Performance > JSON files vs. WP_Query vs. REST API

I've a site that uses just about a bazillion complex loops...in many instances. For many said loops, I found myself using WP_Query to create an array only to use another WP_Query ad-almost-infinitum ...
1
vote
0answers
288 views

How do I join a $wpdb query with user meta using default value if not exist?

I am implementing a new feature to a website which gives users a certain amount of credits every week, if they are of a certain membership level. We are using Paid Memberships Pro and MyCred. Both ...
1
vote
0answers
52 views

Is it possible to make Wordpress PHP faster through caching or compiling it?

With a Profiler I've realized that a single page wp-admin/admin-ajax.php takes 7 seconds to load because of the installed plugins. I'd like to strongly speed it up. I was thinking of object caching ...
1
vote
0answers
131 views

Identify running process that constantly use 5% CPU

I have an instance of WP that use 5% constantly of CPU. I try to identify that process, but when I run "top" command on my ubuntu, I can only tell that php7-fpm is the process which gives me this ...
1
vote
0answers
1k views

W3 Total Cache: use cache for request with ignorable query string [closed]

Currently W3 Total Cache use cached page only if query string is empty, the rule is: RewriteCond %{QUERY_STRING} ="" in this code (from .htaccess): # BEGIN W3TC Page Cache core <IfModule ...
1
vote
0answers
125 views

Can I use plupload multiple queues in wordpress?

I have a frontend upload form where users can upload images for their posts and I am using Plupload for it. Since the next upload only starts once the previous upload is finised and the preview ...
1
vote
1answer
172 views

How to load an assets based on custom field value?

How can I load an asset based on custom field value? - This would be outside of the loop, all I can find for this is in the loop related functions, which I'm not familiar with, or what I find are ...
1
vote
0answers
24 views

Terms showing up in object cache on unrelated pages

This is perplexing. I'm running Debug Bar on my dev site. I noticed today that the object cache reporting shows memory taken up by terms I've created using register_taxonomy when not on pages ...
1
vote
0answers
89 views

Using Wordpress as an API [closed]

I'm considering using the new WP API to power a mobile app. I also want to have a web frontend with a restricted membership area, BuddyPress as well as bbPress installed. I'm wondering though if ...
1
vote
1answer
102 views

WordPress takes too long to show 404 error on images (on LEMP stack)

I have installed WordPress on LEMP stack on DigitalOcean and noticed that all the 404 images on the pages are taking too long to show a 404 error message. Those images are not existing so it will ...
1
vote
0answers
249 views

Debugging high CPU usage during periods of inactivity

I'm running WordPress within Docker containers and seeing high CPU usage (40%+) at recurring intervals for about a couple hours. This is a very simple site with very little plugins and minimal CRON ...
1
vote
0answers
202 views

Alter wp_post table vs. post_meta performance/speed

I'm searching for the most efficient way to link a post to multiple users. By default each post in wp_post has a post_author column, which is linked to the corresponding user ID in wp_users. Assume ...
1
vote
1answer
262 views

fastest replacement DB

What's the best database setup for WordPress for speed and lots of posts (hundred thousands of rows in posts and post_meta tables)? While I can cache as much as I can and optimize my queries/PHP as ...
1
vote
1answer
220 views

How to prevent/delay MySQL connections when an object cache is used?

We are using an object cache backed by memcached, however I think that WordPress will still connect to MySQL on every page load, which shouldn't be needed if all queries can be handled by the object ...
1
vote
1answer
5k views

How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]

Almost all of my CSS and JS resources can be postponed with an ASYNC or DEFER tag added to the resource. This may improve performance of my page load times considerably. However, I don't know how to ...
1
vote
0answers
284 views

Slow wp-admin due to “SELECT DISTINCT post_mime_type FROM wp_posts WHERE post_type = 'attachment'”

The media library on a large site is slow in wp-admin. I did some research by looking into slow queries in the sql and found that this query is causing the slow response: SELECT DISTINCT ...
1
vote
1answer
135 views

Does auto_load to 'no' in wp_options improve performance

I am trying to improve the performance of a wordpress based blog. I am looking at wp_options table and am thinking to set the column auto_load to 'no'. Does it have any side-effect on the site ...
1
vote
2answers
143 views

How accurate is P3 Plugin profiler

How accurately does the P3 Plugin Profiler plugin measure the loading time of plugins, and what mechanism does it uses to estimate the loading time?