Questions tagged [optimization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
40 views

Could a higher number of registered image sizes affect performance?

This question is related to this one, but is a bit different. In the layout (archive page) for a Wordpress project I'm working on right now there's a couple of image sizes that do not appear anywhere ...
2
votes
1answer
528 views

Disable unneeded scripts in a wordpress installation

I have inherited a quite bloated wordpress website that runs really slow even on dedicated hosting. I am trying to optimize the speed of it. I have run the website through different websites that ...
1
vote
3answers
177 views

How to Appease the Google PageSpeed Gods with regards to image optimization?

I have a site with a pretty large media library. The images are mostly in JPG format. When I ran the site through Google's PageSpeed, it heavily penalized the score because the images were not ...
0
votes
1answer
47 views

Optimizing function that automatically creates internal links based on post title string

Problem sovled,thank you @SamuelElh for the tip ,so I relect it in the code.Transient turns out to be the right solution. I wrote a function that adds links to existing post titles that occur in a ...
0
votes
1answer
3k views

Avoid landing page redirects issue in wordpress multisite

Recently I configured my website for https and redirected http to https but now in google page speed, I am getting issue of Too many redirects! Can be checked at: https://developers.google.com/speed/...
0
votes
0answers
53 views

Run command to optimize images after they get uploaded to WordPress

I been playing with jpegoptim on a ubuntu test server and like the result of its optimization, its there a way to run the optimization command to the new images uploaded through WordPress? Im aware ...
0
votes
1answer
715 views

Database Queries Optimization with new WP_Query

I’m building (mostly with a self-teaching purpose) a simple plugin to query posts from another blog on a MS network via a shortcode (like [network-posts blogs=”8" layout=”grid” columns=”3"]), but I’m ...
1
vote
1answer
62 views

Where are the resized images coming from?

I'm trying to figure out the best way to deal with media that's uploaded into the library. There's a statement in the media library that confuses me a tad: "Discard any changes and restore the ...
0
votes
3answers
29 views

Optimising uploads folder then re-uploading?

Rather than using a plugin to optimise images via the admin, would downloading and optimising locally work as well? As in would downloading the uploads folder, using something like ImageOptim to ...
0
votes
1answer
23 views

Limit scripts and styles on dashboard for user role

How can I properly prevent scripts and styles from loading on dashboard for some user role? My users need only access to one plugin and that's the only thing they see on dashboard. How can I dequeue ...
0
votes
1answer
412 views

Optimize slow SQL query for multiple meta values

Can you help me to optimize this slow query? The page containing this query is loading slowly: SELECT a.id, b1.meta_value AS display_name, b2.meta_value as user_nicename, b3.meta_value as ...
0
votes
2answers
109 views

Compressing JS and CSS

I'm using W3TC to caching and minifying my Wordpress. Unfortunately it is not possible to minify and compress all of the files since minifying some of them is crashing the site. My question is, how ...
2
votes
2answers
5k views

Preventing YouTube embeds loading multiple instances of player JS?

I have noticed on many WordPress sites I work on that when there is more than one YouTube video embedded, multiple instances of the player JS will be called. Since it's a full megabyte of data, I am ...
1
vote
1answer
70 views

Optimizing WordPress's styles and scripts

I'm trying to optimize my website, get rid off unwanted scripts and styles. I wanted to ask what is the best way to do so. What is the difference between wp_deregister_script and wp_dequeue_script ? ...
0
votes
2answers
65 views

Optimizing a Wordpress site

Many premium Wordpress themes come with a bulk of functionality and embedded wordpress/jquery plugins that aren't necessarily used at all in a certain project, so I'd assume weeding them out would ...
0
votes
1answer
537 views

batch UPDATE autoload value in wp_options table

After running the following query SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'; I've found I got 1587 autoloading options values, mostly belonging to custom fields values; ...
1
vote
0answers
199 views

Cron Job Keep Running in spite of being disabled

I have Cron job issue in two of my sites (both hosted in siteground). It almost runs for every request made to the site I have added following code to wp-config.php file define('DISABLE_WP_CRON', ...
1
vote
1answer
1k views

Cleanup: best way to remove WooCommerce comments from the wp_comments table

I am optimizing the database of my site that is using WooCommerce. When I came across the wp_comments table, I found it close to 100 MB in total. It's all filled with WooCommerce order statuses from ...
2
votes
1answer
82 views

Image sizes and order of operations

I'm working on optimizing my site, and part of that is compressing images and using smaller versions. I'm using WP Smush and creating a bunch of sizes for each image. All images have been smushed. My ...
1
vote
1answer
4k views

Prioritize visible content - Page speed issue on Google insights

I'm new to wordpress and i tried to speed up the site, but i got some error please see the image. I used w3 total cache,autoptimize and Above The Fold Optimization plugins. But still site is slow on ...
3
votes
2answers
406 views

Easy way to process search results before displaying

I've got several search forms on my site and I want them to show different results. My website has a very strict hierarchy and the search form on a parent site should only show results from it's child ...
2
votes
1answer
151 views

Is checking whether the blog is installed necessary?

My Wordpress site has become kinda slow and unresponsive, so I am trying what can I do to speed it up by eliminating unnecessary database queries and other things. I stumbled across suggestion found ...
0
votes
1answer
157 views

How to use Virtual Private Server as Wordpress Image CDN

I have 2 Private Server and 1 Shared hosting. 1 of my private server is not much in use, but my shared hosting is getting overloaded with images running wordpress. I want to set my own CDN with my ...
0
votes
1answer
494 views

A faster way to query custom post types with multiple conditions?

I am using a lot of custom post types (CPTs) with custom meta and so far I have been using queries like the below, to get for example all events in CountryX that happened in 2014: <?php global $...
1
vote
0answers
153 views

Least expensive way to get table prefix in multisite installation

I am writing an api that will have to handle extremely high volumes of calls so, in short, I can not afford to load the WordPress core every call. I have no problem building the API to use the ...
1
vote
0answers
137 views

Wordpress backend delay by server side HTTP Request

I had 50 seconds of loading time for my backend in wordpress. I thought it was very strange for a DB to be so slow and I realized with the help of the Query Monitor plugin that the server is making ...
0
votes
0answers
28 views

Is there a way to analyze the load time of the functions in a custom plugin?

I have a custom plugin that is adding on average 1 second to the page load time. I thought the code was well written, but clearly not. Is there any way for me to find out what aspect of the plugin in ...
1
vote
0answers
88 views

What would Repair and Optimize Wordpress Database do?

Recently I am getting an error establishing a database connection in a clients Wordpress site. I googled for a solution and an article suggested to enable Wordpress Repairs by adding this to the wp-...
0
votes
1answer
353 views

Disable Garbage Collection? [closed]

I have a WP site which creates 500's errors for about 2% of Apache requests (mostly bots and crawlers). I'm not able to stack trace most of those requests with 500's neither to PHP or MySQL errors as ...
1
vote
0answers
34 views

Any suggestions on how to make this function more efficient or more generally useful?

I wrote this to handle sanitizing all the fields in $_POST before saving them to options and to sanitize and initialize everything before creating the form. You can use the same $soap array to handle ...
1
vote
0answers
262 views

get_metadata() vs get_post_meta() vs custom query [duplicate]

I have 27 items of post_meta data that I need to get out in a class that I use through-out my website. Currently I'm using: $this->postMetaData = get_metadata("post", $postID); This returns an ...
1
vote
0answers
68 views

Wordpress problematic caching

I am looking at ways to optimize the speed of a Wordpress website and found that there is a css file containing a ridiculous amount of useless css and was contributing to the site's very slow loading ...
1
vote
1answer
2k views

How to solve 'Eliminate render-blocking JavaScript and CSS in above-the-fold' content for multiple files?

I get this when I check my site in google insight: Pretty ok right? But I still consider to fix Eliminate render-blocking JavaScript and CSS in above-the-fold content to get a good results on mobiles ...
1
vote
1answer
48 views

wp_trash_post is leaking memory

I have a plugin that deletes a list of posts based on their post id. The code is very simple foreach ( $post_ids as $post_id ) { wp_trash_post( $post_id, true ); } } ...
0
votes
1answer
286 views

Function to retrieve IDs of posts, cache results, and improve wp_query

I'm looking to optimize db performance by creating a function that retrieves IDs of posts in a certain category and caches results. So instead of having a query like: SELECT … WHERE 1=1 AND wp_posts....
0
votes
0answers
1k views

Optimize WP_Query

For the homepage WP_Query loop, I need to get the most recent 20 articles, specifically to display the page title, excerpt, category, and date. I am doing the following: $args = array( '...
0
votes
2answers
260 views

Optimising amount of calls to custom fields

I have this code fragment in my codebase: foreach($this->adverisers as $adveriser) { $this->data[$adveriser->name]['image'] = bfi_thumb(get_post_meta($adveriser->ID, ...
6
votes
1answer
2k views

Separate Database Tables For Different Post Types

one big problem with wordpress is that everything on it is a post(a record in wp-posts table)! images, posts, pages, products(for example in woocommerce), portfolios, Post Revisions... Almost ...
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 ...
0
votes
1answer
191 views

Varnish + Nginx for Wordpress is Good?

i m instaling my new server and trying make some good environment for my wordpress so i wanna know if installing Varnish + Nginx is good idea and will speed up my wordpress website or there is other ...
1
vote
1answer
977 views

What's faster? One big query, or several smaller ones?

I'm working on an app that will require a query, via Ajax, for a bunch of posts in random order. Something like this: $query = new WP_Query( array( 'posts_per_page' => 50, 'orderby' => 'rand' );...
19
votes
3answers
13k views

How to Optimize WP site for millions of posts

I'm working on a website for a company that will very likely be creating millions of posts via a custom post type. They're prayers, so basically the user on the front end just submits a short phrase ...
0
votes
1answer
54 views

ordering and optimizing functions

Ive been hard at work trying to build some functions to display products on my site. The prices for these products are calculated based on many variables. I think the first set of functions work, ...
0
votes
1answer
286 views

Combine several CSS files into one

I've been working on a site where specific CSS files have been written and loaded only when required. I would like to combine all those scripts into one single file. I'm not interested in minifying ...
-1
votes
1answer
464 views

echo vs output variable [closed]

Someone once told me, that it is good for performance, not to open and close php tags and use echo all the time, like that: <hgroup> <h1><?php echo getHeading1(); ?></h1> ...
0
votes
1answer
106 views

Recent posts headlines. How to optimize the loop

I'm using this in my page template to display the 20 recent posts headlines from category number 8, 17, 23, 423 <div id="horizontalTab"> <ul class="resp-tabs-list"> <li>...
0
votes
1answer
62 views

Make different sites on multisite reference same script

I'm using multisite and want all my scripts to point to the same URL so they are optimized as well as they can be. Currently I have: http://www.site.com/news/wp-content/themes/js/bxslider.js http://...
1
vote
2answers
508 views

Using Multiple Queries of “home_url” vs. Calling a Variable Multiple Times

Question Since I am using multiple instances of home_url() in one page template, I was curious if the following method would speed up my page load time. My method is to store the output of home_url() ...
-1
votes
1answer
612 views

Using <?php echo get_num_queries(); ?> queries in and i see 7000+queries?

I have put queries in seconds. in my footer.php and i see more than 7000 queries in about 9 secs , is this a lot?? On my localhost i have 195 queries in 3,070 seconds. As the live version ...
0
votes
3answers
47 views

Wordpress network vs Separate installs

I am contemplating hosting all my client sites on one wordpress network. So far I've been installing a new wordpress installation for every site. Is it a good idea (compared to standalone installation)...