Simple 301 Redirects – Addon – Bulk Uploader - Version 1.0.8

Version Description

  • Added ability to delete 301 redirect list
Download this release

Release Info

Developer ashdurham
Plugin Icon 128x128 Simple 301 Redirects – Addon – Bulk Uploader
Version 1.0.8
Comparing to
See all releases

Code changes from version 1.0.7 to 1.0.8

Files changed (2) hide show
  1. readme.txt +7 -1
  2. simple-301-bulk-uploader.php +12 -1
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://durham.net.au/donate/
4
  Tags: simple 301 redirects, bulk upload, csv, 301, redirects
5
  Requires at least: 3.0.1
6
  Tested up to: 3.8.1
7
- Stable tag: 1.0.7
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -68,6 +68,9 @@ Have a question thats not listed? Get support either on the support forums here
68
 
69
  == Changelog ==
70
 
 
 
 
71
  = 1.0.7 =
72
  * Update to allowed file type list
73
 
@@ -94,6 +97,9 @@ Have a question thats not listed? Get support either on the support forums here
94
 
95
  == Upgrade Notice ==
96
 
 
 
 
97
  = 1.0.7 =
98
  * Update to allowed file type list
99
 
4
  Tags: simple 301 redirects, bulk upload, csv, 301, redirects
5
  Requires at least: 3.0.1
6
  Tested up to: 3.8.1
7
+ Stable tag: 1.0.8
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
68
 
69
  == Changelog ==
70
 
71
+ = 1.0.8 =
72
+ * Added ability to delete 301 redirect list
73
+
74
  = 1.0.7 =
75
  * Update to allowed file type list
76
 
97
 
98
  == Upgrade Notice ==
99
 
100
+ = 1.0.8 =
101
+ * Added ability to delete 301 redirects list
102
+
103
  = 1.0.7 =
104
  * Update to allowed file type list
105
 
simple-301-bulk-uploader.php CHANGED
@@ -65,7 +65,7 @@ if (!class_exists("Bulk301Uploader")) {
65
  <div class="wrap">
66
  <h2>Simple 301 Redirects - Bulk Upload</h2>
67
 
68
- <a href="<?= plugins_url( '301-example.csv', __FILE__ ); ?>">Example CSV</a> - <a href='<?= admin_url('admin.php?action=bulk301export') ?>'>Export current 301's to CSV</a>
69
 
70
  <form method="post" action="options-general.php?page=301bulkoptions" enctype="multipart/form-data">
71
 
@@ -179,6 +179,14 @@ if (!class_exists("Bulk301Uploader")) {
179
  }
180
  fclose($fp);
181
  }
 
 
 
 
 
 
 
 
182
  }
183
  }
184
 
@@ -192,6 +200,9 @@ if (isset($bulk_redirect_plugin) && $bulk_redirect_plugin->check_for_parent()) {
192
 
193
  // Create export action
194
  add_action( 'admin_action_bulk301export', array($bulk_redirect_plugin,'export_bulk_redirects') );
 
 
 
195
 
196
  // if submitted, process the data
197
  if (isset($_POST['submit_bulk_301'])) {
65
  <div class="wrap">
66
  <h2>Simple 301 Redirects - Bulk Upload</h2>
67
 
68
+ <a href="<?= plugins_url( '301-example.csv', __FILE__ ); ?>">Example CSV</a> - <a href='<?= admin_url('admin.php?action=bulk301export') ?>'>Export current 301's to CSV</a> - <a href="<?= admin_url('admin.php?action=bulk301clearlist') ?>" onclick="if(confirm('Are you sure you want to do this? This will not be able to be retrieved. As a backup, please use the export feature to download a current copy before doing this.')) return true; else return false;">Clear 301 Redirect List (DO SO WITH CAUTION!)</a>
69
 
70
  <form method="post" action="options-general.php?page=301bulkoptions" enctype="multipart/form-data">
71
 
179
  }
180
  fclose($fp);
181
  }
182
+
183
+ /*
184
+ Clear 301 Redirects list
185
+ */
186
+ function clear_301_redirects() {
187
+ update_option('301_redirects', '');
188
+ header("Location: ".$_SERVER['HTTP_REFERER']);
189
+ }
190
  }
191
  }
192
 
200
 
201
  // Create export action
202
  add_action( 'admin_action_bulk301export', array($bulk_redirect_plugin,'export_bulk_redirects') );
203
+
204
+ // Create clear action
205
+ add_action( 'admin_action_bulk301clearlist', array($bulk_redirect_plugin,'clear_301_redirects') );
206
 
207
  // if submitted, process the data
208
  if (isset($_POST['submit_bulk_301'])) {