diff --git a/inc/admin/ui/meta-boxes.php b/inc/admin/ui/meta-boxes.php
index 8453e29751..e091f4663f 100644
--- a/inc/admin/ui/meta-boxes.php
+++ b/inc/admin/ui/meta-boxes.php
@@ -44,18 +44,20 @@ function __rocket_cache_options_meta_boxes() {
function __rocket_display_cache_options_meta_boxes() {
/** This filter is documented in inc/admin-bar.php */
if ( current_user_can( apply_filters( 'rocket_capacity', 'manage_options' ) ) ) {
- global $post;
+ global $post, $pagenow;
wp_nonce_field( 'rocket_box_option', '_rocketnonce', false, true );
?>
ID ) );
+ if ( $pagenow !== 'post-new.php' ) {
+ $rejected_uris = array_flip( get_rocket_option( 'cache_reject_uri' ) );
+ $path = rocket_clean_exclude_file( get_permalink( $post->ID ) );
- if ( isset( $rejected_uris[ $path ] ) ) {
- $reject_current_uri = true;
+ if ( isset( $rejected_uris[ $path ] ) ) {
+ $reject_current_uri = true;
+ }
} ?>
>
diff --git a/inc/common/purge.php b/inc/common/purge.php
index 58ff4c56c0..1fb7877ba1 100755
--- a/inc/common/purge.php
+++ b/inc/common/purge.php
@@ -101,6 +101,12 @@ function rocket_clean_post( $post_id ) {
if ( $post->post_status == 'auto-draft' || empty( $post->post_type ) || $post->post_type == 'nav_menu_item' ) {
return;
}
+
+ // Don't purge if post's post type is not public or not publicly queryable
+ $post_type = get_post_type_object( $post->post_type );
+ if ( $post_type->public !== 1 || $post_type->publicly_queryable !== 1 ) {
+ return;
+ }
// Get the post language
$lang = false;
diff --git a/inc/front/minify.php b/inc/front/minify.php
index 5fe932271f..5a4a1de079 100755
--- a/inc/front/minify.php
+++ b/inc/front/minify.php
@@ -89,6 +89,8 @@ function __rocket_insert_minify_js_in_footer() {
$i = 0;
foreach( $files as $file ) {
+ /** This filter is documented in wp-includes/class.wp-scripts.php */
+ $file = apply_filters( 'script_loader_src', $file );
list( $file_host, $file_path ) = get_rocket_parse_url( $file );
// Check if its an external file
@@ -321,6 +323,7 @@ function rocket_minify_js( $buffer )
$excluded_tags = '';
$excluded_js = implode( '|', get_rocket_exclude_js() );
$excluded_js = str_replace( '//' . $home_host , '', $excluded_js );
+ $excluded_js = str_replace( '+', '\+', $excluded_js );
$js_in_footer = get_rocket_minify_js_in_footer();
$wp_content_dirname = ltrim( str_replace( home_url(), '', WP_CONTENT_URL ), '/' ) . '/';
$excluded_external_js = get_rocket_minify_excluded_external_js();
diff --git a/wp-rocket.php b/wp-rocket.php
index b8fdb4a169..52b9e3826d 100755
--- a/wp-rocket.php
+++ b/wp-rocket.php
@@ -1,13 +1,13 @@