Questions tagged [optimization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
20 views

How to deal with too many $_POST variable conditions from ajax request at backend? [closed]

At work, we write a PHP application. I'm only a junior, but I'm dissatisfied with the problem of processing AJAX calls. Each of AJAX request is directed to the single appdata.php script. At appdata....
0
votes
0answers
34 views

How to optimize posts query in wordpress

basically, I'm trying to optimize this query we have more than 100K blogs and I need to make it faster now it takes Load time (07.46 s). <?php if ( get_query_var( 'paged' ) ) { $...
0
votes
0answers
194 views

Deferring Script wp-i18n causes a console error 'wp is not defined' - Gravityforms

I am deferring JS scripts in order to optimize page load times and SEO. My code to defer scripts is something like: add_filter( 'script_loader_tag', // Filters the HTML script tag of an enqueued ...
0
votes
0answers
88 views

How to deliver webp format of images to WP REST API

I use WP Offload Media Lite plugin to offload upload image to S3. I use raw S3 URL (not CDN) and choose remove file in server option. Then I use EWWW Image Optimizer plugin to convert image on S3 to ....
0
votes
1answer
36 views

Is there a way to ensure local fonts load from CDN when CDN is enabled?

I've set up a WordPress site with one local font. It is stored in the a fonts folder in the child theme. It is loaded with the following in the child theme style.css @font-face { font-family: '...
1
vote
1answer
46 views

I'm designing a plugin to create database indexes. Suggestions?

I'm starting a (totally open-source) little project to create a WordPress plugin that will add appropriate indexes to WP's MySQL tables to improve performance. (Some wp tables, notably wp_postmeta and ...
1
vote
1answer
31 views

Improve wp query perfomance on large db

I have 100000 records in my database and so many meta query performed on it so it takes lot of time to perform the operation, what is the way to speed up this? It takes 20 to 25s to load this query. ...
0
votes
0answers
148 views

How to do chunked JS files in WordPress?

Webpack outputs chunks of JS files in order to parallelize downloads over HTTP/2 but unfortunately WP's wp_enqueue_script requires that only one file be loaded to represent a script, forcing us to ...
2
votes
0answers
29 views

Continue execution after WP REST API response

I am trying to extend the Wordpress REST API with an endpoint that takes Zoom webhooks. Zoom requires a response within 3 seconds or will blacklist your endpoint address, but the processing that I ...
0
votes
0answers
76 views

Improve performance by removing unnecessary database queries

I've just found out that main page of custom theme im developing does 150 db queries on every load (what takes even 2.5 seconds). Many of them come from functions.php, and are caused by for example ...
2
votes
1answer
94 views

Wordpress Query is taking more then 20 second and stuck on creating index

Hi I need help with below query this query takes around 20 second and when more then one is executed then server CPU usage hits 100% and server stop responding. here is the query from process list. ...
0
votes
1answer
206 views

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 ...
0
votes
1answer
234 views

How can i unload effect.min.js file?

I'm currently working on optimizing the speed of my WordPress site, and i successfully unloaded some unnecessary files, but there is one i can't seem to remove which is: https://domain.com/wp-...
0
votes
0answers
39 views

Google Page Speed

My website is in Wordpress so I am asking question regarding Google Page Speed here. My issue is i had completed the development of home page of existing page now when i am trying to check the score ...
0
votes
1answer
96 views

Can mediaelement-and-play core JS be dequeued?

I'd like to understand what is the purpose of the WordPress core javascript file /wp-includes/js/mediaelement/mediaelement-and-player.min.js I am asking that because it weighs 136KBytes and I'd like ...
0
votes
2answers
532 views

SQL: How to find all attachments that are not used in any posts/pages/custom_post_types

I have a wordpress installation where the posts also contain attachments that were not embedded in the content by using the media library -> add. I would like to find all attachments that are not ...
0
votes
0answers
73 views

Wordpress UPDATE queries on MySQL database stuck

I have an Amazon 24XL server 96 Cores 378 GB RAM Database size 5.7G Debian GNU/Linux 9 (stretch) PHP 7.3.16 mysql Ver 15.1 Distrib 10.3.22-MariaDB I have only one WordPress site where users read ...
0
votes
0answers
310 views

How to optimize wp_delete_post() function, or why it is so slow

I have a code block to delete all the products from a store. This products have several custom fields and some images attached. The code is below: set_time_limit(0); define('WP_USE_THEMES', false); ...
0
votes
1answer
625 views

Should I use wp_cache in my plugin to make it faster?

As a plugin developer, I strive for coding plugins that take as less server resources as possible. That's why I thought of avoiding to repeat queries to the database that are run on the same request (...
0
votes
1answer
31 views

What is the best way to host a site with many images without it being too slow?

I have a friend that wants me to help them with their WordPress website that has about 150 images for their gallery. Their site is quite slow even after I optimized the images using the ImageOptim app....
1
vote
1answer
39 views

Page taking time in loading. Also used lazy loading but doesn't work?

There are number of logo images and many are shown under show more button. But all are getting loaded at a time. Due to page speed decreases. I have used lazy load plugin but still is taking time on ...
0
votes
1answer
22 views

Can the benefits of performance optimization plugins outweigh the tax of installing them on performance?

Everyone knows that having too many active plugins often results in a slow site. I ran a check on one of my sites through GT Metrix and found several issues contributing to its slowness. Among these ...
1
vote
0answers
12 views

How to show optimized list of posts with all their attachment images

In page-images.php template I have created this code which displays a list of posts which belong to a category and order them by meta value. So basically it is like a category page, generally nothing ...
0
votes
1answer
299 views

get_the_id, get_the_permalink, and get_the_title all with one DB call

we are trying to optimize a heavy traffic WP site, and am looking for a way to get the data for these three WP functions with only one query, in order to reduce queries & load on DB server: $wpid=...
0
votes
0answers
121 views

Reusing old post IDs

When I exported my posts I noticed that some of the ID numbers were missing e.g. it started from 8 and went to say 21 and then from 24 to 30 etc. Is it possible to reuse IDs 1-7 (or any others that ...
0
votes
1answer
246 views

WordPress plugin activation, deactivation and uninstall hook not being triggered

I am developing a WordPress plugin which requires certain rules to be added to the .htaccess file of the WordPress installation upon activation of the plugin. Initially, before I switched my code to ...
0
votes
0answers
187 views

Wordpress Query optimaization for slow query

I've WP installation with some 120K posts. One of the slow queries that frequently appear at @mysql-slow.log is below # Query_time: 1.744827 Lock_time: 0.000567 Rows_sent: 1 Rows_examined: 635732 ...
0
votes
0answers
17 views

Does &$this is really disallowed to use anywhere?

I got this message from the validator of plugins from Envato: When creating a callable, never use &$this, use $this instead: I think he may be wrong with his 'never use'. Are we ...
1
vote
0answers
320 views

What type of index should I use for postmeta?

I already added a composite index but it still took 5 seconds to finish these 2 queries. SELECT COUNT( DISTINCT( wpp.id ) ) FROM `wpdgls_posts` wpp JOIN `wpdgls_postmeta` wpm ON wpp.id = wpm.post_id ...
3
votes
1answer
786 views

Speeding Up Bulk Post Creation - wp_insert_post & update_post_meta

I am creating posts (variable products) using (wp_insert_post) function. An Example, I have 9 colors, 9 sizes. Which makes 9×9 = 81 total variations for 1 product, which is 81 times below function to ...
2
votes
2answers
1k 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 ...
0
votes
0answers
297 views

How to prevent Vimeo duplicate requests?

I've been tasked to optimize a wordpress site (big surprise...) and found that Vimeo embeds duplicates of their player api js file. I would have thought the browser would prevent this but apparently ...
0
votes
1answer
53 views

Is querying wpdb directly and skipping actions provided by WP's core "wp_update_post" a good idea?

I need to query a lot of posts at once. A lot and performance is more than crucial here - things moving slow will net me bad reviews, a lot of them, but cutting a bit through WP's overhead could net ...
0
votes
1answer
211 views

Need to optimize wordpress websites on google pageinsight

I am trying to optimize my websites on pagespeed insight. And, for this I have tried lots of speed optimization wordpress's plugins and all have very good ratings by the users. But not even single ...
0
votes
0answers
35 views

Is there any way to get all custom posts and all custom terms with it's meta in few queries?

I'm developing a website with a record for me query count. It has 720 Query for the main page. I want to reduce it. The main page structure is like this: ~10 Custom Taxonomy Term Each Term has a ...
0
votes
0answers
101 views

Can lots of tags affect performance?

I'm working on a plugin that will auto-tag my posts (it's for a very specific, single project only). It will apply 6 tags based on the content of the post. Forward thinking, I wonder if the number of ...
2
votes
3answers
416 views

Defer Code in Widgets - Page Speed

How to UP Page Speed With Widget Defer? Is there a way to defer a widget in the footer? I have an external API in a footer widget which is slowing down my page. It is not needed until the page is ...
0
votes
1answer
88 views

How to find and remove unnecessary theme scripts? [closed]

When I load my website, I see many java scripts and css loading and slowing my website. Many of them I know I'm not using, like fonts, extra theme css from a template that I'm not using, icons and so ...
0
votes
2answers
3k views

Optimized PHP & Wordpress settings for speed/performance?

I have a big site with several plugins that take up memory, a lot of requests to the server, etc. I've maxxed out my hosting to help account for this, but are there optimum PHP and Wordpress settings ...
1
vote
1answer
621 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 ...
-5
votes
0answers
44 views

What are some ways to speed up a WordPress site that most people don't know? [closed]

I am looking for ways to speed up my site, https://whatifhq.com I know this isn't the best place to post this, but I could not find anything else on the web other than "get a better server", "reduce ...
5
votes
3answers
2k views

register_post_status - show_in_admin_all_list & show_in_admin_status_list does not affect query

In the register_post_status, I've already disabled show_in_admin_all_list & show_in_admin_status_list for my custom status my_hidden_status However, from the query log the post_status ...
5
votes
2answers
77 views

What's the case against transient-ing almost everything that's mostly static?

Assume I have a menu that's simply static, for most sites, or rather, let's use my example, a blogging site, it almost never, never changes. Why not hook it to a transient that never expires unless ...
0
votes
1answer
2k views

Optimize WP Meta Query for large amount of post meta?

I have a large WP site with about 2k posts and 150k postmeta. When browsing to a large category, the archive loads very slow due to the WP query that is seeking for featured posts, to show them first. ...
0
votes
2answers
2k views

How to optimize wp_option table?

My Wordpress website is often going down with the error message "error establishing a database connection" and when I contacted my hosting server, they replied that the query takes a long time(more ...
0
votes
0answers
48 views

Why are the latest visits to my website originating from my own website?

To start with, I don't know anything about coding and stuff. I am here to seek help from experts hoping they can help me resolve the issue. I have a website/blog that runs on WordPress. I have a VPS ...
1
vote
0answers
295 views

Query posts without meta preload

I'm optimizing high traffic website. Trying to solve following issue: Site's home page is extremely slow and top showing 100% CPU because of Mysql. After some investigation with Query Monitor plugin, ...
0
votes
1answer
358 views

Queries take 120+ seconds on my large Wordpress site

i have a couple of Wordpress website running on a VPS, each one of them has 1M+ posts. When adding new posts queries just hangs for a long time until the website crashes. I use XML-RPC to post to my ...
-1
votes
1answer
118 views

How to make wordpress backend mobile optimized.?

I have a membership website where my users can create their own page. Most of my users are from mobiles (they do not have laptops). When I open my website in android chrome browser, the WordPress ...
0
votes
0answers
18 views

How can I stop widgets from re-executing every time I access the logged-in homepage?

I have a few widgets and they're being built-up every time someone accesses their logged-in homepage. I assume this is so that everything works nicely. Unfortunately, this is a tremendous ...