Skip to content

Commit

Permalink
finalize version 1.3.2 for wp.org
Browse files Browse the repository at this point in the history
  • Loading branch information
OddOneOut committed Sep 22, 2014
1 parent 70cd9de commit d587ae8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 28 deletions.
54 changes: 30 additions & 24 deletions includes/class-bwp-minify.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ function __construct($version = '1.3.2')
$this->plugin_title = 'Better WordPress Minify';
// Plugin's version
$this->set_version($version);
$this->set_version('3.1', 'wp');
$this->set_version('5.1.6', 'php');
// Plugin's language domain
$this->domain = 'bwp-minify';
Expand Down Expand Up @@ -588,8 +589,13 @@ public function get_wp_doc_root()
? dirname(str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']))
: ABSPATH;

// script filename contains `wp-admin` when in admin so we need to remove it
return is_admin() ? str_replace('/wp-admin', '', $wp_doc_root) : $wp_doc_root;
// doc root might contain 'network' if on multisite, remove it
$wp_doc_root = is_network_admin() ? str_replace('/network', '', $wp_doc_root) : $wp_doc_root;

// doc root might contain `wp-admin` when in admin, remove it
$wp_doc_root = is_admin() ? str_replace('/wp-admin', '', $wp_doc_root) : $wp_doc_root;

return $wp_doc_root;
}

/**
Expand Down Expand Up @@ -1253,14 +1259,15 @@ public function build_option_pages()
)
),
'role' => array(
'input_minpath' => 'superadmin',
'input_doc_root' => 'superadmin',
'input_cache_dir' => 'superadmin',
'input_maxfiles' => 'superadmin',
'select_time_type' => 'superadmin',
'enable_css_bubble' => 'superadmin',
'enable_cache_file_lock' => 'superadmin',
'enable_debug' => 'superadmin'
'input_minpath' => 'superadmin',
'h2' => 'superadmin',
'input_doc_root' => 'superadmin',
'input_cache_dir' => 'superadmin',
'input_maxage' => 'superadmin',
'select_time_type' => 'superadmin',
'cb4' => 'superadmin',
'cb5' => 'superadmin',
'cb6' => 'superadmin'
)
);

Expand Down Expand Up @@ -1450,6 +1457,9 @@ public function build_option_pages()
. '</p>'
),
'post' => array(
),
'role' => array(
'input_fly_minpath' => 'superadmin'
)
);

Expand Down Expand Up @@ -1724,17 +1734,13 @@ public function build_option_pages()
}
else if ($page == BWP_MINIFY_OPTION_ADVANCED)
{
// Remove all super admin only settings if we're in multisite
// and this is not super-admin
if (self::is_normal_admin())
$bwp_option_page->kill_html_fields($form, array('input_fly_minpath'));

// Also remove nginx config path if not on nginx server
if (!self::is_nginx() || self::is_normal_admin())
$bwp_option_page->kill_html_fields($form, array('input_nginx_config_file'));

// Append rewrite rules to the form when fly min is enabled
if ($this->options['enable_fly_min'] == 'yes')
// Append rewrite rules to the form when fly min is enabled, only
// for superadmin
if ($this->options['enable_fly_min'] == 'yes' && !self::is_normal_admin())
$this->_append_fly_rewrite_rules_to_form($form);
}

Expand Down Expand Up @@ -1962,19 +1968,19 @@ private function _append_fly_rewrite_rules_to_form(&$form)
$this->rewriter_apache->get_wp_config_file()
);

$apache_rules .= '<br /><br />'
. '<textarea class="code" rows="8" cols="90" readonly="readonly">'
$apache_rules .= '<br />'
. '<textarea class="code" style="margin: 10px 0" rows="8" cols="90" readonly="readonly">'
. $this->rewriter_apache->get_generated_wp_rewrite_rules()
. '</textarea>';
. '</textarea><br />';
}

$apache_rules .= sprintf(
__('Below rules should present at the top of <code>%s</code>:'),
$this->rewriter_apache->get_cache_config_file()
);

$apache_rules .= '<br /><br />'
. '<textarea class="code" rows="8" cols="90" readonly="readonly">'
$apache_rules .= '<br />'
. '<textarea class="code" style="margin: 10px 0;" rows="8" cols="90" readonly="readonly">'
. $this->rewriter_apache->get_generated_cache_rewrite_rules()
. '</textarea>';

Expand All @@ -1988,8 +1994,8 @@ private function _append_fly_rewrite_rules_to_form(&$form)
$nginx_rules .= __('Below rules should present in an appropriate position '
. 'within your Nginx configuration file.', $this->domain);

$nginx_rules .= '<br /><br />'
. '<textarea class="code" rows="8" cols="90" readonly="readonly">'
$nginx_rules .= '<br />'
. '<textarea class="code" style="margin: 10px 0" rows="8" cols="90" readonly="readonly">'
. $this->rewriter_nginx->get_generated_wp_rewrite_rules()
. '</textarea>';

Expand Down
6 changes: 3 additions & 3 deletions min/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
$min_builderPassword = 'admin';
$min_errorLogger = false;
$min_allowDebugFlag = false;
$min_cachePath = dirname(dirname(__FILE__)) . '/cache';
$min_cachePath = '/home/kminh/www/wpms.net/cache';
$min_documentRoot = '';
$min_cacheFileLocking = true;
$min_serveOptions['bubbleCssImports'] = true;
$min_serveOptions['maxAge'] = 86400;
$min_serveOptions['maxAge'] = 7200;
$min_serveOptions['minApp']['groupsOnly'] = false;
$min_symlinks = array();
$min_uploaderHoursBehind = 0;
$min_libPath = dirname(__FILE__) . '/lib';
ini_set('zlib.output_compression', '0');
// auto-generated on 2014-09-22 13:14:23
// auto-generated on 2014-09-22 09:28:10
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: OddOneOut
Donate link: http://betterwp.net/wordpress-plugins/bwp-minify/
Tags: minify, minify js, minify css, minify javascript, minify stylesheet, minification, optimization, optimize, stylesheet, css, javascript, js
Requires at least: 3.0
Requires at least: 3.1
Tested up to: 4.0
Stable tag: 1.3.2
License: GPLv3 or later
Expand Down Expand Up @@ -90,6 +90,7 @@ Please [help translate](http://betterwp.net/wordpress-tips/create-pot-file-using
* When friendly minify url is enabled, rewrite rules for both Apache and Nginx will be shown. This is to add support for Nginx as a reverse proxy.
* Fixed a bug that makes the detector fail to commit logs, which results in empty enqueued file lists.
* Other minor fixes and enhancements.
* BWP Minify now requires WordPress 3.1.0 or later.

= 1.3.1 =
* **Enhancements**
Expand Down

0 comments on commit d587ae8

Please sign in to comment.