Wordpress LScache Plugin: BUG non numeric in media.cls
I am getting this error in my cpanel [STDERR] PHP warning a non-numeric value was encountered in litespeed-cache/src/media.cls.php on line 614 The page I need help with: https://the5krunner.com please try add this before that line 614 error_log(---mark----, 3 , /path/to/your/public_html/lscwp.log) error_log( print_r($dimensions, TRUE), 3 , /path/to/your/public_html/lscwp.log) error_log(---mark----, 3 , /path/to/your/public_html/lscwp.log) and wait for it happens again , after it happens check , search in error log for ---mark--- and post the content of it. hi add this to line 614 of what? Im not THAT techie. just reporting an error i see in cpanel php 8 or 8.1 are same PHP warning a non-numeric value was encountered in litespeed-cache/src/media.cls.php on line 614 this file , line 614, add it before that line this is line 614 of media.cls.php $ori_height = intval( $ori_height $attrs[ width ] / $ori_width ) and it seems to be in the middle of a line of code ie all of this which starts at line 604 // Add missing dimensions if ( defined( LITESPEED_GUEST_OPTM ) || $this->conf( Base::O_MEDIA_ADD_MISSING_SIZES ) ) if ( empty( $attrs[ width ] ) || $attrs[ width ] == auto || empty( $attrs[ height ] ) || $attrs[ height ] == auto ) Debug2::debug( [Media] Missing sizes for image [src] . $attrs[ src ] ) $dimensions = $this->_detect_dimensions( $attrs[ src ] ) if ( $dimensions ) $ori_width = $dimensions[ 0 ] $ori_height = $dimensions[ 1 ] // Calculate height based on width if ( ! empty( $attrs[ width ] ) && $attrs[ width ] != auto ) $ori_height = intval( $ori_height $attrs[ width ] / $ori_width ) elseif ( ! empty( $attrs[ height ] ) && $attrs[ height ] != auto ) $ori_width = intval( $ori_width $attrs[ height ] / $ori_height ) $attrs[ width ] = $ori_width $attrs[ height ] = $ori_height $new_html = preg_replace( #(width|height)=([ ])[^ 2] 2#, , $match[ 0 ] ) $new_html = str_replace(