Meta_query with relation ‘OR’ killing server CPU

function get_nb_offres( $typeOffre ) { global $type_bien_correspondances; $args = array( ‘post_type’ => ‘annonces’, ‘meta_query’ => array( ‘relation’ => ‘OR’ ) ); foreach( $type_bien_correspondances[$typeOffre] as $typeBien ) { $args[‘meta_query’][] = array( ‘key’ => ‘type_de_bien’, ‘value’ => $typeBien ); } $annonces = new WP_Query( $args ); return $annonces->post_count; } My global $type_bien_correspondances is here : $type_bien_correspondances = … Read more

How can I measure the performance of any WordPress Plugin or Theme?

There are many WordPress plugin or themes with nearly same functionality and features but, how can I measure the performance of any plugin or WordPress theme other than using P3 profiler plugin? I want to know the technical aspects such as resource usage, load time, code quality, impact on site performance etc. Can any expert … Read more

Mysql / WordPress killing my server with 80k users [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers’ support routes. Closed 2 … Read more

Too many MySQL connections on WordPress

I installed WordPress on my Ubuntu server. I only have 3 blog posts but it reaches max_connection within an hour. So whenever a user visits my blog it shows a database establish error. My log file has the following entry: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting [Mon Jun 20 06:30:21.877663 2016] [mpm_prefork:notice] … Read more

Using Global Variables Expensive for PHP

I am writing some functions to display Custom Fields across multiple templates. Rather than getting each CF like so: $var = get_post_meta($post->ID, ‘my_cf_key’, true); and then checking if the var exists, if so, doing some HTML and then echoing the variable, I have started another approach. My concern is that this new approach might become … Read more