als( $buffer ); } // Minify JavaScript. if ( $enable_js && ( ! defined( 'DONOTROCKETOPTIMIZE' ) || ! DONOTROCKETOPTIMIZE ) && ( ! defined( 'DONOTMINIFYJS' ) || ! DONOTMINIFYJS ) && ! is_rocket_post_excluded_option( 'minify_js' ) ) { $buffer = rocket_minify_files( $buffer, 'js' ); } // Minify CSS. if ( $enable_css && ( ! defined( 'DONOTROCKETOPTIMIZE' ) || ! DONOTROCKETOPTIMIZE ) && ( ! defined( 'DONOTMINIFYCSS' ) || ! DONOTMINIFYCSS ) && ! is_rocket_post_excluded_option( 'minify_css' ) ) { $buffer = rocket_minify_files( $buffer, 'css' ); } // Concatenate Google Fonts. if ( $enable_google_fonts ) { $buffer = rocket_concatenate_google_fonts( $buffer ); } if ( $enable_css || $enable_js || $enable_google_fonts ) { $buffer = rocket_inject_ie_conditionals( $buffer, $conditionals ); } return $buffer; } } if ( ! function_exists( 'rocket_minify_html' ) ) { /** * Minifies inline HTML * * @since 2.10 Do the HTML minification independently and hook it later to prevent conflicts * @since 1.1.12 * @deprecated 3.1 * * @param string $buffer HTML content. * @return string Updated HTML content */ function rocket_minify_html( $buffer ) { _deprecated_function( __FUNCTION__, '3.1' ); if ( ! get_rocket_option( 'minify_html' ) || is_rocket_post_excluded_option( 'minify_html' ) ) { return $buffer; } $html_options = array( 'cssMinifier' => 'rocket_minify_inline_css', ); /** * Filter options of minify inline HTML * * @since 1.1.12 * * @param array $html_options Options of minify inline HTML. */ $html_options = apply_filters( 'rocket_minify_html_options', $html_options ); return Minify_HTML::minify( $buffer, $html_options ); } } if ( ! function_exists( 'rocket_fix_ssl_minify' ) ) { /** * Fix issue with SSL and minification * * @since 2.3 * @deprecated 3.1 * * @param string $url An url to filter to set the scheme to https if needed. * @return string Updated URL */ function rocket_fix_ssl_minify( $url ) { _deprecated_function( __FUNCTION__, '3.1' ); if ( is_ssl() && false === strpos( $url, 'https://' ) && ! in_array( rocket_extract_url_component( $url, PHP_URL_HOST ), get_rocket_cnames_host( array( 'all', 'css_js', 'css', 'js' ) ), true ) ) { $url = str_replace( 'http://', 'https://', $url ); } return $url; } } if ( ! function_exists( 'rocket_minify_i18n_multidomain' ) ) { /** * Compatibility with multilingual plugins & multidomain configuration * * @since 2.6.13 Regression Fix: Apply CDN on minified CSS and JS files by checking the CNAME host * @since 2.6.8 * @deprecated 3.1 * * @param string $url Minified file URL. * @return string Updated minified file URL */ function rocket_minify_i18n_multidomain( $url ) { _deprecated_function( __FUNCTION__, '3.1' ); if ( ! rocket_has_i18n() ) { return $url; } $url_host = rocket_extract_url_component( $url, PHP_URL_HOST ); $zone = array( 'all', 'css_and_js' ); $current_filter = current_filter(); // Add only CSS zone. if ( 'rocket_css_url' === $current_filter ) { $zone[] = 'css'; } // Add only JS zone. if ( 'rocket_js_url' === $current_filter ) { $zone[] = 'js'; } $cnames = get_rocket_cdn_cnames( $zone ); $cnames = array_map( 'rocket_remove_url_protocol' , $cnames ); if ( $url_host !== $_SERVER['HTTP_HOST'] && in_array( $_SERVER['HTTP_HOST'], get_rocket_i18n_host(), true ) && ! in_array( $url_host, $cnames, true ) ) { $url = str_replace( $url_host, $_SERVER['HTTP_HOST'], $url ); } return $url; } } if ( ! function_exists( 'rocket_get_js_enqueued_in_head' ) ) { /** * Get all src for JS files already enqueued in head * * @since 2.10 * @deprecated 3.1 * @author Remy Perona */ function rocket_get_js_enqueued_in_head() { _deprecated_function( __FUNCTION__, '3.1' ); global $wp_scripts, $rocket_js_enqueued_in_head; if ( ! (bool) $wp_scripts->done ) { return; } foreach ( $wp_scripts->done as $handle ) { if ( ! empty( $wp_scripts->registered[ $handle ]->src ) ) { $rocket_js_enqueued_in_head[] = str_replace( '#', '\#', rocket_clean_exclude_file( $wp_scripts->registered[ $handle ]->src ) ); } } } } if ( ! function_exists( 'get_rocket_exclude_files' ) ) { /** * Get all files to exclude from minification/concatenation. * * @since 2.11 * @deprecated 3.1 * @author Remy Perona * * @param string $extension Type of files to exclude. * @return array Array of excluded files. */ function get_rocket_exclude_files( $extension ) { _deprecated_function( __FUNCTION__, '3.1' ); if ( 'css' === $extension ) { $excluded_files = get_rocket_option( 'exclude_css', array() ); /** * Filters CSS files to exclude from minification/concatenation. * * @since 2.6 * * @param array $excluded_files List of excluded CSS files. */ $excluded_files = apply_filters( 'rocket_exclude_css', $excluded_files ); } elseif ( 'js' === $extension ) { global $wp_scripts; $excluded_files = get_rocket_option( 'exclude_js', array() ); if ( get_rocket_option( 'defer_all_js', 0 ) && get_rocket_option( 'defer_all_js_safe', 0 ) ) { $excluded_files[] = rocket_clean_exclude_file( site_url( $wp_scripts->registered['jquery-core']->src ) ); } /** * Filter JS files to exclude from minification/concatenation. * * @since 2.6 * * @param array $js_files List of excluded JS files. */ $excluded_files = apply_filters( 'rocket_exclude_js', $excluded_files ); } return $excluded_files; } } if ( ! function_exists( 'rocket_concatenate_google_fonts' ) ) { /** * Concatenates Google Fonts tags (http://fonts.googleapis.com/css?...) * * @since 2.3 * @deprecated 3.1 * * @param string $buffer HTML content. * @return string Modified HTML content */ function rocket_concatenate_google_fonts( $buffer ) { _deprecated_function( __FUNCTION__, '3.1' ); // Get all Google Fonts CSS files. $buffer_without_comments = preg_replace( '//Uis', '', $buffer ); preg_match_all( '/])+)?(?:\s+href\s*=\s*([\'"])((?:https?:)?\/\/fonts\.googleapis\.com\/css(?:(?!\1).)+)\1)(?:\s+[^>]*)?>/iU', $buffer_without_comments, $matches ); if ( ! $matches[2] || 1 === count( $matches ) ) { return $buffer; } $fonts = array(); $subsets = array(); foreach ( $matches[2] as $k => $font ) { // Get fonts name. $font = str_replace( array( '%7C', '%7c' ), '|', $font ); $font = explode( 'family=', $font ); $font = ( isset( $font[1] ) ) ? explode( '&', $font[1] ) : array(); // Add font to the collection. $fonts = array_merge( $fonts, explode( '|', reset( $font ) ) ); // Add subset to collection. $subset = ( is_array( $font ) ) ? end( $font ) : ''; if ( false !== strpos( $subset, 'subset=' ) ) { $subset = explode( 'subset=', $subset ); $subsets = array_merge( $subsets, explode( ',', $subset[1] ) ); } // Delete the Google Fonts tag. $buffer = str_replace( $matches[0][ $k ], '', $buffer ); } // Concatenate fonts tag. $subsets = ( $subsets ) ? '&subset=' . implode( ',', array_filter( array_unique( $subsets ) ) ) : ''; $fonts = implode( '|', array_filter( array_unique( $fonts ) ) ); $fonts = str_replace( '|', '%7C', $fonts ); if ( ! empty( $fonts ) ) { $fonts = ''; $buffer = preg_replace( '//U', '' . $fonts, $buffer, 1 ); } return $buffer; } } if ( ! function_exists( 'rocket_minify_inline_css' ) ) { /** * Minifies inline CSS * * @since 1.1.6 * @deprecated 3.1 * * @param string $css HTML content. * @return string Updated HTML content */ function rocket_minify_inline_css( $css ) { _deprecated_function( __FUNCTION__, '3.1' ); $minify = new Minify\CSS( $css ); return $minify->minify(); } } if ( ! function_exists( 'rocket_minify_inline_js' ) ) { /** * Minifies inline JavaScript * * @since 1.1.6 * @deprecated 3.1 * * @param string $js HTML content. * @return string Updated HTML content */ function rocket_minify_inline_js( $js ) { _deprecated_function( __FUNCTION__, '3.1' ); $minify = new Minify\JS( $js ); return $minify->minify(); } } if ( ! function_exists( 'rocket_extract_ie_conditionals' ) ) { /** * Extracts IE conditionals tags and replace them with placeholders * * @since 1.0 * @deprecated 3.1 * * @param string $buffer HTML content. * @return string Updated HTML content */ function rocket_extract_ie_conditionals( $buffer ) { _deprecated_function( __FUNCTION__, '3.1' ); preg_match_all( '//is', $buffer, $conditionals_match ); $buffer = preg_replace( '//is', '{{WP_ROCKET_CONDITIONAL}}', $buffer ); $conditionals = array(); foreach ( $conditionals_match[0] as $conditional ) { $conditionals[] = $conditional; } return array( $buffer, $conditionals ); } } if ( ! function_exists( 'rocket_inject_ie_conditionals' ) ) { /** * Replaces WP Rocket placeholders with IE condtional tags * * @since 1.0 * @deprecated 3.1 * * @param string $buffer HTML content. * @param array $conditionals An array of HTML conditional tags. * @return string Updated HTML content */ function rocket_inject_ie_conditionals( $buffer, $conditionals ) { _deprecated_function( __FUNCTION__, '3.1' ); foreach ( $conditionals as $conditional ) { if ( false !== strpos( $buffer, '{{WP_ROCKET_CONDITIONAL}}' ) ) { $buffer = preg_replace( '/{{WP_ROCKET_CONDITIONAL}}/', $conditional, $buffer, 1 ); } else { break; } } return $buffer; } } if ( ! function_exists( 'rocket_minify_files' ) ) { /** * Parses the buffer to minify the CSS and JS files * * @since 2.11 * @since 2.1 * @deprecated 3.1 * * @param string $buffer HTML output. * @param string $extension Type of files to minify. * @return string Updated HTML output. */ function rocket_minify_files( $buffer, $extension ) { _deprecated_function( __FUNCTION__, '3.1' ); global $wp_scripts, $rocket_js_enqueued_in_head; if ( 'css' === $extension ) { $concatenate = get_rocket_option( 'minify_concatenate_css', false ) ? true : false; // Get all css files with this regex. preg_match_all( apply_filters( 'rocket_minify_css_regex_pattern', '//iU' ), $buffer, $tags_match, PREG_SET_ORDER ); } if ( 'js' === $extension ) { $js_files_in_head = ''; $concatenate = get_rocket_option( 'minify_concatenate_js', false ) ? true : false; if ( $rocket_js_enqueued_in_head && is_array( $rocket_js_enqueued_in_head ) ) { $js_files_in_head = implode( '|', $rocket_js_enqueued_in_head ); } // Get all js files with this regex. preg_match_all( apply_filters( 'rocket_minify_js_regex_pattern', '#]+?src=[\'|"]([^\'|"]+\.js?.+)[\'|"].*>(?:<\/script>)#iU' ), $buffer, $tags_match, PREG_SET_ORDER ); } $original_buffer = $buffer; $files = array(); $excluded_files = array(); $external_js_files = array(); foreach ( $tags_match as $tag ) { // Don't minify external files. if ( is_rocket_external_file( $tag[1], $extension ) ) { if ( 'js' === $extension && $concatenate ) { $host = rocket_extract_url_component( $tag[1], PHP_URL_HOST ); $excluded_external_js = get_rocket_minify_excluded_external_js(); if ( ! isset( $excluded_external_js[ $host ] ) ) { $external_js_files[] = $tag[0]; } } continue; } // Don't minify excluded files. if ( is_rocket_minify_excluded_file( $tag, $extension ) ) { if ( $concatenate && 'js' === $extension && get_rocket_option( 'defer_all_js' ) && get_rocket_option( 'defer_all_js_safe' ) && false !== strpos( $tag[1], $wp_scripts->registered['jquery-core']->src ) ) { if ( get_rocket_option( 'remove_query_strings' ) ) { $external_js_files['jquery-cache-busting'] = str_replace( $tag[1], get_rocket_browser_cache_busting( $tag[1], 'script_loader_src' ), $tag[0] ); $buffer = str_replace( $tag[0], $external_js_files['jquery-cache-busting'], $buffer ); } else { $external_js_files[] = $tag[0]; } continue; } $excluded_files[] = $tag; continue; } if ( $concatenate ) { if ( 'js' === $extension ) { $file_path = rocket_clean_exclude_file( $tag[1] ); if ( ! empty( $js_files_in_head ) && preg_match( '#(' . $js_files_in_head . ')#', $file_path ) ) { $files['header'][] = strtok( $tag[1], '?' ); } else { $files['footer'][] = strtok( $tag[1], '?' ); } } else { $files[] = strtok( $tag[1], '?' ); } $buffer = str_replace( $tag[0], '', $buffer ); continue; } // Don't minify if file is already minified. if ( preg_match( '/(?:-|\.)min.' . $extension . '/iU', $tag[1] ) ) { $excluded_files[] = $tag; continue; } // Don't minify jQuery included in WP core since it's already minified but without .min in the filename. if ( ! empty( $wp_scripts->registered['jquery-core']->src ) && false !== strpos( $tag[1], $wp_scripts->registered['jquery-core']->src ) ) { $excluded_files[] = $tag; continue; } $files[] = $tag; } if ( get_rocket_option( 'remove_query_strings' ) ) { foreach ( $excluded_files as $tag ) { if ( 'css' === $extension ) { $tag_cache_busting = str_replace( $tag[1], get_rocket_browser_cache_busting( $tag[1], 'style_loader_src' ), $tag[0] ); } if ( 'js' === $extension ) { $tag_cache_busting = str_replace( $tag[1], get_rocket_browser_cache_busting( $tag[1], 'script_loader_src' ), $tag[0] ); } $buffer = str_replace( $tag[0], $tag_cache_busting, $buffer ); } } if ( empty( $files ) ) { return $buffer; } if ( ! $concatenate ) { foreach ( $files as $tag ) { $minify_url = get_rocket_minify_url( $tag[1], $extension ); if ( ! $minify_url ) { continue; } $minify_tag = str_replace( $tag[1], $minify_url, $tag[0] ); if ( 'css' === $extension ) { $minify_tag = str_replace( $tag[2], ' data-minify="1" ' . $tag[2], $minify_tag ); } if ( 'js' === $extension ) { $minify_tag = str_replace( '>', ' data-minify="1">', $minify_tag ); } $buffer = str_replace( $tag[0], $minify_tag, $buffer ); } return $buffer; } if ( 'js' === $extension ) { $minify_header_url = get_rocket_minify_url( $files['header'], $extension ); $minify_url = get_rocket_minify_url( $files['footer'], $extension ); if ( ! $minify_header_url && ! $minify_url ) { return $original_buffer; } foreach ( $external_js_files as $external_js_file ) { $buffer = str_replace( $external_js_file, '', $buffer ); } $minify_header_tag = ''; $buffer = preg_replace( '//U', '' . implode( '', $external_js_files ) . $minify_header_tag, $buffer, 1 ); $minify_tag = ''; return str_replace( '', $minify_tag . '', $buffer ); } if ( 'css' === $extension ) { $minify_url = get_rocket_minify_url( $files, $extension ); if ( ! $minify_url ) { return $original_buffer; } $minify_tag = ''; return preg_replace( '//U', '' . $minify_tag, $buffer, 1 ); } } } if ( ! function_exists( 'is_rocket_external_file' ) ) { /** * Determines if the file is external * * @since 2.11 * @deprecated 3.1 * @author Remy Perona * * @param string $url URL of the file. * @param string $extension File extension. * @return bool True if external, false otherwise */ function is_rocket_external_file( $url, $extension ) { _deprecated_function( __FUNCTION__, '3.1' ); $file = get_rocket_parse_url( $url ); $wp_content = get_rocket_parse_url( WP_CONTENT_URL ); $hosts = get_rocket_cnames_host( array( 'all', 'css_and_js', $extension ) ); $hosts[] = $wp_content['host']; $langs = get_rocket_i18n_uri(); // Get host for all langs. if ( $langs ) { foreach ( $langs as $lang ) { $hosts[] = rocket_extract_url_component( $lang, PHP_URL_HOST ); } } $hosts_index = array_flip( array_unique( $hosts ) ); // URL has domain and domain is not part of the internal domains. if ( isset( $file['host'] ) && ! empty( $file['host'] ) && ! isset( $hosts_index[ $file['host'] ] ) ) { return true; } // URL has no domain and doesn't contain the WP_CONTENT path or wp-includes. if ( ! isset( $file['host'] ) && ! preg_match( '#(' . $wp_content['path'] . '|wp-includes)#', $file['path'] ) ) { return true; } return false; } } if ( ! function_exists( 'is_rocket_minify_excluded_file' ) ) { /** * Determines if it is a file excluded from minification * * @since 2.11 * @deprecated 3.1 * @author Remy Perona * * @param array $tag Array containing the matches from the regex. * @param string $extension File extension. * @return bool True if it is a file excluded, false otherwise */ function is_rocket_minify_excluded_file( $tag, $extension ) { _deprecated_function( __FUNCTION__, '3.1' ); // File should not be minified. if ( false !== strpos( $tag[0], 'data-minify=' ) || false !== strpos( $tag[0], 'data-no-minify=' ) ) { return true; } if ( 'css' === $extension ) { // CSS file media attribute is not all or screen. if ( false !== strpos( $tag[0], 'media=' ) && ! preg_match( '/media=["\'](?:["\']|[^"\']*?(all|screen)[^"\']*?["\'])/iU', $tag[0] ) ) { return true; } if ( false !== strpos( $tag[0], 'only screen and' ) ) { return true; } } $file_path = rocket_extract_url_component( $tag[1], PHP_URL_PATH ); // File extension is not .css or .js. if ( pathinfo( $file_path, PATHINFO_EXTENSION ) !== $extension ) { return true; } $excluded_files = get_rocket_exclude_files( $extension ); if ( ! empty( $excluded_files ) ) { foreach ( $excluded_files as $i => $excluded_file ) { $excluded_files[ $i ] = str_replace( '#', '\#', $excluded_file ); } $excluded_files = implode( '|', $excluded_files ); // File is excluded from minification/concatenation. if ( preg_match( '#^(' . $excluded_files . ')$#', $file_path ) ) { return true; } } return false; } } if ( ! function_exists( 'get_rocket_minify_url' ) ) { /** * Creates the minify URL if the minification is successful * * @since 2.11 * @deprecated 3.1 * @author Remy Perona * * @param string|array $files Original file(s) URL(s). * @param string $extension File(s) extension. * @return string|bool The minify URL if successful, false otherwise */ function get_rocket_minify_url( $files, $extension ) { _deprecated_function( __FUNCTION__, '3.1' ); if ( empty( $files ) ) { return false; } $hosts = get_rocket_cnames_host( array( 'all', 'css_and_js', $extension ) ); $hosts['home'] = rocket_extract_url_component( home_url(), PHP_URL_HOST ); $hosts_index = array_flip( $hosts ); $minify_key = get_rocket_option( 'minify_' . $extension . '_key', create_rocket_uniqid() ); if ( is_string( $files ) ) { $file = get_rocket_parse_url( $files ); $file_path = rocket_url_to_path( strtok( $files, '?' ), $hosts_index ); $unique_id = md5( $files . $minify_key ); $filename = preg_replace( '/\.(' . $extension . ')$/', '-' . $unique_id . '.' . $extension, ltrim( rocket_realpath( $file['path'] ), '/' ) ); } else { foreach ( $files as $file ) { $file_path[] = rocket_url_to_path( $file, $hosts_index ); } $files_hash = implode( ',', $files ); $filename = md5( $files_hash . $minify_key ) . '.' . $extension; } $minified_file = WP_ROCKET_MINIFY_CACHE_PATH . get_current_blog_id() . '/' . $filename; if ( ! file_exists( $minified_file ) ) { $minified_content = rocket_minify( $file_path, $extension ); if ( ! $minified_content ) { return false; } $minify_filepath = rocket_write_minify_file( $minified_content, $minified_file ); if ( ! $minify_filepath ) { return false; } } $minify_url = get_rocket_cdn_url( WP_ROCKET_MINIFY_CACHE_URL . get_current_blog_id() . '/' . $filename, array( 'all', 'css_and_js', $extension ) ); if ( 'css' === $extension ) { /** * Filters CSS file URL with CDN hostname * * @since 2.1 * * @param string $minify_url Minified file URL. */ return apply_filters( 'rocket_css_url', $minify_url ); } if ( 'js' === $extension ) { /** * Filters JavaScript file URL with CDN hostname * * @since 2.1 * * @param string $minify_url Minified file URL. */ return apply_filters( 'rocket_js_url', $minify_url ); } } } if ( ! function_exists( 'rocket_minify' ) ) { /** * Minifies the content * * @since 2.11 * @deprecated 3.1 * @author Remy Perona * * @param string|array $files File(s) to minify. * @param string $extension File(s) extension. * @return string|bool Minified content, false if empty */ function rocket_minify( $files, $extension ) { _deprecated_function( __FUNCTION__, '3.1' ); if ( 'css' === $extension ) { $minify = new Minify\CSS(); } elseif ( 'js' === $extension ) { $minify = new Minify\JS(); } $files = (array) $files; foreach ( $files as $file ) { $file_content = rocket_direct_filesystem()->get_contents( $file ); if ( 'css' === $extension ) { /** * Filters the Document Root path to use during CSS minification to rewrite paths * * @since 2.7 * * @param string The Document Root path. */ $document_root = apply_filters( 'rocket_min_documentRoot', ABSPATH ); $file_content = rocket_cdn_css_properties( Minify_CSS_UriRewriter::rewrite( $file_content, dirname( $file ), $document_root ) ); } $minify->add( $file_content ); } $minified_content = $minify->minify(); if ( empty( $minified_content ) ) { return false; } return $minified_content; } } if ( ! function_exists( 'rocket_write_minify_file' ) ) { /** * Writes the minified content to a file * * @since 2.11 * @deprecated 3.1 * @author Remy Perona * * @param string $content Minified content. * @param string $minified_file Path to the minified file to write in. * @return bool True if successful, false otherwise */ function rocket_write_minify_file( $content, $minified_file ) { _deprecated_function( __FUNCTION__, '3.1' ); if ( file_exists( $minified_file ) ) { return true; } if ( ! rocket_mkdir_p( dirname( $minified_file ) ) ) { return false; } return rocket_put_content( $minified_file, $content ); } } if ( ! function_exists( 'get_rocket_minify_excluded_external_js' ) ) { /** * Get all JS externals files to exclude of the minification process * * @since 2.6 * @deprecated 3.1 * * @return array Array of excluded external JS */ function get_rocket_minify_excluded_external_js() { _deprecated_function( __FUNCTION__, '3.1' ); /** * Filters JS externals files to exclude from the minification process (do not move into the header) * * @since 2.2 * * @param array $hostnames Hostname of JS files to exclude. */ $excluded_external_js = apply_filters( 'rocket_minify_excluded_external_js', array( 'forms.aweber.com', 'video.unrulymedia.com', 'gist.github.com', 'stats.wp.com', 'stats.wordpress.com', 'www.statcounter.com', 'widget.rafflecopter.com', 'widget-prime.rafflecopter.com', 'widget.supercounters.com', 'releases.flowplayer.org', 'tools.meetaffiliate.com', 'c.ad6media.fr', 'cdn.stickyadstv.com', 'www.smava.de', 'contextual.media.net', 'app.getresponse.com', 'ap.lijit.com', 'adserver.reklamstore.com', 's0.wp.com', 'wprp.zemanta.com', 'files.bannersnack.com', 'smarticon.geotrust.com', 'js.gleam.io', 'script.ioam.de', 'ir-na.amazon-adsystem.com', 'web.ventunotech.com', 'verify.authorize.net', 'ads.themoneytizer.com', 'embed.finanzcheck.de', 'imagesrv.adition.com', 'js.juicyads.com', 'form.jotformeu.com', 'speakerdeck.com', 'content.jwplatform.com', 'ads.investingchannel.com', 'app.ecwid.com', 'www.industriejobs.de', 's.gravatar.com', 'cdn.jsdelivr.net', 'cdnjs.cloudflare.com', 'code.jquery.com', ) ); return array_flip( $excluded_external_js ); } } if ( ! function_exists( 'rocket_cache_dynamic_resource' ) ) { /** * Create a static file for dynamically generated CSS/JS from PHP * * @since 2.9 * @deprecated 3.1 * @author Remy Perona * * @param string $src dynamic CSS/JS file URL. * @return string URL of the generated static file */ function rocket_cache_dynamic_resource( $src ) { _deprecated_function( __FUNCTION__, '3.1' ); global $pagenow; if ( defined( 'DONOTROCKETOPTIMIZE' ) && DONOTROCKETOPTIMIZE ) { return $src; } if ( is_user_logged_in() && ! get_rocket_option( 'cache_logged_user' ) ) { return $src; } if ( 'wp-login.php' === $pagenow ) { return $src; } if ( false === strpos( $src, '.php' ) ) { return $src; } /** * Filters files to exclude from static dynamic resources * * @since 2.9.3 * @author Remy Perona * * @param array $excluded_files An array of filepath to exclude. */ $excluded_files = apply_filters( 'rocket_exclude_static_dynamic_resources', array() ); $excluded_files[] = '/wp-admin/admin-ajax.php'; $excluded_files = array_flip( $excluded_files ); if ( isset( $excluded_files[ rocket_clean_exclude_file( $src ) ] ) ) { return $src; } $full_src = ( substr( $src, 0, 2 ) === '//' ) ? rocket_add_url_protocol( $src ) : $src; $current_filter = current_filter(); switch ( $current_filter ) { case 'script_loader_src': $extension = 'js'; $minify_key = get_rocket_option( 'minify_js_key' ); break; case 'style_loader_src': $extension = 'css'; $minify_key = get_rocket_option( 'minify_css_key' ); break; } $hosts = get_rocket_cnames_host( array( 'all', 'css_and_js', $extension ) ); $hosts[] = rocket_extract_url_component( home_url(), PHP_URL_HOST ); $hosts_index = array_flip( $hosts ); $file = get_rocket_parse_url( $full_src ); $file['query'] = remove_query_arg( 'ver', $file['query'] ); if ( $file['query'] ) { return $src; } if ( '' === $file['host'] ) { $full_src = home_url() . $src; } if ( strpos( $full_src, '://' ) !== false && ! isset( $hosts_index[ $file['host'] ] ) ) { return $src; } $relative_src = ltrim( $file['path'], '/' ); $abspath_src = rocket_url_to_path( strtok( $full_src, '?' ), $hosts_index ); /* * Filters the dynamic resource cache filename * * @since 2.9 * @author Remy Perona * * @param string $filename filename for the cache file */ $cache_dynamic_resource_filename = apply_filters( 'rocket_dynamic_resource_cache_filename', preg_replace( '/\.(php)$/', '-' . $minify_key . '.' . $extension, $relative_src ) ); $cache_busting_paths = rocket_get_cache_busting_paths( $cache_dynamic_resource_filename, $extension ); if ( file_exists( $cache_busting_paths['filepath'] ) && is_readable( $cache_busting_paths['filepath'] ) ) { return $cache_busting_paths['url']; } if ( rocket_fetch_and_cache_busting( $full_src, $cache_busting_paths, $abspath_src, $current_filter ) ) { return $cache_busting_paths['url']; } return $src; } } if ( ! function_exists( 'rocket_browser_cache_busting' ) ) { /** * Wrapper for get_rocket_browser_cache_busting except when minification is active. * * @since 2.9 * @deprecated 3.1 * @author Remy Perona * * @param string $src CSS/JS file URL. * @return string updated CSS/JS file URL. */ function rocket_browser_cache_busting( $src ) { _deprecated_function( __FUNCTION__, '3.1' ); $current_filter = current_filter(); if ( 'style_loader_src' === $current_filter && get_rocket_option( 'minify_css' ) && ( ! defined( 'DONOTMINIFYCSS' ) || ! DONOTMINIFYCSS ) && ! is_rocket_post_excluded_option( 'minify_css' ) ) { return $src; } if ( 'script_loader_src' === $current_filter && get_rocket_option( 'minify_js' ) && ( ! defined( 'DONOTMINIFYJS' ) || ! DONOTMINIFYJS ) && ! is_rocket_post_excluded_option( 'minify_js' ) ) { return $src; } return get_rocket_browser_cache_busting( $src, $current_filter ); } } if ( ! function_exists( 'get_rocket_browser_cache_busting' ) ) { /** * Create a cache busting file with the version in the filename * * @since 2.9 * @deprecated 3.1 * @author Remy Perona * * @param string $src CSS/JS file URL. * @param string $current_filter Current WordPress filter. * @return string updated CSS/JS file URL */ function get_rocket_browser_cache_busting( $src, $current_filter = '' ) { _deprecated_function( __FUNCTION__, '3.1' ); global $pagenow; if ( defined( 'DONOTROCKETOPTIMIZE' ) && DONOTROCKETOPTIMIZE ) { return $src; } if ( ! get_rocket_option( 'remove_query_strings' ) ) { return $src; } if ( is_user_logged_in() && ! get_rocket_option( 'cache_logged_user', 0 ) ) { return $src; } if ( 'wp-login.php' === $pagenow ) { return $src; } if ( false === strpos( $src, '.css' ) && false === strpos( $src, '.js' ) ) { return $src; } if ( false !== strpos( $src, 'ver=' . $GLOBALS['wp_version'] ) ) { $src = rtrim( str_replace( array( 'ver=' . $GLOBALS['wp_version'], '?&', '&&' ), array( '', '?', '&' ), $src ), '?&' ); } /** * Filters files to exclude from cache busting * * @since 2.9.3 * @author Remy Perona * * @param array $excluded_files An array of filepath to exclude. */ $excluded_files = apply_filters( 'rocket_exclude_cache_busting', array() ); $excluded_files = implode( '|', $excluded_files ); if ( preg_match( '#^(' . $excluded_files . ')$#', rocket_clean_exclude_file( $src ) ) ) { return $src; } if ( empty( $current_filter ) ) { $current_filter = current_filter(); } $full_src = ( substr( $src, 0, 2 ) === '//' ) ? rocket_add_url_protocol( $src ) : $src; switch ( $current_filter ) { case 'script_loader_src': $extension = 'js'; break; case 'style_loader_src': $extension = 'css'; break; } $hosts = get_rocket_cnames_host( array( 'all', 'css_and_js', $extension ) ); $hosts['home'] = rocket_extract_url_component( home_url(), PHP_URL_HOST ); $hosts_index = array_flip( $hosts ); $file = get_rocket_parse_url( $full_src ); if ( '' === $file['host'] ) { $full_src = home_url() . $src; } if ( false !== strpos( $full_src, '://' ) && ! isset( $hosts_index[ $file['host'] ] ) ) { return $src; } if ( empty( $file['query'] ) ) { return $src; } $relative_src = ltrim( $file['path'] . '?' . $file['query'], '/' ); $abspath_src = rocket_url_to_path( strtok( $full_src, '?' ), $hosts_index ); $cache_busting_filename = preg_replace( '/\.(js|css)\?(?:timestamp|ver)=([^&]+)(?:.*)/', '-$2.$1', $relative_src ); if ( $cache_busting_filename === $relative_src ) { return $src; } /* * Filters the cache busting filename * * @since 2.9 * @author Remy Perona * * @param string $filename filename for the cache busting file */ $cache_busting_filename = apply_filters( 'rocket_cache_busting_filename', $cache_busting_filename ); $cache_busting_paths = rocket_get_cache_busting_paths( $cache_busting_filename, $extension ); if ( file_exists( $cache_busting_paths['filepath'] ) && is_readable( $cache_busting_paths['filepath'] ) ) { return $cache_busting_paths['url']; } if ( rocket_fetch_and_cache_busting( $abspath_src, $cache_busting_paths, $abspath_src, $current_filter ) ) { return $cache_busting_paths['url']; } return $src; } } if ( ! function_exists( 'rocket_dns_prefetch_buffer' ) ) { /** * Inserts html code for domain names to DNS prefetch in the buffer before creating the cache file * * @since 2.0 * @deprecated 3.1 * @author Jonathan Buttigieg * * @param String $buffer HTML content. * @return String Updated buffer */ function rocket_dns_prefetch_buffer( $buffer ) { _deprecated_function( __FUNCTION__, '3.1' ); $dns_link_tags = ''; $domains = rocket_get_dns_prefetch_domains(); if ( (bool) $domains ) { foreach ( $domains as $domain ) { $dns_link_tags .= ''; } } $old_ie_conditional_tag = ''; /** * Allow to print an empty IE conditional tag to speed up old IE versions to load CSS & JS files * * @since 2.6.5 * * @param bool true will print the IE conditional tag */ if ( apply_filters( 'do_rocket_old_ie_prefetch_conditional_tag', true ) ) { $old_ie_conditional_tag = ''; } // Insert all DNS prefecth tags in head. $buffer = preg_replace( '//', '' . $old_ie_conditional_tag . $dns_link_tags, $buffer, 1 ); return $buffer; } } Máy Phát Điện DHY 145KSE(132-145KVA) - Maytonghopbmt

