Wordpress is slow when installed in a sub directory - and I don't know why

I have a main app (xenforo) on the website root directory, but also have a wordpress installation in a subfolder, and this is the config:

vHost: (only relevant parts)

scripthandler  {
  add                     lsapi:movil6822 php
}

extprocessor movil6822 {
  type                    lsapi
  address                 UDS://tmp/lshttpd/movil6822.sock
  maxConns                300
  env                     LSAPI_CHILDREN=200
  initTimeout             600
  retryTimeout            0
  persistConn             1
  pcKeepAliveTimeout      1
  respBuffer              0
  autoStart               1
  path                    /usr/local/lsws/lsphp80/bin/lsphp
  extUser                 movil6822
  extGroup                movil6822
  memSoftLimit            2047M
  memHardLimit            2047M
  procSoftLimit           500
  procHardLimit           600
}

context /blog {
  location /home/$VH_NAME/public_html/blog
  phpIniOverride {
    php_value auto_prepend_file "/home/example.com/public_html/blog/wp-content/nfwlog/ninjafirewall.php"
  }
}

subfolder “/blog” .htaccess (only relevant parts)

#  BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /.* /blog/index.php [L]
</IfModule>
#  END WordPress

May be I miss something related with the main .htaccess under “/” or redirect rules at cyberpanel for that folder, it takes several seconds to proccess a page in wordpress while in other wordt server it takes miliseconds. (cache help but I need to optimize it prior caching).

Kind regards

Hello @ininges Happy you are here

Have you considered the specs of both servers? Does on have more processing power than the other? Do you have many processes running on that server?

Install htop on the slow server side-by-side with your favourite browser and run any request on that wordpress site. Post screenshot here of terminal running htop

##Alamlinux 8 or Centos 7
yum -y install epel-release && yum -y install htop && htop
##Ubuntu 20.04
apt update && apt install -y htop && htop

Thanks, specs are better on the new server - found that the problem is with one plugin, works great with nginx but with openlitespeed seems to fail bad and I don’t know why.

Which plugin?

The plugin is “Article and forum connect xenforo and wordpress” (Article and Forum Connect: XenForo and WordPress | XenForo community)

Thanks in advance!

I have tested this with a clean installation of WordPress, Xenforo 2.2.9 and the plugin you sent. This request fails:

wp-admin/options-general.php?page=article-forum-connect

also they have this vague error in the plugin code:

fails with 500 error. For whatever reason the plugin cannot fetch/GET XenForo nodes.

Also https://wherexenforois/api/ REST API url also doesnt work. Seems like a XenForo only issue not the plugin.

What I have done so far:

  1. Disable modsecurity
  2. Disable CSF and any other firewalls
  3. Increase PHP Memory Limit
  4. Increase PHP execution time

Am still checking on this.

Have you configured the plugin at wordpress side? it ask for forum url and api key. I dont know if how i can help you.

The issue is not the plugin since from source code all other ajax requests work as expected its only the Nodes request that fails. Of course subsequently any thread requests will fails too because they depend on nodes e.g. categories etc

Are you facing a similar issue?

No, in my case everithing seems to work but slow.

You can manipulate AJAX Heartbeat using a plugin

Please double check this option at API keys inside xenforo:

image

its under: /admin.php?api-keys/1/edit

You can acces the exact url from /admin.php?api-keys

Cause the “1” is the id of the key, it may be other in your case.

It is active. I also have scope all dialled in. And the key type is a Super user key

Can you access https://wherexenforois/api/ REST API url?

Yes, in my case I got this json

image

from one of your screenshots, may be is:

https://wherexenforois/xenforo/api/

Not sure.

Works as expected. Mine shows 400 error. I will fix that.

Have you tried Wordpress is slow when installed in a sub directory - and I don't know why - #10 by josephgodwinke

https://www.burbuja.info/inmobiliaria/api/%20REST%20API

May be the rewrite rules?

Yes, disabled the heartbeat options in LSCache but the issue continue.