Seu site em WordPress está consumindo muita memória e CPU do seu servidor? Resolva isso agora!
English: Is your WordPress site consuming a lot of memory and CPU from your server? Solve it now!
Talvez um site com pouco tráfego não seja um problema pra CPU de seu servidor, mas se o site tiver uma boa quantidade de acessos você vai ver o uso da CPU e memória ir parar nas nuvens.
English: Maybe a site with little traffic is not a problem for your server’s CPU, but if the site has a good amount of accesses you will see the CPU and memory usage end up in the clouds.
Para quem tem um servidor Linux é bem simples: primeiro, acesse o cPanel e verifique em tarefas CRON se existe alguma coisa agendada. Remova qualquer linha existente apontando para o arquivo wp-cron.php
English: For those who have a Linux server it is very simple: first, access cPanel and check in CRON tasks if there is anything scheduled. Remove any existing lines pointing to the wp-cron.php file
Aqui está o pulo do gato:
No arquivo functions.php do tema ativo adicione o seguinte código:
English: Here’s the cat jump:
In the functions.php file of the active theme add the following code:
global $wpdb;
$wpdb::delete(
$wpdb::prefix.'options', // table to delete from
array(
'option_name' => 'cron' // value in column to target for deletion
),
array(
'%s' // format of value being targeted for deletion
)
Isso excluirá na tabela wp_options a instrução que o WordPress cria automaticamente e é o responsável pelos altos picos de sua CPU.
English: This will exclude in the wp_options table the instruction that WordPress automatically creates and is responsible for the high spikes in your CPU.
Como se trata de alterações e exlusão de registros, não nos responsabilizamos por quaisquer perdas ou danos causados pelo tutorial, faça por sua conta e risco.
O código php pode ser copiado na descrição do vídeo
English: As it is about altering and deleting records, we are not responsible for any loss or damage caused by the tutorial, do so at your own risk. The php code can be copied in the video description