PHP Warning in optimize.cls.php




Wordpress LScache Plugin: PHP Warning in optimize.cls.php

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi, Im running litespeed cache v3.5.2 and Ive got these warnings in litespeed-toolbox#log_viewer : PHP Warning: strpos() expects parameter 1 to be string, array given in wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 231 PHP Warning: strpos() expects parameter 1 to be string, array given in wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227 EDIT : Also got this notice : Array to string conversion in wp-content/plugins/litespeed-cache/src/css.cls.php on line 390 Have a nice day ! This topic was modified 2 years ago by nir0ma. Hi, Same issue here. [05-Nov-2020 07:38:42 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227 [05-Nov-2020 07:38:42 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 231 THanks Are you able to reproduce it? Hi, Same issue here? (WP:5.5.3 PHP:7.4) [09-Nov-2020 10:56:20 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/site/public_html/wp-content/plugins/litespeed-cache/src/utility.cls.php on line 707 [09-Nov-2020 10:56:20 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/site/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 388 [09-Nov-2020 10:56:20 UTC] PHP Warning: substr() expects parameter 1 to be string, array given in /home/site/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 391 Hi, could you please edit this file /home/site/public_html/wp-content/plugins/litespeed-cache/src/utility.cls.php on line 707, you will see $url_parsed = parse_url( $url ) please add this line ABOVE it error_log($url,3, /home/site/public_html/lscwp.log ) then reproduce that error , and see what content is logged into lscwp.log ? Best regards, Hi, Here is the log : https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.jsExpand Hi, well , sorry , the log is bit of mess and hard to determinate which round was it please change error_log($url,3, /home/site/public_html/lscwp.log ) to error_log( start ,3, /home/site/public_html/lscwp.log ) error_log($url,3, /home/site/public_html/lscwp.log ) error_log( end ,3, /home/site/public_html/lscwp.log ) clean up current lscwp.log file and repeat the process 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. Best regards, Ive got the same errors being logged over and over too: [29-Nov-2020 12:30:24 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/website/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227 [29-Nov-2020 12:30:24 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/website/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227 [29-Nov-2020 12:30:24 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/website/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 231 Running PHP v7.4, WP v5.5.3 & LiteSpeed Cache v3.5.2 Same error here



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



Reference