Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion bwp-minify.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
Plugin Name: Better WordPress Minify
Plugin Name: Tonjoo Better WordPress Minify
Plugin URI: http://betterwp.net/wordpress-plugins/bwp-minify/
Description: Allows you to minify your CSS and JS files for faster page loading for visitors. This plugin uses the PHP library <a href="http://code.google.com/p/minify/">Minify</a> and relies on WordPress's enqueueing system rather than the output buffer (will not break your website in most cases). This plugin is very customizable and easy to use.
Version: 1.3.3
Expand All @@ -18,3 +18,20 @@
// Init the plugin
require_once dirname(__FILE__) . '/includes/class-bwp-minify.php';
$bwp_minify = new BWP_MINIFY();

// Disable plugin in web if not admin
add_filter('bwp_minify_is_loadable','bpw_check_admin');
function bpw_check_admin($status) {
// Not on dashboard
if(!is_admin())
{
if ( current_user_can( 'manage_options' ) ) {
/* A user with admin privileges */
return false;
} else {
/* A user without admin privileges */
return true;
}
}
return $status;
}
10 changes: 10 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ License: GPLv3 or later
Allows you to combine and minify your CSS and JS files to improve page load time.

== Description ==
My Fork of http://betterwp.net/wordpress-plugins/bwp-minify/. In this version when you're log in as an admin the minify script will not run.

### For best result , use this setting :

**General Options**
1. Set Cache buster -> use custom number
2. Cache Age -> 30 Days

**Advanced Options**
1. Advanced -> enable friendly minify url

Allows you to combine and minify your CSS and JS files to improve page load time. This plugin uses the PHP library [Minify](http://code.google.com/p/minify/) and relies on WordPress's enqueueing system rather than the output buffer, which respects the order of CSS and JS files as well as their dependencies. BWP Minify is very customizable and easy to use.

Expand Down