ring */ protected function get_file_content( $file ) { return rocket_direct_filesystem()->get_contents( $file ); } /** * Hides unwanted blocks from the HTML to be parsed for optimization * * @since 3.1.4 * @author Remy Perona * * @param string $html HTML content. * @return string */ protected function hide_comments( $html ) { $html = preg_replace( '#.*?#is', '', $html ); $html = preg_replace( '//Uis', '', $html ); return $html; } /** * Get full minified url with ?ver query string. * * @param string $minified_path Path of minified file. * @param string $minified_url Url of minified file. * * @return string */ protected function get_full_minified_url( $minified_path, $minified_url ) { $file_mtime = rocket_direct_filesystem()->mtime( $minified_path ); $version = $file_mtime ? $file_mtime : md5( $minified_url . $this->minify_key ); return add_query_arg( 'ver', $version, $minified_url ); } }