Plugin Support
qtwrk
(@qtwrk)
function ip_check_callback() {
$data = array(
'remote_ip' => $_SERVER['REMOTE_ADDR'] ?? 'Null',
'x_forwarded_for' => $_SERVER['HTTP_X_FORWARDED_FOR'] ?? 'Null',
'proxy_remote_addr' => $_SERVER['PROXY_REMOTE_ADDR'] ?? 'Null'
);
return rest_ensure_response($data);
}
function register_ip_check_route() {
register_rest_route('lscwp', '/ip-check', array(
'methods' => 'GET',
'callback' => 'ip_check_callback'
));
}
add_action('rest_api_init', 'register_ip_check_route');
did you add this code for test ?
thanks for your quick answer. Yes, it is in my functions.php and to me it looks like my IP is parsed correctly.
Plugin Support
qtwrk
(@qtwrk)
please try open it in private widow, as guest user, see what it shows
In a private window I get:
{“code”:”rest_not_logged_in”,”message”:”You are not currently logged in.”,”data”:{“status”:401}}
In a normal window:
{“remote_ip”:”62.117.181.127″,”x_forwarded_for”:”62.117.181.127,62.117.181.127″,”proxy_remote_addr”:”172.71.131.128″}
Plugin Support
qtwrk
(@qtwrk)
there you go , that’s your error , you have smoething disabled REST API , you should see the same result on both window , something restricted your rest api to be only allowed for login-user
Thank you! Any pointers on where I should be looking to fix this?
-
This reply was modified 9 months, 2 weeks ago by
bastianmiv.
Plugin Support
qtwrk
(@qtwrk)
well , there are hundreds different plugins can do this , but off-handed, I’d say check perfmatters and wordfence , they are most likely doing so , check their conf , see if you can find anything.
Success. In the end I had some rest auth api filter in my functions.php. Once I removed that I was able to reconnect. Thank you!
Cron jobs now give the following error when I click on Force Cron: Cloud server refused the current request due to rate limiting. Please try again later.
They come through maybe 10 jobs at a time. It’s better than what I had before but I still have about 500 jobs to go. Is that normal?
Plugin Support
qtwrk
(@qtwrk)
yes, that’s kind of normal , as long as your cron triggers in time , it should be fine.
Will keep an eye on it. Thank you very much for your expert help!
Now, let’s move on the the cron jobs. I have created this cron job in Hostinger, and I verified that it runs successfully every 5 minutes: */5 * * * * /usr/bin/php -q /home/u378749859/domains/getyourlawyer.ch/public_html/wp-cron.php > /dev/null 2>&1
However…. the number of Critical CSS jobs on the Litespeed dashboard stays stuck at 501. If I click Force Cron it will process between 5-10 jobs normally. Sometimes I get lucky and it does 20-30 in one go, and sometimes it only does 1 or 2. Then quickly it increases again to 501 jobs.
What can I do to to process these jobs? I have plenty of credits so that’s not the problem.
-
This reply was modified 9 months, 2 weeks ago by
bastianmiv.
-
This reply was modified 9 months, 2 weeks ago by
bastianmiv.
Plugin Support
qtwrk
(@qtwrk)
please be patient , if you have a lot of traffic and a lot of pages , it could show 500 or 501 for long time
Thanks. I will give it some days, but in the mean time do you know why the normal cron job doesn’t seem to reduce the number of pages and a force cron job does?
Plugin Support
qtwrk
(@qtwrk)
I think it did , but later on increase it up again , please check in your access log after cron job , if you see anything about /?rest_route=/litespeed/v1/notify_ccss
It took a while, but all jobs have now processed and the site is noticeably faster. Because it’s a big site with 100s of pages it just took a while to complete. Thank you again for your help.