WP htaccess Control - Version 1.2.1

Version Description

  • Fixed bug on resetting all rules;
  • Fixed critical bug on empty htaccess custom rules;
  • Tested under WP 2.9.2;
Download this release

Release Info

Developer andrad
Plugin Icon wp plugin WP htaccess Control
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2 to 1.2.1

readme.txt CHANGED
@@ -5,8 +5,8 @@ Plugin URI: http://dardna.com/wp-htaccess-control
5
  Donate link:
6
  Tags: permalinks, permalink, author, htaccess, rewrite, redirect
7
  Requires at least: 2.7
8
- Tested up to: 2.9.1
9
- Stable tag: 1.2
10
 
11
  Provides an interface to add custom htaccess rules to the htaccess file generated by Wordpress and customisation of the Author Permalink Base.
12
 
@@ -38,6 +38,11 @@ Provides an interface to add custom htaccess rules to the htaccess file generate
38
 
39
  == Changelog ==
40
 
 
 
 
 
 
41
  = 1.2 =
42
  * Improved htaccess customization giving now much more freedom.
43
 
@@ -70,5 +75,8 @@ Provides an interface to add custom htaccess rules to the htaccess file generate
70
 
71
  == Upgrade Notice ==
72
 
 
 
 
73
  = 1.2 =
74
  * You should try the new htaccess customization possibilities.
5
  Donate link:
6
  Tags: permalinks, permalink, author, htaccess, rewrite, redirect
7
  Requires at least: 2.7
8
+ Tested up to: 2.9.2
9
+ Stable tag: 1.2.1
10
 
11
  Provides an interface to add custom htaccess rules to the htaccess file generated by Wordpress and customisation of the Author Permalink Base.
12
 
38
 
39
  == Changelog ==
40
 
41
+ = 1.2.1 =
42
+ * Fixed bug on resetting all rules;
43
+ * Fixed critical bug on empty htaccess custom rules;
44
+ * Tested under WP 2.9.2;
45
+
46
  = 1.2 =
47
  * Improved htaccess customization giving now much more freedom.
48
 
75
 
76
  == Upgrade Notice ==
77
 
78
+ = 1.2.1 =
79
+ * Fixed critical bugs inserted on 1.2, you should update.
80
+
81
  = 1.2 =
82
  * You should try the new htaccess customization possibilities.
wp-htaccess-control-gui.php CHANGED
@@ -96,7 +96,7 @@ jQuery(document).ready(function(){
96
  <ul class="wphtc-menu">
97
  <li><a class="add" href="<?php echo $purl?>&action=add_rule" title="Add new htaccess redirection pair"><img src="<?php echo $plugin_url?>/gfx/image_new.gif"> Add rule</a></li>
98
  </ul>
99
- <p class="description">These are rewrite pairs(RewriteRule) which Wordpress can add to its rules.</p>
100
  <table id="htaccess-rules" class="form-table">
101
  <?php
102
  $num=count($WPhtc_data['pats'])?count($WPhtc_data['pats']):1;
96
  <ul class="wphtc-menu">
97
  <li><a class="add" href="<?php echo $purl?>&action=add_rule" title="Add new htaccess redirection pair"><img src="<?php echo $plugin_url?>/gfx/image_new.gif"> Add rule</a></li>
98
  </ul>
99
+ <p class="description">These are rewrite pairs (RewriteRule) which Wordpress can add to its rules.</p>
100
  <table id="htaccess-rules" class="form-table">
101
  <?php
102
  $num=count($WPhtc_data['pats'])?count($WPhtc_data['pats']):1;
wp-htaccess-control.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP htaccess Control
4
  Plugin URI: http://dardna.com/wp-htaccess-control
5
  Description: Provides an interface to add custom htaccess rules to the htaccess file generated by wordpress. Also provides customisation of the Author Permalink Base.
6
- Version: 1.2
7
  Author: dardna
8
  Author URI: http://dardna.com
9
  */
@@ -23,35 +23,6 @@ Author URI: http://dardna.com
23
  You should have received a copy of the GNU General Public License
24
  along with this program; if not, write to the Free Software
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
- */
27
- /*
28
-
29
- = 1.1.4 =
30
- * Confirmed compatibility with WP 2.9.1;
31
- * Minor gui changes;
32
-
33
- = 1.1.3 =
34
- * Fixing error on wphtc_cap's preg_replace commited on 1.1.2 (thank you mattcav for the report!);
35
- * Fixing php warning on update without htaccess rules;
36
-
37
- = 1.1.2 =
38
- * No longer creating empty option array on install or reset (globally better option array handling);
39
- * Confirmed compatibility with WP 2.8;
40
- * Still some work to do on the interface;
41
-
42
- = 1.1.1 =
43
- * Fixing screenshot mistake;
44
-
45
- = 1.1 =
46
- * Separated gui file;
47
- * Improved management and gui;
48
-
49
- = 1.0.1 =
50
- * Added GNU license;
51
-
52
- = 1.0 =
53
- * Initial release (poor interface although working).
54
-
55
  */
56
  if (!class_exists("WPhtc")) {
57
  class WPhtc {
@@ -90,6 +61,9 @@ if (!class_exists("WPhtc")) {
90
  $insert="\n\n# Begin Custom htaccess from WP htaccess Control\n".$WPhtc_data['hta_mr']."\n# End Custom htaccess from WP htaccess Control\n";
91
  $new_rules.=str_replace("RewriteEngine On","RewriteEngine On".$insert,$rules);
92
  }
 
 
 
93
  return $new_rules;
94
  }
95
  # WP-htaccess Control options page
@@ -106,6 +80,8 @@ if (!class_exists("WPhtc")) {
106
  case 'reset_rules':
107
  delete_option('WPhtc_data');
108
  $echo.="All rules (Custom Author Permalink + htaccess Custom Rules) reset.";
 
 
109
  break;
110
  # if updating, save new rules in database and flush rewrite rules as if regenerating permalink structure
111
  case 'update':
3
  Plugin Name: WP htaccess Control
4
  Plugin URI: http://dardna.com/wp-htaccess-control
5
  Description: Provides an interface to add custom htaccess rules to the htaccess file generated by wordpress. Also provides customisation of the Author Permalink Base.
6
+ Version: 1.2.1
7
  Author: dardna
8
  Author URI: http://dardna.com
9
  */
23
  You should have received a copy of the GNU General Public License
24
  along with this program; if not, write to the Free Software
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  */
27
  if (!class_exists("WPhtc")) {
28
  class WPhtc {
61
  $insert="\n\n# Begin Custom htaccess from WP htaccess Control\n".$WPhtc_data['hta_mr']."\n# End Custom htaccess from WP htaccess Control\n";
62
  $new_rules.=str_replace("RewriteEngine On","RewriteEngine On".$insert,$rules);
63
  }
64
+ else{
65
+ $new_rules.=$rules;
66
+ }
67
  return $new_rules;
68
  }
69
  # WP-htaccess Control options page
80
  case 'reset_rules':
81
  delete_option('WPhtc_data');
82
  $echo.="All rules (Custom Author Permalink + htaccess Custom Rules) reset.";
83
+ global $wp_rewrite;
84
+ $wp_rewrite->flush_rules();
85
  break;
86
  # if updating, save new rules in database and flush rewrite rules as if regenerating permalink structure
87
  case 'update':