optimize.cls.php error




Wordpress LScache Plugin: optimize.cls.php error

Last Updated on: Wed, 15 Apr 2026 00:00:02
My error.log is full of these lines 2021-03-31 21:57:27.177534 [NOTICE] [795] [STDERR] PHP Warning: strpos() expects parameter 1 to be string, array given in /var/www/app/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 223 2021-03-31 21:57:27.177573 [NOTICE] [795] [STDERR] PHP Warning: strpos() expects parameter 1 to be string, array given in /var/www/app/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 223 2021-03-31 21:57:27.177581 [NOTICE] [795] [STDERR] PHP Warning: strpos() expects parameter 1 to be string, array given in /var/www/app/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227 2021-03-31 21:57:28.300733 [NOTICE] [795] [STDERR] PHP Warning: substr() expects parameter 1 to be string, array given in /var/www/app/wp-content/plugins/litespeed-cache/src/utility.cls.php on line 707 Hi, Do you have more information, like how did you trigger it ? Best regards, Seemingly most of the actions on the site trigger it ? this one from access.log 172.70.38.161 ? ? [31/Mar/2021:22:42:23 +0000] GET /cart/ HTTP/2 200 19494 - Mozilla/5.0 (Windows NT 10.0 Win64 x64) AppleWebKit/537.36 (KHTML, like Gecko compatible BW/1.1 bit.ly/2W6Px8S) Chrome/84.0.4147.105 Safari/537.36 Triggers this in error.log 2021-03-31 22:42:25.127407 [NOTICE] [795] [STDERR] PHP Warning: strpos() expects parameter 1 to be string, array given in /var/www/app/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 223 2021-03-31 22:42:25.127445 [NOTICE] [795] [STDERR] PHP Warning: strpos() expects parameter 1 to be string, array given in /var/www/app/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 223 2021-03-31 22:42:25.127487 [NOTICE] [795] [STDERR] PHP Warning: strpos() expects parameter 1 to be string, array given in /var/www/app/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227 Hi, okay , please edit that file , before line 223 , add this block error_log( start-mark , 3 , /home/path/public_html/lscwp.log ) error_log($src, 3 , /home/path/public_html/lscwp.log ) error_log( end-mark , 3 , /home/path/public_html/lscwp.log ) replace /home/path/public_html to your document root then trigger the error again , see what it logs out Best regards, Hi, Im going to mark this topic Resolved , due to lack of activity. If you still need help, please feel free to re-open it. When re-open it, please also change the topic status to not solved Best regards, I added the modified version if (gettype($src) == array) error_log( start-mark , 3 , /var/www/wordpressb0988/app/log/lscwp.log ) error_log($src, 3 , /var/www/wordpressb0988/app/log/lscwp.log ) error_log( end-mark , 3 , /var/www/wordpressb0988/app/log/lscwp.log ) and get a bunch of these start-mark end-mark start-mark end-mark start-mark end-mark start-mark end-mark start-mark end-mark start-mark end-mark start-mark end-mark start-mark end-mark start-mark end-mark start-mark end-markExpand Hi, please create a ticket by mail to support at litespeedtech.com we will investigate it further Best regards,



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference