• Resolved WriterCJ

    (@calvin141170)


    Hi,

    Noticing a lot of PHP warnings generated by Litespeed Cache in the Error Logs generated by the BPS Pro Security Plugin — here’s a sample from the log on 30 December.

    [BPS Pro htaccess Protected Secure PHP Error Log]

    [30-Dec-2020 14:22:19 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [30-Dec-2020 14:22:19 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 232
    [30-Dec-2020 14:22:19 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/utility.cls.php on line 707
    [30-Dec-2020 14:22:19 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 388
    [30-Dec-2020 14:22:19 UTC] PHP Warning: substr() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 391
    [30-Dec-2020 14:22:19 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-includes/class-http.php on line 272
    [30-Dec-2020 14:22:30 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [30-Dec-2020 14:22:30 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 232
    [30-Dec-2020 14:22:30 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/utility.cls.php on line 707
    [30-Dec-2020 14:22:30 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 388
    [30-Dec-2020 14:22:30 UTC] PHP Warning: substr() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 391
    [30-Dec-2020 14:22:30 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-includes/class-http.php on line 272
    [30-Dec-2020 14:22:57 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [30-Dec-2020 14:22:57 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 232
    [30-Dec-2020 14:22:57 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/utility.cls.php on line 707
    [30-Dec-2020 14:22:57 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 388
    [30-Dec-2020 14:22:57 UTC] PHP Warning: substr() expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 391

    Everything seems to be working properly, but would still rather not see these errors.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    please try this :

    edit file /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 229-232 , you will see a block

    		$basename = basename( $filename );
    		if ( preg_match( '|[-\.]min\.(?:[a-zA-Z]+)$|i', $basename ) ) {
    			return true;
    		}

    change it to

    error_log("\nstart-mark\n","3","/home/irelandswildlife.com/public_html/lscwp.log");
    error_log($filename,"3","/home/irelandswildlife.com/public_html/lscwp.log");
    error_log("\nend-mark\n","3","/home/irelandswildlife.com/public_html/lscwp.log");
    		$basename = basename( $filename );
    		if ( preg_match( '|[-\.]min\.(?:[a-zA-Z]+)$|i', $basename ) ) {
    			return true;
    		}

    then when that error happens again , post the content of /home/irelandswildlife.com/public_html/lscwp.log

    Best regards,

    • This reply was modified 4 years, 2 months ago by qtwrk.
    Plugin Support qtwrk

    (@qtwrk)

    no , sorry , my bad , please edit that file

    change line 228-230

    		if ( strpos( $src, '_litespeed_rm_qs=0' ) || strpos( $src, '/recaptcha' ) ) {
    			return $src;
    		}

    to

    error_log("\nstart-mark\n","3","/home/irelandswildlife.com/public_html/lscwp.log");
    error_log($src,"3","/home/irelandswildlife.com/public_html/lscwp.log");
    error_log("\nend-mark\n","3","/home/irelandswildlife.com/public_html/lscwp.log");
    		
    		if ( strpos( $src, '_litespeed_rm_qs=0' ) || strpos( $src, '/recaptcha' ) ) {
    			return $src;
    		}

    Hi, qtwrk,

    I can confirm above errors, as Calvin mentioned.

    I tried the above tweaks that you shown and did not worked. Same errors. Any ideas?

    Thanks,
    Florin

    [10-Jan-2021 16:01:57 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be stri[10-Jan-2021 16:01:57 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:01:57 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:01:57 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 232
    [10-Jan-2021 16:03:02 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:02 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:02 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 232
    [10-Jan-2021 16:03:09 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:09 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:09 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 232
    [10-Jan-2021 16:03:14 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:14 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:14 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 232
    [10-Jan-2021 16:03:25 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:25 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:25 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 232
    [10-Jan-2021 16:03:25 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:25 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:03:25 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 232

    • This reply was modified 4 years, 2 months ago by florinb1.
    • This reply was modified 4 years, 2 months ago by florinb1.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    @aventurescu

    that is not a fix, but a code to log out more information for us to analyze

    and I would like to ask you to create your own topic for your issue ??

    Best regards,

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I’m 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 ran into the same issue, added the debug code as mentioned with output below. The temporary fix was disabling Page Optimization -> JS Settings -> JS Combine which suppressed the error messages, looks the last log entry was empty which I’d suspect is the generating the error.
    ————-

    start-mark
    https://www.xyz.com/wp-includes/js/wp-embed.min.js?ver=5.6
    end-mark

    start-mark
    https://www.xyz.com/wp-content/plugins/facetwp/assets/js/dist/front.min.js?ver=3.7.1
    end-mark

    start-mark
    https://www.xyz.com/wp-content/plugins/facetwp-submit/facetwp-submit.js?ver=3.7.1
    end-mark

    start-mark

    end-mark

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Litespeed Cache PHP warnings’ is closed to new replies.