WP htaccess Control - Version 3.3.3

Version Description

(28/01/2013) =

  • Fix: PHP and WordPress deprecation warnings.
Download this release

Release Info

Developer antonioandra.de
Plugin Icon wp plugin WP htaccess Control
Version 3.3.3
Comparing to
See all releases

Code changes from version 3.3.2 to 3.3.3

Files changed (3) hide show
  1. readme.txt +4 -0
  2. wp-htaccess-control-ui.php +47 -46
  3. wp-htaccess-control.php +31 -15
readme.txt CHANGED
@@ -82,6 +82,10 @@ For WordPress versions prior to 3.4 use the plugin version 2.7.2.1.
82
 
83
  == Changelog ==
84
 
 
 
 
 
85
  = 3.3.2 (28/01/2013) =
86
 
87
  * Fix: empty categories should also have the proper template instead of a 404.
82
 
83
  == Changelog ==
84
 
85
+ = 3.3.3 (28/01/2013) =
86
+
87
+ * Fix: PHP and WordPress deprecation warnings.
88
+
89
  = 3.3.2 (28/01/2013) =
90
 
91
  * Fix: empty categories should also have the proper template instead of a 404.
wp-htaccess-control-ui.php CHANGED
@@ -47,7 +47,7 @@ $WPhtc->page_action();
47
  <div class="updated fade" id="message" style="background-color: rgb(255, 251, 204);"><p><?php echo $echo;?></p></div>
48
  <?php }
49
  # Donation Message