Máy Phát Điện DHY 145KSE(132-145KVA)

Model: DHY 145KSE (3 Pha)
Công suất liên tục: 132 KVA
Công suất tối đa: 145 KVA
Dòng điện: 190.5 A
Điện thế: 230/400V
Tần số: 50Hz
Cổng kết nối ATS: Có
Khởi động: Đề nổ
Tốc độ quay: 1500 vòng/phút
Số xi lanh: 6
Bình nhiên liệu: Loại lớn, cho phép chạy nhiều giờ liên tục
Trọng lượng: 2080 Kg
Kích thước: 3400 x 1000 x 1700 (mm)

491.000.000 

Added to wishlistRemoved from wishlist 0

Thông số kỹ thuật

Thông số kỹ thuật máy phát điện Hyundai DHY 145KSE

TỔ MÁY
Công suất liên tục (KVA) 132
Công suất dự phòng (KVA) 145
Tần số (Hz) 50
Điện thế (V) 230/400
Dòng điện  (A) 190.5
Cổng kết nối ATS Có
Ắc quy 110 Ah
Bình nhiên liệu (L) 245
Dung tích nước làm mát  (L) 34.4
Tiêu hao nhiên liệu (50/100% CS) 30 L/h
Thời gian chạy liên tục (h 100%) 8
Độ ồn cách 7m   (dBA) 72
Trọng lượng toàn bộ (kg) 2,080
Kích thước  L×W×H (mm) 3400x1000x1700
ĐỘNG CƠ
Model Hyundai HY6M3L-DA
Công suất  (kW/1500rpm) 120
Tốc độ quay 1.500 V/Ph
Điều chỉnh tốc độ Điện
Số xi lanh 6
Khởi động Đề điện
Dung tích xi lanh  (CC) 5900
ĐK x HTrình Piston  (mm) 102×120
Tỉ số nén 17:1
Dung tích dầu bôi trơn  (L) 16.4
ĐẦU PHÁT
Model 274E
Loại Không chổi than
Công suất liên tục  (KW) 140
Hệ số công suất  (Cosφ) 0.8
Cấp cách điện H
Cấp bảo vệ IP23
Điều chỉnh điện áp Tự động AVR AS440
HỆ THỐNG CẢNH BÁO
Bảng điều khiển: ComAp Model: MRS 10
Báo cường độ dòng điện
Báo tần số
Báo điện áp các pha cả điện áp pha trung lập
Báo hệ số công suất
Tự động điều chỉnh mức nhiên liệu
Báo áp suất dầu bôi trơn
Báo nhiệt độ nước làm mát cao
Báo điện áp Pin
Báo tốc độ vòng quay động cơ
Đếm số giờ chạy của động cơ
Chức năng giám sát
Giám sát Rơle đầu ra
Điều chỉnh độ sáng màn LCD
PIN password
Chức năng đa ngôn ngữ
Chức năng cảnh báo và tự động tắt máy
Báo điện áp cao/thấp
Báo tần số áp cao/thấp
Tốc độ quay động cơ cao/thấp
Áp suất dầu thấp
Nhiệt độ động cơ cao
Điện áp acquy cao/thấp
Cường độ dòng điện cao
Điều chỉnh thời gian khởi động
VỎ CHỐNG ỒN Vỏ chống ồn Hyundai đồng bộ
Chất liệu vỏ Vỏ chống ồn được chế tạo bằng thép tấm không gỉ
Sơn Sơn phủ tĩnh điện chống ăn mòn, trầy sước, phù hợp với điều kiện khí hậu Việt Nam
Cách âm Vỏ được đệm lớp mút cách âm với khả năng cách âm cao

User Reviews

0.0 out of 5
0
0
0
0
0
Write a review

There are no reviews yet.

Be the first to review “Máy Phát Điện DHY 145KSE(132-145KVA)”

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Máy Phát Điện DHY 145KSE(132-145KVA)
Máy Phát Điện DHY 145KSE(132-145KVA)

491.000.000 

Maytonghopbmt
Logo
Shopping cart