50
- if($WPhtc->data['donation_hidden_time']&&$WPhtc->data['donation_hidden_time']<time()){?>
51
  <div class="updated">
52
  <p>
53
  <strong>Is this plugin useful? Consider making a donation encouraging me to continue supporting it!</strong>
@@ -84,8 +84,8 @@ $WPhtc->page_action();
84
  <tr valign="top">
85
  <th scope="row" style="width:18%;"><?php _e('Author Base', 'wp-htaccess-control'); ?></th>
86
  <td >
87
- <input type="text" name="WPhtc_cap" value="<?php echo $WPhtc->data['cap']; ?>" />
88
- <p><code><?php bloginfo('home')?>/<em><?php _e('(your-base)', 'wp-htaccess-control');?></em>/admin</code></p>
89
  </td>
90
  <td valign="middle">
91
  <p class="description"><?php _e('Permalink settings must be set and not Default (/?p=123).', 'wp-htaccess-control'); ?></p>
@@ -97,7 +97,7 @@ $WPhtc->page_action();
97
  <tr valign="top">
98
  <th>Google XML Sitemap</th>
99
  <td>
100
- <input type="checkbox" name="WPhtc_sm_enabled" value="true" <?php if($WPhtc->data['sm_enabled']){ echo "checked";}?>/> <?php _e('Apply Custom Author Permalink on Generated Sitemap', 'wp-htaccess-control'); ?>
101
  </td>
102
  <td valign="middle" >
103
  <p class="description"><?php _e('Leave "Include author pages" unchecked on Google XML Sitemap options page if using this.', 'wp-htaccess-control'); ?></p>
@@ -117,8 +117,8 @@ $WPhtc->page_action();
117
  <tr valign="top">
118
  <th scope="row" style="width:18%;"><?php _e('Page Base', 'wp-htaccess-control'); ?></th>
119
  <td >
120
- <input type="text" name="WPhtc_cpp" value="<?php echo $WPhtc->data['cpp']; ?>" />
121
- <p><code><?php bloginfo('home')?>/<em><?php _e('(your-base)', 'wp-htaccess-control');?></em>/2</code></p>
122
  </td>
123
  <td valign="middle">
124
  <p class="description"><?php _e('Permalink settings must be set and not Default (/?p=123).', 'wp-htaccess-control'); ?></p>
@@ -138,8 +138,8 @@ $WPhtc->page_action();
138
  <tr valign="top">
139
  <th scope="row" style="width:18%;"><?php _e('Search Base', 'wp-htaccess-control'); ?></th>
140
  <td >
141
- <input type="text" name="WPhtc_custom_search_permalink" value="<?php echo $WPhtc->data['custom_search_permalink']; ?>" />
142
- <p><code><?php bloginfo('home')?>/<em><?php _e('(your-base)', 'wp-htaccess-control');?></em>/search-term</code></p>
143
  </td>
144
  <td valign="middle">
145
  <p class="description"><?php _e('Permalink settings must be set and not Default (/?p=123).', 'wp-htaccess-control'); ?></p>
@@ -160,11 +160,11 @@ $WPhtc->page_action();
160
  <tr valign="top">
161
  <th scope="row" style="width:18%;"><?php _e('Remove Author Base', 'wp-htaccess-control'); ?></th>
162
  <td >
163
- <input type="checkbox" name="WPhtc_remove_author_base" <?php if($WPhtc->data['remove_author_base']){echo "checked=checked";} ?> />
164
  </td>
165
  <td valign="middle">
166
  <p class="description"><?php _e('If active, the author base will be removed from permalinks:'); ?></p>
167
- <p class="description"><code><?php bloginfo('home')?>/<?php _e('the-author', 'wp-htaccess-control'); ?></code></p>
168
  <p class="description"><strong><?php _e('Beware:'); ?></strong> <?php _e('This could conflict with the removal of the category base on a situation where a category slug is the same as a user nicename.'); ?></p>
169
  </td>
170
  </tr>
@@ -175,11 +175,11 @@ $WPhtc->page_action();
175
  <tr valign="top">
176
  <th scope="row" style="width:18%;"><?php _e('Remove', 'wp-htaccess-control'); echo " ".$taxonomy->labels->name." " ; _e('Base', 'wp-htaccess-control'); ?></th>
177
  <td >
178
- <input type="checkbox" name="WPhtc_remove_base[<?php echo $taxonomy->name; ?>]" <?php if($WPhtc->data['remove_taxonomy_base'][$taxonomy->name]){echo "checked=checked";} ?> />
179
  </td>
180
  <td valign="middle">
181
  <p class="description"><?php _e('If active, the'); echo " ".$taxonomy->labels->name." "; _e('base will be removed from permalinks:'); ?></p>
182
- <p class="description"><code><?php bloginfo('home')?>/<?php echo $taxonomy->name;?>_term</code></p>
183
  <p class="description"><strong><?php _e('Beware:'); ?></strong> <?php _e('This could conflict with the removal of the other permalink bases on a situation where a term slug is the same.'); ?></p>
184
  </td>
185
  </tr>
@@ -201,12 +201,12 @@ $WPhtc->page_action();
201
  <tr valign="top">
202
  <th scope="row" style="width:18%;"><?php _e('Create', 'wp-htaccess-control'); echo " ".$taxonomy->labels->name." " ; _e('Archives', 'wp-htaccess-control'); ?></th>
203
  <td >
204
- <input type="checkbox" name="WPhtc_create_archive[<?php echo $taxonomy->name; ?>]" <?php if($WPhtc->data['create_archive'][$taxonomy->name]){echo "checked=checked";} ?> />
205
  </td>
206
  <td valign="middle">
207
  <p class="description"><?php _e('If active, taxonomy-based archives will be accessible:', 'wp-htaccess-control'); ?></p>
208
- <p class="description"><code><?php bloginfo('home')?>/<?php echo $taxonomy->name; ?>_base/<?php echo $taxonomy->name; ?>_term/2010</code></p>
209
- <p class="description"><code><?php bloginfo('home')?>/<?php echo $taxonomy->name; ?>_base/<?php echo $taxonomy->name; ?>_term/2010/12</code></p>
210
  <p class="description"><?php _e("This will also work if you've removed the", 'wp-htaccess-control'); ?> <?php echo $taxonomy->labels->name; ?> <?php _e("base.", 'wp-htaccess-control'); ?></p>
211
  </td>
212
  </tr>
@@ -225,7 +225,7 @@ $WPhtc->page_action();
225
  <tr valign="top">
226
  <th scope="row" style="width:18%;"><?php _e("Remove hierarchy", 'wp-htaccess-control'); ?></th>
227
  <td style="width:3%;" valign="middle">
228
- <input type="checkbox" name="WPhtc_remove_hierarchy" value="true" <?php if($WPhtc->data['remove_hierarchy']){ echo "checked";}?>/>
229
  </td>
230
  <td valign="middle">
231
  <p class="description"><?php _e("Remove hierarchy from taxonomy permalinks (this might be interesting when removing the category base).", 'wp-htaccess-control'); ?></p>
@@ -234,7 +234,7 @@ $WPhtc->page_action();
234
  <!--<tr valign="top">
235
  <th scope="row" style="width:18%;"><?php _e(".html suffix", 'wp-htaccess-control'); ?></th>
236
  <td style="width:3%;" valign="middle">
237
- <input type="checkbox" name="WPhtc_suffix_html" value="true" <?php if($WPhtc->data['suffix_html']){ echo "checked";}?>/>
238
  </td>
239
  <td valign="middle">
240
  <p class="description"><?php _e("Add '.html' at the end of taxonomy permalinks.", 'wp-htaccess-control'); ?></p>
@@ -251,7 +251,7 @@ $WPhtc->page_action();
251
  <table class="form-table wphtc-inputs">
252
  <tr valign="top">
253
  <td>
254
- <textarea name="WPhtc_hta" style="width:100%;" rows="7"><?php echo stripslashes($WPhtc->data['hta']); ?></textarea>
255
  </td>
256
  <td style="width:50%;">
257
  <p class="description"><?php _e('This rules will be printed before any Wordpress rules.', 'wp-htaccess-control'); ?></p>
@@ -274,9 +274,9 @@ $WPhtc->page_action();
274
  <table class="form-table wphtc-inputs">
275
  <tr valign="top">
276
  <td>
277
- <textarea name="WPhtc_wp_hta" style="width:100%;" rows="7" <?php if($WPhtc->data['jim_morgan_hta']){ echo "readonly='true' class='readonly'";}?>><?php echo stripslashes($WPhtc->data['wp_hta']); ?></textarea>
278
  <p class="description"><?php _e('Leave empty for default.', 'wp-htaccess-control'); ?></p>
279
- <p><input type="checkbox" name="WPhtc_jim_morgan_hta" value="true" <?php if($WPhtc->data['jim_morgan_hta']){ echo "checked";}?>/>
280
  <?php _e("<strong>Use <a href='http://www.webmasterworld.com/apache/4053973.htm'>Jim Morgan's wordpress htaccess</a></strong> (has been reported to \"speed up your WP mod_rewrite code by a factor of more than two\")", 'wp-htaccess-control'); ?></p>
281
  </td>
282
  <td style="width:50%;">
@@ -284,7 +284,7 @@ $WPhtc->page_action();
284
  <p class="description"><?php _e('Please double check them before saving as a mistake could make your site inaccessible.', 'wp-htaccess-control'); ?></p>
285
  <p class="description"><?php _e('Original rules:', 'wp-htaccess-control'); ?></p>
286
  <p class="description">
287
- <code><?php echo nl2br(htmlspecialchars(substr($WPhtc->data['htaccess_original'],0,-1)));?></code>
288
  </p>
289
  </td>
290
  </tr>
@@ -300,7 +300,7 @@ $WPhtc->page_action();
300
  <tr valign="top">
301
  <th scope="row" style="width:18%;"><?php _e('ServerSignature', 'wp-htaccess-control'); ?></th>
302
  <td style="width:3%;" valign="middle">
303
- <input type="checkbox" name="WPhtc_disable_serversignature" value="true" <?php if($WPhtc->data['disable_serversignature']){ echo "checked";}?>/>
304
  </td>
305
  <td valign="middle">
306
  <p class="description"><?php _e('Disable the ServerSignature on server generated error pages.', 'wp-htaccess-control'); ?></p>
@@ -309,7 +309,7 @@ $WPhtc->page_action();
309
  <tr valign="top">
310
  <th scope="row"><?php _e('Indexes', 'wp-htaccess-control'); ?></th>
311
  <td style="width:3%;" valign="middle">
312
- <input type="checkbox" name="WPhtc_disable_indexes" value="true" <?php if($WPhtc->data['disable_indexes']){ echo "checked";}?>/>
313
  </td>
314
  <td valign="middle">
315
  <p class="description"><?php _e('Disable directory browsing.', 'wp-htaccess-control'); ?></p>
@@ -318,7 +318,7 @@ $WPhtc->page_action();
318
  <tr valign="top">
319
  <th scope="row"><?php _e('Protect wp-config.php file', 'wp-htaccess-control'); ?></th>
320
  <td style="width:3%;" valign="middle">
321
- <input type="checkbox" name="WPhtc_protect_wp_config" value="true" <?php if($WPhtc->data['protect_wp_config']){ echo "checked";}?>/> </td>
322
  <td valign="middle">
323
  <p class="description"><?php _e('Deny access to wp-config.php file.', 'wp-htaccess-control'); ?></p>
324
  </td>
@@ -326,7 +326,7 @@ $WPhtc->page_action();
326
  <tr valign="top">
327
  <th scope="row"><?php _e('Protect htaccess file', 'wp-htaccess-control'); ?></th>
328
  <td style="width:3%;" valign="middle">
329
- <input type="checkbox" name="WPhtc_protect_htaccess" value="true" <?php if($WPhtc->data['protect_htaccess']){ echo "checked";}?>/> </td>
330
  <td valign="middle">
331
  <p class="description"><?php _e('Deny access to .htaccess file.', 'wp-htaccess-control'); ?></p>
332
  </td>
@@ -334,7 +334,7 @@ $WPhtc->page_action();
334
  <tr valign="top">
335
  <th scope="row"><?php _e('Protect comments.php', 'wp-htaccess-control'); ?></th>
336
  <td style="width:3%;" valign="middle">
337
- <input type="checkbox" name="WPhtc_protect_comments" value="true" <?php if($WPhtc->data['protect_comments']){ echo "checked";}?>/> </td>
338
  <td valign="middle">
339
  <p class="description"><?php _e('Deny comment posting to no referrer requests. This will avoid spam bots coming from nowhere.', 'wp-htaccess-control'); ?></p>
340
  </td>
@@ -342,7 +342,7 @@ $WPhtc->page_action();
342
  <tr valign="top">
343
  <th scope="row"><?php _e('mod_gzip', 'wp-htaccess-control'); ?></th>
344
  <td style="width:3%;" valign="middle">
345
- <input type="checkbox" name="WPhtc_gzip" value="true" <?php if($WPhtc->data['gzip']){ echo "checked";}?>/>
346
  </td>
347
  <td valign="middle">
348
  <p class="description"><?php _e('Use mod_gzip if available.', 'wp-htaccess-control'); ?></p>
@@ -351,7 +351,7 @@ $WPhtc->page_action();
351
  <tr valign="top">
352
  <th scope="row"><?php _e('mod_deflate', 'wp-htaccess-control'); ?></th>
353
  <td style="width:3%;" valign="middle">
354
- <input type="checkbox" name="WPhtc_deflate" value="true" <?php if($WPhtc->data['deflate']){ echo "checked";}?>/>
355
  </td>
356
  <td valign="middle">
357
  <p class="description"><?php _e('Use mod_deflate if available.', 'wp-htaccess-control'); ?></p>
@@ -360,7 +360,7 @@ $WPhtc->page_action();
360
  <tr valign="top">
361
  <th scope="row"><?php _e('Limit Upload Size', 'wp-htaccess-control'); ?></th>
362
  <td style="width:3%;" valign="middle">
363
- <input type="text" name="WPhtc_up_limit" value="<?php echo $WPhtc->data['up_limit']?>"/>
364
  </td>
365
  <td valign="middle">
366
  <p class="description"><?php _e('If set, this value in MB will be used as limit to file uploads.', 'wp-htaccess-control'); ?></p>
@@ -369,7 +369,7 @@ $WPhtc->page_action();
369
  <tr valign="top">
370
  <th scope="row"><?php _e('Admin Email', 'wp-htaccess-control'); ?></th>
371
  <td style="width:3%;">
372
- <input type="text" name="WPhtc_admin_email" value="<?php echo $WPhtc->data['admin_email']?>"/>
373
  </td>
374
  <td valign="middle">
375
  <p class="description"><?php _e('If set, this will be used as the admin email on server generated error pages.', 'wp-htaccess-control'); ?></p>
@@ -378,7 +378,7 @@ $WPhtc->page_action();
378
  <tr valign="top">
379
  <th scope="row"><?php _e('Disable image hotlinking', 'wp-htaccess-control'); ?></th>
380
  <td style="width:3%;">
381
- <input type="text" name="WPhtc_disable_hotlink" value="<?php echo $WPhtc->data['disable_hotlink']?>"/>
382
  </td>
383
  <td valign="middle">
384
  <p class="description"><?php _e('If set, this url will be used as redirection to hotlinked images (you should be using an image url here). If you prefer no output on hotlinked images use "_".', 'wp-htaccess-control'); ?></p>
@@ -387,7 +387,7 @@ $WPhtc->page_action();
387
  <tr valign="top">
388
  <th scope="row"><?php _e('Disable file hotlinking extensions', 'wp-htaccess-control'); ?></th>
389
  <td style="width:3%;">
390
- <input type="text" name="WPhtc_disable_file_hotlink_ext" value="<?php echo $WPhtc->data['disable_file_hotlink_ext']?>"/>
391
  </td>
392
  <td valign="middle">
393
  <p class="description"><?php _e('If set, this file extensions will not be hotlinkable.', 'wp-htaccess-control'); ?></p>
@@ -397,7 +397,7 @@ $WPhtc->page_action();
397
  <tr valign="top">
398
  <th scope="row"><?php _e('File hotlinking redirection', 'wp-htaccess-control'); ?></th>
399
  <td style="width:3%;">
400
- <input type="text" name="WPhtc_disable_file_hotlink_redir" value="<?php echo $WPhtc->data['disable_file_hotlink_redir']?>"/>
401
  </td>
402
  <td valign="middle">
403
  <p class="description"><?php _e('If set, this url will be used as redirection for hotlinked files.', 'wp-htaccess-control'); ?></p>
@@ -406,7 +406,7 @@ $WPhtc->page_action();
406
  <tr valign="top">
407
  <th scope="row"><?php _e('500 error', 'wp-htaccess-control'); ?></th>
408
  <td style="width:3%;" valign="middle">
409
- <input type="text" name="WPhtc_redirect_500" value="<?php echo $WPhtc->data['redirect_500']?>"/>
410
  </td>
411
  <td valign="middle">
412
  <p class="description"><?php _e('If set, this path will be used as page to 500 errors (example: /error.php).', 'wp-htaccess-control'); ?></p>
@@ -415,7 +415,7 @@ $WPhtc->page_action();
415
  <tr valign="top">
416
  <th scope="row"><?php _e('403 error', 'wp-htaccess-control'); ?></th>
417
  <td style="width:3%;" valign="middle">
418
- <input type="text" name="WPhtc_redirect_403" value="<?php echo $WPhtc->data['redirect_403']?>"/>
419
  </td>
420
  <td valign="middle">
421
  <p class="description"><?php _e('If set, this path will be used as page to 403 errors (example: /error.php).', 'wp-htaccess-control'); ?></p>
@@ -426,8 +426,8 @@ $WPhtc->page_action();
426
  <td style="width:3%;" valign="middle">
427
  <select name="WPhtc_canon">
428
  <option value=""></option>
429
- <option value="www" <?php if($WPhtc->data['canon']=='www'){echo "selected";} ?>><?php _e('Force WWW', 'wp-htaccess-control'); ?></option>
430
- <option value="simple" <?php if($WPhtc->data['canon']=='simple'){echo "selected";} ?>><?php _e('Force non-WWW', 'wp-htaccess-control'); ?></option>
431
  </select>
432
  </td>
433
  <td valign="middle">
@@ -446,7 +446,7 @@ $WPhtc->page_action();
446
  <tr valign="top">
447
  <th scope="row" style="width:18%;"><?php _e('Maintenance Active', 'wp-htaccess-control'); ?></th>
448
  <td valign="middle">
449
- <input type="checkbox" name="WPhtc_maintenance_active" value="true" <?php if($WPhtc->data['maintenance_active']){ echo "checked";}?>/>
450
  </td>
451
  <td valign="middle">
452
  <p class="description"><?php _e('Toggles Maintenance Mode.', 'wp-htaccess-control'); ?></p>
@@ -455,7 +455,7 @@ $WPhtc->page_action();
455
  <tr valign="top">
456
  <th scope="row" style="width:18%;"><?php _e('Allowed IPs', 'wp-htaccess-control'); ?></th>
457
  <td>
458
- <textarea name="WPhtc_maintenance_ips"><?php if(isset($WPhtc->data['maintenance_ips'])){echo implode($WPhtc->data['maintenance_ips'],"\n");}?></textarea>
459
  </td>
460
  <td valign="middle">
461
  <p class="description"><?php _e('List of allowed IPs.', 'wp-htaccess-control'); ?></p>
@@ -465,7 +465,7 @@ $WPhtc->page_action();
465
  <tr valign="top">
466
  <th scope="row" style="width:18%;"><?php _e('Redirection', 'wp-htaccess-control'); ?></th>
467
  <td>
468
- <input type="text" name="WPhtc_maintenance_redirection" value="<?php echo $WPhtc->data['maintenance_redirection']?>"/>
469
  </td>
470
  <td valign="middle">
471
  <p class="description"><?php _e('If set, this will be used as redirection for disallowed IPs. This could be an external url or a document on your server (local paths begin with a trailing slash)', 'wp-htaccess-control'); ?></p>
@@ -474,6 +474,7 @@ $WPhtc->page_action();
474
  </table>
475
  </div>
476
  <!-- Login Control -->
 
477
  <div class="wphtc-section">
478
  <div class="wphtc-section-title stuffbox">
479
  <div title="Click to toggle" class="handlediv" style="background:url('<?php bloginfo("wpurl")?>/wp-admin/images/menu-bits.gif') no-repeat scroll left -111px transparent"><br></div>
@@ -491,7 +492,7 @@ $WPhtc->page_action();
491
  <tr valign="top">
492
  <th scope="row" style="width:18%;"><?php _e('Disable wp-login.php', 'wp-htaccess-control'); ?></th>
493
  <td>
494
- <input type="checkbox" name="WPhtc_login_disabled" value="true" <?php if($WPhtc->data['login_disabled']){ echo "checked";}?>/>
495
  </td>
496
  <td valign="middle">
497
  <p class="description"><?php _e('This is the main switch. Make sure you know what you\'re doing.', 'wp-htaccess-control'); ?></p>
@@ -500,7 +501,7 @@ $WPhtc->page_action();
500
  <tr valign="top">
501
  <th scope="row" style="width:18%;"><?php _e('Redirect', 'wp-htaccess-control'); ?></th>
502
  <td valign="middle">
503
- <input type="text" name="WPhtc_login_redirection" value="<?php echo $WPhtc->data['login_redirection']?>"/>
504
  </td>
505
  <td valign="middle">
506
  <p class="description"><?php _e('This will be used as redirection url. You might use something like "member-login" to redirect people to "http://yoursite.com/member-login/". If empty the home page will be served as redirection.', 'wp-htaccess-control'); ?></p>
@@ -509,9 +510,9 @@ $WPhtc->page_action();
509
  <tr valign="top">
510
  <th scope="row" style="width:18%;"><?php _e('Allowed IPs', 'wp-htaccess-control'); ?></th>
511
  <td>
512
- <textarea name="WPhtc_login_ips"><?php if(isset($WPhtc->data['login_ips'])){echo implode($WPhtc->data['login_ips'],"\n");}?></textarea>
513
  </td>
514
- <td valign="middle">
515
  <p class="description"><?php _e('List of IPs allowed to access wp-login.php.', 'wp-htaccess-control'); ?></p>
516
  <p class="description"><?php _e('Make sure you are have a static IP when using this.'); ?></p>
517
  </td>
@@ -519,7 +520,7 @@ $WPhtc->page_action();
519
  <tr valign="top">
520
  <th scope="row" style="width:18%;"><?php _e('Half-mode', 'wp-htaccess-control'); ?></th>
521
  <td>
522
- <input type="checkbox" name="WPhtc_login_half_mode" value="true" <?php if($WPhtc->data['login_half_mode']){ echo "checked";}?>/>
523
  </td>
524
  <td valign="middle">
525
  <p class="description"><?php _e('(BETA) If set, this will still allow access to POST (login) requests, logout and to the password recovery form. I don\'t think this is very useful at the moment (login error messages will still show up on wp-login.php) but may be helpful for AJAX use.', 'wp-htaccess-control'); ?></p>
@@ -541,7 +542,7 @@ $WPhtc->page_action();
541
  </div>
542
  <div class="wphtc-inputs start-open">
543
  <p>
544
- <code><?php echo str_replace(array("&lt;br /&gt;","&lt;br/&gt;"),"<br/>",htmlspecialchars($WPhtc->data['cur_hta']));?></code>
545
  </p>
546
  </div>
547
  </div>
47
  <div class="updated fade" id="message" style="background-color: rgb(255, 251, 204);"><p><?php echo $echo;?></p></div>
48
  <?php }
49
  # Donation Message
50
+ if($WPhtc->get_data('donation_hidden_time')&&$WPhtc->get_data('donation_hidden_time')<time()){?>
51
  <div class="updated">
52
  <p>
53
  <strong>Is this plugin useful? Consider making a donation encouraging me to continue supporting it!</strong>
84
  <tr valign="top">
85
  <th scope="row" style="width:18%;"><?php _e('Author Base', 'wp-htaccess-control'); ?></th>
86
  <td >
87
+ <input type="text" name="WPhtc_cap" value="<?php echo $WPhtc->get_data('cap'); ?>" />
88
+ <p><code><?php bloginfo('url')?>/<em><?php _e('(your-base)', 'wp-htaccess-control');?></em>/admin</code></p>
89
  </td>
90
  <td valign="middle">
91
  <p class="description"><?php _e('Permalink settings must be set and not Default (/?p=123).', 'wp-htaccess-control'); ?></p>
97
  <tr valign="top">
98
  <th>Google XML Sitemap</th>
99
  <td>
100
+ <input type="checkbox" name="WPhtc_sm_enabled" value="true" <?php if($WPhtc->get_data('sm_enabled')){ echo "checked";}?>/> <?php _e('Apply Custom Author Permalink on Generated Sitemap', 'wp-htaccess-control'); ?>
101
  </td>
102
  <td valign="middle" >
103
  <p class="description"><?php _e('Leave "Include author pages" unchecked on Google XML Sitemap options page if using this.', 'wp-htaccess-control'); ?></p>
117
  <tr valign="top">
118
  <th scope="row" style="width:18%;"><?php _e('Page Base', 'wp-htaccess-control'); ?></th>
119
  <td >
120
+ <input type="text" name="WPhtc_cpp" value="<?php echo $WPhtc->get_data('cpp'); ?>" />
121
+ <p><code><?php bloginfo('url')?>/<em><?php _e('(your-base)', 'wp-htaccess-control');?></em>/2</code></p>
122
  </td>
123
  <td valign="middle">
124
  <p class="description"><?php _e('Permalink settings must be set and not Default (/?p=123).', 'wp-htaccess-control'); ?></p>
138
  <tr valign="top">
139
  <th scope="row" style="width:18%;"><?php _e('Search Base', 'wp-htaccess-control'); ?></th>
140
  <td >
141
+ <input type="text" name="WPhtc_custom_search_permalink" value="<?php echo $WPhtc->get_data('custom_search_permalink'); ?>" />
142
+ <p><code><?php bloginfo('url')?>/<em><?php _e('(your-base)', 'wp-htaccess-control');?></em>/search-term</code></p>
143
  </td>
144
  <td valign="middle">
145
  <p class="description"><?php _e('Permalink settings must be set and not Default (/?p=123).', 'wp-htaccess-control'); ?></p>
160
  <tr valign="top">
161
  <th scope="row" style="width:18%;"><?php _e('Remove Author Base', 'wp-htaccess-control'); ?></th>
162
  <td >
163
+ <input type="checkbox" name="WPhtc_remove_author_base" <?php if($WPhtc->get_data('remove_author_base')){echo "checked=checked";} ?> />
164
  </td>
165
  <td valign="middle">
166
  <p class="description"><?php _e('If active, the author base will be removed from permalinks:'); ?></p>
167
+ <p class="description"><code><?php bloginfo('url')?>/<?php _e('the-author', 'wp-htaccess-control'); ?></code></p>
168
  <p class="description"><strong><?php _e('Beware:'); ?></strong> <?php _e('This could conflict with the removal of the category base on a situation where a category slug is the same as a user nicename.'); ?></p>
169
  </td>
170
  </tr>
175
  <tr valign="top">
176
  <th scope="row" style="width:18%;"><?php _e('Remove', 'wp-htaccess-control'); echo " ".$taxonomy->labels->name." " ; _e('Base', 'wp-htaccess-control'); ?></th>
177
  <td >
178
+ <input type="checkbox" name="WPhtc_remove_base[<?php echo $taxonomy->name; ?>]" <?php if($WPhtc->get_data('remove_taxonomy_base', $taxonomy->name)){echo "checked=checked";} ?> />
179
  </td>
180
  <td valign="middle">
181
  <p class="description"><?php _e('If active, the'); echo " ".$taxonomy->labels->name." "; _e('base will be removed from permalinks:'); ?></p>
182
+ <p class="description"><code><?php bloginfo('url')?>/<?php echo $taxonomy->name;?>_term</code></p>
183
  <p class="description"><strong><?php _e('Beware:'); ?></strong> <?php _e('This could conflict with the removal of the other permalink bases on a situation where a term slug is the same.'); ?></p>
184
  </td>
185
  </tr>
201
  <tr valign="top">
202
  <th scope="row" style="width:18%;"><?php _e('Create', 'wp-htaccess-control'); echo " ".$taxonomy->labels->name." " ; _e('Archives', 'wp-htaccess-control'); ?></th>
203
  <td >
204
+ <input type="checkbox" name="WPhtc_create_archive[<?php echo $taxonomy->name; ?>]" <?php if($WPhtc->get_data('create_archive', $taxonomy->name)){echo "checked=checked";} ?> />
205
  </td>
206
  <td valign="middle">
207
  <p class="description"><?php _e('If active, taxonomy-based archives will be accessible:', 'wp-htaccess-control'); ?></p>
208
+ <p class="description"><code><?php bloginfo('url')?>/<?php echo $taxonomy->name; ?>_base/<?php echo $taxonomy->name; ?>_term/2010</code></p>
209
+ <p class="description"><code><?php bloginfo('url')?>/<?php echo $taxonomy->name; ?>_base/<?php echo $taxonomy->name; ?>_term/2010/12</code></p>
210
  <p class="description"><?php _e("This will also work if you've removed the", 'wp-htaccess-control'); ?> <?php echo $taxonomy->labels->name; ?> <?php _e("base.", 'wp-htaccess-control'); ?></p>
211
  </td>
212
  </tr>
225
  <tr valign="top">
226
  <th scope="row" style="width:18%;"><?php _e("Remove hierarchy", 'wp-htaccess-control'); ?></th>
227
  <td style="width:3%;" valign="middle">
228
+ <input type="checkbox" name="WPhtc_remove_hierarchy" value="true" <?php if($WPhtc->get_data('remove_hierarchy')){ echo "checked";}?>/>
229
  </td>
230
  <td valign="middle">
231
  <p class="description"><?php _e("Remove hierarchy from taxonomy permalinks (this might be interesting when removing the category base).", 'wp-htaccess-control'); ?></p>
234
  <!--<tr valign="top">
235
  <th scope="row" style="width:18%;"><?php _e(".html suffix", 'wp-htaccess-control'); ?></th>
236
  <td style="width:3%;" valign="middle">
237
+ <input type="checkbox" name="WPhtc_suffix_html" value="true" <?php if($WPhtc->get_data('suffix_html')){ echo "checked";}?>/>
238
  </td>
239
  <td valign="middle">
240
  <p class="description"><?php _e("Add '.html' at the end of taxonomy permalinks.", 'wp-htaccess-control'); ?></p>
251
  <table class="form-table wphtc-inputs">
252
  <tr valign="top">
253
  <td>
254
+ <textarea name="WPhtc_hta" style="width:100%;" rows="7"><?php echo stripslashes($WPhtc->get_data('hta')); ?></textarea>
255
  </td>
256
  <td style="width:50%;">
257
  <p class="description"><?php _e('This rules will be printed before any Wordpress rules.', 'wp-htaccess-control'); ?></p>
274
  <table class="form-table wphtc-inputs">
275
  <tr valign="top">
276
  <td>
277
+ <textarea name="WPhtc_wp_hta" style="width:100%;" rows="7" <?php if($WPhtc->get_data('jim_morgan_hta')){ echo "readonly='true' class='readonly'";}?>><?php echo stripslashes($WPhtc->get_data('wp_hta')); ?></textarea>
278
  <p class="description"><?php _e('Leave empty for default.', 'wp-htaccess-control'); ?></p>
279
+ <p><input type="checkbox" name="WPhtc_jim_morgan_hta" value="true" <?php if($WPhtc->get_data('jim_morgan_hta')){ echo "checked";}?>/>
280
  <?php _e("<strong>Use <a href='http://www.webmasterworld.com/apache/4053973.htm'>Jim Morgan's wordpress htaccess</a></strong> (has been reported to \"speed up your WP mod_rewrite code by a factor of more than two\")", 'wp-htaccess-control'); ?></p>
281
  </td>
282
  <td style="width:50%;">
284
  <p class="description"><?php _e('Please double check them before saving as a mistake could make your site inaccessible.', 'wp-htaccess-control'); ?></p>
285
  <p class="description"><?php _e('Original rules:', 'wp-htaccess-control'); ?></p>
286
  <p class="description">
287
+ <code><?php echo nl2br(htmlspecialchars(substr($WPhtc->get_data('htaccess_original'),0,-1)));?></code>
288
  </p>
289
  </td>
290
  </tr>
300
  <tr valign="top">
301
  <th scope="row" style="width:18%;"><?php _e('ServerSignature', 'wp-htaccess-control'); ?></th>
302
  <td style="width:3%;" valign="middle">
303
+ <input type="checkbox" name="WPhtc_disable_serversignature" value="true" <?php if($WPhtc->get_data('disable_serversignature')){ echo "checked";}?>/>
304
  </td>
305
  <td valign="middle">
306
  <p class="description"><?php _e('Disable the ServerSignature on server generated error pages.', 'wp-htaccess-control'); ?></p>
309
  <tr valign="top">
310
  <th scope="row"><?php _e('Indexes', 'wp-htaccess-control'); ?></th>
311
  <td style="width:3%;" valign="middle">
312
+ <input type="checkbox" name="WPhtc_disable_indexes" value="true" <?php if($WPhtc->get_data('disable_indexes')){ echo "checked";}?>/>
313
  </td>
314
  <td valign="middle">
315
  <p class="description"><?php _e('Disable directory browsing.', 'wp-htaccess-control'); ?></p>
318
  <tr valign="top">
319
  <th scope="row"><?php _e('Protect wp-config.php file', 'wp-htaccess-control'); ?></th>
320
  <td style="width:3%;" valign="middle">
321
+ <input type="checkbox" name="WPhtc_protect_wp_config" value="true" <?php if($WPhtc->get_data('protect_wp_config')){ echo "checked";}?>/> </td>
322
  <td valign="middle">
323
  <p class="description"><?php _e('Deny access to wp-config.php file.', 'wp-htaccess-control'); ?></p>
324
  </td>
326
  <tr valign="top">
327
  <th scope="row"><?php _e('Protect htaccess file', 'wp-htaccess-control'); ?></th>
328
  <td style="width:3%;" valign="middle">
329
+ <input type="checkbox" name="WPhtc_protect_htaccess" value="true" <?php if($WPhtc->get_data('protect_htaccess')){ echo "checked";}?>/> </td>
330
  <td valign="middle">
331
  <p class="description"><?php _e('Deny access to .htaccess file.', 'wp-htaccess-control'); ?></p>
332
  </td>
334
  <tr valign="top">
335
  <th scope="row"><?php _e('Protect comments.php', 'wp-htaccess-control'); ?></th>
336
  <td style="width:3%;" valign="middle">
337
+ <input type="checkbox" name="WPhtc_protect_comments" value="true" <?php if($WPhtc->get_data('protect_comments')){ echo "checked";}?>/> </td>
338
  <td valign="middle">
339
  <p class="description"><?php _e('Deny comment posting to no referrer requests. This will avoid spam bots coming from nowhere.', 'wp-htaccess-control'); ?></p>
340
  </td>
342
  <tr valign="top">
343
  <th scope="row"><?php _e('mod_gzip', 'wp-htaccess-control'); ?></th>
344
  <td style="width:3%;" valign="middle">
345
+ <input type="checkbox" name="WPhtc_gzip" value="true" <?php if($WPhtc->get_data('gzip')){ echo "checked";}?>/>
346
  </td>
347
  <td valign="middle">
348
  <p class="description"><?php _e('Use mod_gzip if available.', 'wp-htaccess-control'); ?></p>
351
  <tr valign="top">
352
  <th scope="row"><?php _e('mod_deflate', 'wp-htaccess-control'); ?></th>
353
  <td style="width:3%;" valign="middle">
354
+ <input type="checkbox" name="WPhtc_deflate" value="true" <?php if($WPhtc->get_data('deflate')){ echo "checked";}?>/>
355
  </td>
356
  <td valign="middle">
357
  <p class="description"><?php _e('Use mod_deflate if available.', 'wp-htaccess-control'); ?></p>
360
  <tr valign="top">
361
  <th scope="row"><?php _e('Limit Upload Size', 'wp-htaccess-control'); ?></th>
362
  <td style="width:3%;" valign="middle">
363
+ <input type="text" name="WPhtc_up_limit" value="<?php echo $WPhtc->get_data('up_limit');?>"/>
364
  </td>
365
  <td valign="middle">
366
  <p class="description"><?php _e('If set, this value in MB will be used as limit to file uploads.', 'wp-htaccess-control'); ?></p>
369
  <tr valign="top">
370
  <th scope="row"><?php _e('Admin Email', 'wp-htaccess-control'); ?></th>
371
  <td style="width:3%;">
372
+ <input type="text" name="WPhtc_admin_email" value="<?php echo $WPhtc->get_data('admin_email')?>"/>
373
  </td>
374
  <td valign="middle">
375
  <p class="description"><?php _e('If set, this will be used as the admin email on server generated error pages.', 'wp-htaccess-control'); ?></p>
378
  <tr valign="top">
379
  <th scope="row"><?php _e('Disable image hotlinking', 'wp-htaccess-control'); ?></th>
380
  <td style="width:3%;">
381
+ <input type="text" name="WPhtc_disable_hotlink" value="<?php echo $WPhtc->get_data('disable_hotlink');?>"/>
382
  </td>
383
  <td valign="middle">
384
  <p class="description"><?php _e('If set, this url will be used as redirection to hotlinked images (you should be using an image url here). If you prefer no output on hotlinked images use "_".', 'wp-htaccess-control'); ?></p>
387
  <tr valign="top">
388
  <th scope="row"><?php _e('Disable file hotlinking extensions', 'wp-htaccess-control'); ?></th>
389
  <td style="width:3%;">
390
+ <input type="text" name="WPhtc_disable_file_hotlink_ext" value="<?php echo $WPhtc->get_data('disable_file_hotlink_ext')?>"/>
391
  </td>
392
  <td valign="middle">
393
  <p class="description"><?php _e('If set, this file extensions will not be hotlinkable.', 'wp-htaccess-control'); ?></p>
397
  <tr valign="top">
398
  <th scope="row"><?php _e('File hotlinking redirection', 'wp-htaccess-control'); ?></th>
399
  <td style="width:3%;">
400
+ <input type="text" name="WPhtc_disable_file_hotlink_redir" value="<?php echo $WPhtc->get_data('disable_file_hotlink_redir')?>"/>
401
  </td>
402
  <td valign="middle">
403
  <p class="description"><?php _e('If set, this url will be used as redirection for hotlinked files.', 'wp-htaccess-control'); ?></p>
406
  <tr valign="top">
407
  <th scope="row"><?php _e('500 error', 'wp-htaccess-control'); ?></th>
408
  <td style="width:3%;" valign="middle">
409
+ <input type="text" name="WPhtc_redirect_500" value="<?php echo $WPhtc->get_data('redirect_500');?>"/>
410
  </td>
411
  <td valign="middle">
412
  <p class="description"><?php _e('If set, this path will be used as page to 500 errors (example: /error.php).', 'wp-htaccess-control'); ?></p>
415
  <tr valign="top">
416
  <th scope="row"><?php _e('403 error', 'wp-htaccess-control'); ?></th>
417
  <td style="width:3%;" valign="middle">
418
+ <input type="text" name="WPhtc_redirect_403" value="<?php echo $WPhtc->get_data('redirect_403');?>"/>
419
  </td>
420
  <td valign="middle">
421
  <p class="description"><?php _e('If set, this path will be used as page to 403 errors (example: /error.php).', 'wp-htaccess-control'); ?></p>
426
  <td style="width:3%;" valign="middle">
427
  <select name="WPhtc_canon">
428
  <option value=""></option>
429
+ <option value="www" <?php if($WPhtc->get_data('canon')=='www'){echo "selected";} ?>><?php _e('Force WWW', 'wp-htaccess-control'); ?></option>
430
+ <option value="simple" <?php if($WPhtc->get_data('canon')=='simple'){echo "selected";} ?>><?php _e('Force non-WWW', 'wp-htaccess-control'); ?></option>
431
  </select>
432
  </td>
433
  <td valign="middle">
446
  <tr valign="top">
447
  <th scope="row" style="width:18%;"><?php _e('Maintenance Active', 'wp-htaccess-control'); ?></th>
448
  <td valign="middle">
449
+ <input type="checkbox" name="WPhtc_maintenance_active" value="true" <?php if($WPhtc->get_data('maintenance_active')){ echo "checked";}?>/>
450
  </td>
451
  <td valign="middle">
452
  <p class="description"><?php _e('Toggles Maintenance Mode.', 'wp-htaccess-control'); ?></p>
455
  <tr valign="top">
456
  <th scope="row" style="width:18%;"><?php _e('Allowed IPs', 'wp-htaccess-control'); ?></th>
457
  <td>
458
+ <textarea name="WPhtc_maintenance_ips"><?php if($WPhtc->get_data('maintenance_ips')){echo implode($WPhtc->get_data('maintenance_ips'),"\n");}?></textarea>
459
  </td>
460
  <td valign="middle">
461
  <p class="description"><?php _e('List of allowed IPs.', 'wp-htaccess-control'); ?></p>
465
  <tr valign="top">
466
  <th scope="row" style="width:18%;"><?php _e('Redirection', 'wp-htaccess-control'); ?></th>
467
  <td>
468
+ <input type="text" name="WPhtc_maintenance_redirection" value="<?php echo $WPhtc->get_data('maintenance_redirection')?>"/>
469
  </td>
470
  <td valign="middle">
471
  <p class="description"><?php _e('If set, this will be used as redirection for disallowed IPs. This could be an external url or a document on your server (local paths begin with a trailing slash)', 'wp-htaccess-control'); ?></p>
474
  </table>
475
  </div>
476
  <!-- Login Control -->
477
+
478
  <div class="wphtc-section">
479
  <div class="wphtc-section-title stuffbox">
480
  <div title="Click to toggle" class="handlediv" style="background:url('<?php bloginfo("wpurl")?>/wp-admin/images/menu-bits.gif') no-repeat scroll left -111px transparent"><br></div>
492
  <tr valign="top">
493
  <th scope="row" style="width:18%;"><?php _e('Disable wp-login.php', 'wp-htaccess-control'); ?></th>
494
  <td>
495
+ <input type="checkbox" name="WPhtc_login_disabled" value="true" <?php if($WPhtc->get_data('login_disabled')){ echo "checked";}?>/>
496
  </td>
497
  <td valign="middle">
498
  <p class="description"><?php _e('This is the main switch. Make sure you know what you\'re doing.', 'wp-htaccess-control'); ?></p>
501
  <tr valign="top">
502
  <th scope="row" style="width:18%;"><?php _e('Redirect', 'wp-htaccess-control'); ?></th>
503
  <td valign="middle">
504
+ <input type="text" name="WPhtc_login_redirection" value="<?php echo $WPhtc->get_data('login_redirection')?>"/>
505
  </td>
506
  <td valign="middle">
507
  <p class="description"><?php _e('This will be used as redirection url. You might use something like "member-login" to redirect people to "http://yoursite.com/member-login/". If empty the home page will be served as redirection.', 'wp-htaccess-control'); ?></p>
510
  <tr valign="top">
511
  <th scope="row" style="width:18%;"><?php _e('Allowed IPs', 'wp-htaccess-control'); ?></th>
512
  <td>
513
+ <textarea name="WPhtc_login_ips"><?php if($WPhtc->get_data('login_ips')){echo implode($WPhtc->get_data('login_ips'),"\n");}?></textarea>
514
  </td>
515
+ <td valign="middle">
516
  <p class="description"><?php _e('List of IPs allowed to access wp-login.php.', 'wp-htaccess-control'); ?></p>
517
  <p class="description"><?php _e('Make sure you are have a static IP when using this.'); ?></p>
518
  </td>
520
  <tr valign="top">
521
  <th scope="row" style="width:18%;"><?php _e('Half-mode', 'wp-htaccess-control'); ?></th>
522
  <td>
523
+ <input type="checkbox" name="WPhtc_login_half_mode" value="true" <?php if($WPhtc->get_data('login_half_mode')){ echo "checked";}?>/>
524
  </td>
525
  <td valign="middle">
526
  <p class="description"><?php _e('(BETA) If set, this will still allow access to POST (login) requests, logout and to the password recovery form. I don\'t think this is very useful at the moment (login error messages will still show up on wp-login.php) but may be helpful for AJAX use.', 'wp-htaccess-control'); ?></p>
542
  </div>
543
  <div class="wphtc-inputs start-open">
544
  <p>
545
+ <code><?php echo str_replace(array("&lt;br /&gt;","&lt;br/&gt;"),"<br/>",htmlspecialchars($WPhtc->get_data('cur_hta')));?></code>
546
  </p>
547
  </div>
548
  </div>
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: Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress.
6
- Version: 3.3.2
7
  Author: António Andrade
8
  Author URI: http://antonioandra.de
9
  */
@@ -34,6 +34,22 @@ if (!class_exists("WPhtc")) {
34
  function WPhtc() {
35
  $this->data=get_option('WPhtc_data');
36
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  function init(){
38
  # set locale
39
  $currentLocale = get_locale();
@@ -167,9 +183,9 @@ if (!class_exists("WPhtc")) {
167
 
168
  $page_base=($this->data['cpp']!='')?$this->data['cpp']:'page';
169
 
170
- if($this->data['create_archive'] || $this->data['remove_taxonomy_base']){
171
  foreach (get_taxonomies('','objects') as $taxonomy){
172
- if(!$taxonomy->rewrite || ( !$this->data['remove_taxonomy_base'][$taxonomy->name] && !$this->data['create_archive'][$taxonomy->name] )){continue;}
173
  $terms=get_terms($taxonomy->name, array("hide_empty"=>false));
174
  foreach($terms as $term){
175
  $base=$this->data['remove_taxonomy_base'][$taxonomy->name]?"":$taxonomy->rewrite->slug."/";
@@ -193,7 +209,7 @@ if (!class_exists("WPhtc")) {
193
  }
194
 
195
  # create archives
196
- if($this->data['create_archive'][$tax_name]){
197
  #year
198
  $new_rules[$base.$ancestors.'('.$term->slug.')/([0-9]{4})/?$'] = 'index.php?'.$tax_name.'=$matches[1]&year=$matches[2]';
199
  $new_rules[$base.$ancestors.'('.$term->slug.')/([0-9]{4})/'.$page_base.'/?([0-9]{1,})/?$'] = 'index.php?'.$tax_name.'=$matches[1]&year=$matches[2]&paged=$matches[3]';
@@ -301,7 +317,7 @@ if (!class_exists("WPhtc")) {
301
  $authors = $wpdb->get_results($sql);
302
  if($authors && is_array($authors)) {
303
  foreach($authors as $author) {
304
- $url=get_bloginfo('home')."/".$this->data['cap']."/".$author->user_nicename."/";
305
  $generatorObject->AddUrl($url,$generatorObject->GetTimestampFromMySql($author->last_post),$generatorObject->GetOption("cf_auth"),$generatorObject->GetOption("pr_auth"));
306
  }
307
  }
@@ -422,7 +438,7 @@ if (!class_exists("WPhtc")) {
422
  $new_rules.="\n# WPhtC: Protect comments.php\n";
423
  $new_rules.="RewriteCond %{REQUEST_METHOD} POST\n";
424
  $new_rules.="RewriteCond %{REQUEST_URI} .wp-comments-post\.php*\n";
425
- $new_rules.="RewriteCond %{HTTP_REFERER} !.*".get_bloginfo('home').".* [OR]\n";
426
  $new_rules.="RewriteCond %{HTTP_USER_AGENT} ^$\n";
427
  $new_rules.="RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]\n";
428
  }
@@ -514,10 +530,10 @@ if (!class_exists("WPhtc")) {
514
  foreach($txs as $t){
515
  //return str_replace($t->rewrite['slug']."/","",$termlink);
516
  if($term->parent!=0 && !$this->data['remove_hierarchy']){
517
- return get_bloginfo('home')."/".$this->term_ancestors($taxonomy,$term->parent)."/".$term->slug;
518
  }
519
  else{
520
- return get_bloginfo('home')."/".$term->slug;
521
  }
522
  }
523
  }
@@ -553,7 +569,7 @@ if (!class_exists("WPhtc")) {
553
  # Adding our options page to the admin menu
554
  function configure_menu(){
555
  if(current_user_can("administrator")){
556
- $page=add_submenu_page("options-general.php","WP htaccess Control", "htaccess Control", 6, __FILE__, array('WPhtc','page'));
557
  add_action('admin_print_scripts-'.$page, array('WPhtc','page_script'));
558
  add_action('admin_print_styles-'.$page, array('WPhtc','page_style'));
559
  }
@@ -570,7 +586,7 @@ if (!class_exists("WPhtc")) {
570
  # Filter "View" Link on Administration
571
  function filter_tax_table_actions( $actions, $tag){
572
  if($tag->parent!=0){
573
- $actions['view']='<a href="'.get_bloginfo('home').'/'.$this->term_ancestors($tag->taxonomy,$tag->parent).'/'.$tag->slug.'">View</a>';
574
  }
575
  return $actions;
576
  }
@@ -578,9 +594,9 @@ if (!class_exists("WPhtc")) {
578
  # Options Page Actions
579
  function page_action(){
580
  $this->check_first_run();
581
- $action=$_REQUEST['action'];
582
- global $echo;
583
- if(isset($action)){
584
 
585
  switch($action){
586
  # Hide donation message for one month
@@ -613,7 +629,7 @@ if (!class_exists("WPhtc")) {
613
 
614
  foreach(array("hta", "cap", "cpp", "custom_search_permalink", "remove_author_base", "category_archives", "author_archives", "tag_archives", "disable_serversignature", "disable_indexes", "protect_wp_config", "protect_htaccess", "protect_comments", "disable_hotlink", "disable_file_hotlink_ext", "disable_file_hotlink_redir", "redirect_500", "redirect_403", "canon", "admin_email", "deflate", "gzip", "maintenance_active", "maintenance_redirection", "login_disabled", "login_half_mode", "login_redirection", "sm_enabled", "jim_morgan_hta", "remove_hierarchy", "suffix_html")
615
  as $k){
616
- $this->data[$k]=$_POST['WPhtc_'.$k];
617
  }
618
 
619
  # wordpress htaccess and jim morgan's htaccess
@@ -680,7 +696,7 @@ if (!class_exists("WPhtc")) {
680
 
681
  # Advanced archives
682
  unset($this->data['create_archive']);
683
- if($_POST['WPhtc_create_archive']){
684
  foreach($_POST['WPhtc_create_archive'] as $tax_key=>$create_archive){
685
  $this->data['create_archive'][$tax_key]=$create_archive;
686
  }
3
  Plugin Name: WP htaccess Control
4
  Plugin URI: http://dardna.com/wp-htaccess-control
5
  Description: Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress.
6
+ Version: 3.3.3
7
  Author: António Andrade
8
  Author URI: http://antonioandra.de
9
  */
34
  function WPhtc() {
35
  $this->data=get_option('WPhtc_data');
36
  }
37
+ /*
38
+ * @param $key
39
+ */
40
+ function get_data($key, $key_inner=""){
41
+ if(isset($this->data[$key])) {
42
+ if($key_inner!="" && isset($this->data[$key][$key_inner])){
43
+ return $this->data[$key][$key_inner];
44
+ }
45
+ else{
46
+ return $this->data[$key];
47
+ }
48
+ }
49
+ else{
50
+ return false;
51
+ }
52
+ }
53
  function init(){
54
  # set locale
55
  $currentLocale = get_locale();
183
 
184
  $page_base=($this->data['cpp']!='')?$this->data['cpp']:'page';
185
 
186
+ if(isset($this->data['create_archive']) || isset($this->data['remove_taxonomy_base'])){
187
  foreach (get_taxonomies('','objects') as $taxonomy){
188
+ if(!$taxonomy->rewrite || ( (isset($this->data['remove_taxonomy_base'][$taxonomy->name]) && (isset($this->data['remove_taxonomy_base'][$taxonomy->name]) && !$this->data['remove_taxonomy_base'][$taxonomy->name])) && !$this->data['create_archive'][$taxonomy->name] )){continue;}
189
  $terms=get_terms($taxonomy->name, array("hide_empty"=>false));
190
  foreach($terms as $term){
191
  $base=$this->data['remove_taxonomy_base'][$taxonomy->name]?"":$taxonomy->rewrite->slug."/";
209
  }
210
 
211
  # create archives
212
+ if(isset($this->data['create_archive'][$tax_name])){
213
  #year
214
  $new_rules[$base.$ancestors.'('.$term->slug.')/([0-9]{4})/?$'] = 'index.php?'.$tax_name.'=$matches[1]&year=$matches[2]';
215
  $new_rules[$base.$ancestors.'('.$term->slug.')/([0-9]{4})/'.$page_base.'/?([0-9]{1,})/?$'] = 'index.php?'.$tax_name.'=$matches[1]&year=$matches[2]&paged=$matches[3]';
317
  $authors = $wpdb->get_results($sql);
318
  if($authors && is_array($authors)) {
319
  foreach($authors as $author) {
320
+ $url=get_bloginfo('url')."/".$this->data['cap']."/".$author->user_nicename."/";
321
  $generatorObject->AddUrl($url,$generatorObject->GetTimestampFromMySql($author->last_post),$generatorObject->GetOption("cf_auth"),$generatorObject->GetOption("pr_auth"));
322
  }
323
  }
438
  $new_rules.="\n# WPhtC: Protect comments.php\n";
439
  $new_rules.="RewriteCond %{REQUEST_METHOD} POST\n";
440
  $new_rules.="RewriteCond %{REQUEST_URI} .wp-comments-post\.php*\n";
441
+ $new_rules.="RewriteCond %{HTTP_REFERER} !.*".get_bloginfo('url').".* [OR]\n";
442
  $new_rules.="RewriteCond %{HTTP_USER_AGENT} ^$\n";
443
  $new_rules.="RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]\n";
444
  }
530
  foreach($txs as $t){
531
  //return str_replace($t->rewrite['slug']."/","",$termlink);
532
  if($term->parent!=0 && !$this->data['remove_hierarchy']){
533
+ return get_bloginfo('url')."/".$this->term_ancestors($taxonomy,$term->parent)."/".$term->slug;
534
  }
535
  else{
536
+ return get_bloginfo('url')."/".$term->slug;
537
  }
538
  }
539
  }
569
  # Adding our options page to the admin menu
570
  function configure_menu(){
571
  if(current_user_can("administrator")){
572
+ $page=add_submenu_page("options-general.php","WP htaccess Control", "htaccess Control", 'activate_plugins', __FILE__, array('WPhtc','page'));
573
  add_action('admin_print_scripts-'.$page, array('WPhtc','page_script'));
574
  add_action('admin_print_styles-'.$page, array('WPhtc','page_style'));
575
  }
586
  # Filter "View" Link on Administration
587
  function filter_tax_table_actions( $actions, $tag){
588
  if($tag->parent!=0){
589
+ $actions['view']='<a href="'.get_bloginfo('url').'/'.$this->term_ancestors($tag->taxonomy,$tag->parent).'/'.$tag->slug.'">View</a>';
590
  }
591
  return $actions;
592
  }
594
  # Options Page Actions
595
  function page_action(){
596
  $this->check_first_run();
597
+ if(isset($_REQUEST['action'])){
598
+ $action=$_REQUEST['action'];
599
+ global $echo;
600
 
601
  switch($action){
602
  # Hide donation message for one month
629
 
630
  foreach(array("hta", "cap", "cpp", "custom_search_permalink", "remove_author_base", "category_archives", "author_archives", "tag_archives", "disable_serversignature", "disable_indexes", "protect_wp_config", "protect_htaccess", "protect_comments", "disable_hotlink", "disable_file_hotlink_ext", "disable_file_hotlink_redir", "redirect_500", "redirect_403", "canon", "admin_email", "deflate", "gzip", "maintenance_active", "maintenance_redirection", "login_disabled", "login_half_mode", "login_redirection", "sm_enabled", "jim_morgan_hta", "remove_hierarchy", "suffix_html")
631
  as $k){
632
+ $this->data[$k]=isset($_POST['WPhtc_'.$k])?$_POST['WPhtc_'.$k]:'';
633
  }
634
 
635
  # wordpress htaccess and jim morgan's htaccess
696
 
697
  # Advanced archives
698
  unset($this->data['create_archive']);
699
+ if(isset($_POST['WPhtc_create_archive'])){
700
  foreach($_POST['WPhtc_create_archive'] as $tax_key=>$create_archive){
701
  $this->data['create_archive'][$tax_key]=$create_archive;
702
  }