404 to 301 - Version 3.0.9

Version Description

(06/10/2021) = ** Improvements**

  • Tested with WP 5.8.
  • Added nonce verification for bulk actions.
Download this release

Release Info

Developer joelcj91
Plugin Icon 128x128 404 to 301
Version 3.0.9
Comparing to
See all releases

Code changes from version 3.0.8 to 3.0.9

404-to-301.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: 404 to 301 - Redirect, Log and Notify 404 Errors
4
  * Plugin URI: https://duckdev.com/products/404-to-301/
5
  * Description: Automatically redirect all <strong>404 errors</strong> to any page using <strong>301 redirect for SEO</strong>. You can <strong>redirect and log</strong> every 404 errors. No more 404 errors in Webmaster tool.
6
- * Version: 3.0.8
7
  * Author: Joel James
8
  * Author URI: https://duckdev.com/
9
  * Donate link: https://paypal.me/JoelCJ
@@ -44,7 +44,7 @@ define( 'JJ4T3_URL', plugin_dir_url( __FILE__ ) );
44
  // Define plugin base file.
45
  define( 'JJ4T3_BASE_FILE', __FILE__ );
46
  // Define plugin version.
47
- define( 'JJ4T3_VERSION', '3.0.8' );
48
  // Define plugin version.
49
  define( 'JJ4T3_DB_VERSION', '11.0' );
50
  // Define plugin log table.
3
  * Plugin Name: 404 to 301 - Redirect, Log and Notify 404 Errors
4
  * Plugin URI: https://duckdev.com/products/404-to-301/
5
  * Description: Automatically redirect all <strong>404 errors</strong> to any page using <strong>301 redirect for SEO</strong>. You can <strong>redirect and log</strong> every 404 errors. No more 404 errors in Webmaster tool.
6
+ * Version: 3.0.9
7
  * Author: Joel James
8
  * Author URI: https://duckdev.com/
9
  * Donate link: https://paypal.me/JoelCJ
44
  // Define plugin base file.
45
  define( 'JJ4T3_BASE_FILE', __FILE__ );
46
  // Define plugin version.
47
+ define( 'JJ4T3_VERSION', '3.0.9' );
48
  // Define plugin version.
49
  define( 'JJ4T3_DB_VERSION', '11.0' );
50
  // Define plugin log table.
includes/admin/class-jj4t3-log-listing.php CHANGED
@@ -763,7 +763,6 @@ class JJ4T3_Log_Listing extends WP_List_Table {
763
  * @return void|boolean
764
  */
765
  private function process_actions() {
766
-
767
  // Get current action.
768
  $action = $this->current_action();
769
 
@@ -775,6 +774,13 @@ class JJ4T3_Log_Listing extends WP_List_Table {
775
  return false;
776
  }
777
 
 
 
 
 
 
 
 
778
  // IDs of log entires to process.
779
  $ids = jj4t3_from_request( 'bulk-delete', true );
780
 
@@ -808,18 +814,17 @@ class JJ4T3_Log_Listing extends WP_List_Table {
808
  * @return void
809
  */
810
  private function safe_redirect( $action_performed = false ) {
811
-
812
  // If sensitive data found, remove those and redirect.
813
- if ( ! empty( $_GET['_wp_http_referer'] ) || ! empty( $_GET['_wpnonce'] ) ) {
814
- // Redirect to current page.
815
- wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
816
- exit();
817
- }
818
-
819
- // If bulk actions performed, redirect.
820
- if ( $action_performed === true ) {
821
- // Redirect to current page.
822
- wp_redirect( remove_query_arg( array( 'action', 'action2' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
823
  exit();
824
  }
825
  }
@@ -840,7 +845,6 @@ class JJ4T3_Log_Listing extends WP_List_Table {
840
  * @return void
841
  */
842
  private function delete_logs( $ids, $action ) {
843
-
844
  global $wpdb;
845
 
846
  if ( is_numeric( $ids ) && 'delete' === $action ) {
763
  * @return void|boolean
764
  */
765
  private function process_actions() {
 
766
  // Get current action.
767
  $action = $this->current_action();
768
 
774
  return false;
775
  }
776
 
777
+ $nonce = jj4t3_from_request( '_wpnonce' );
778
+
779
+ // Nonce verification.
780
+ if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'bulk-404errorlogs' ) ) {
781
+ return false;
782
+ }
783
+
784
  // IDs of log entires to process.
785
  $ids = jj4t3_from_request( 'bulk-delete', true );
786
 
814
  * @return void
815
  */
816
  private function safe_redirect( $action_performed = false ) {
 
817
  // If sensitive data found, remove those and redirect.
818
+ if ( ! empty( $_GET['_wp_http_referer'] ) || ! empty( $_GET['_wpnonce'] ) || $action_performed ) {
819
+ $strings = array( '_wp_http_referer', '_wpnonce' );
820
+ // Remove processed actions.
821
+ if ( $action_performed ) {
822
+ $strings[] = 'action';
823
+ $strings[] = 'action2';
824
+ }
825
+ // Remove params.
826
+ $url = remove_query_arg( $strings );
827
+ wp_redirect( $url );
828
  exit();
829
  }
830
  }
845
  * @return void
846
  */
847
  private function delete_logs( $ids, $action ) {
 
848
  global $wpdb;
849
 
850
  if ( is_numeric( $ids ) && 'delete' === $action ) {
languages/404-to-301.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: 404 to 301 - Redirect, Log and Notify 404 Errors 3.0.8\n"
6
  "Report-Msgid-Bugs-To: https://duckdev.com/products/404-to-301/\n"
7
- "POT-Creation-Date: 2021-06-12 06:45:43+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: 404 to 301 - Redirect, Log and Notify 404 Errors 3.0.9\n"
6
  "Report-Msgid-Bugs-To: https://duckdev.com/products/404-to-301/\n"
7
+ "POT-Creation-Date: 2021-10-06 07:58:16+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: joelcj91,duckdev
3
  Tags: 404, 301, 302, 307, not found, 404 redirect, 404 to 301, 301 redirect, seo redirect, error redirect, 404 seo, custom 404 page
4
  Donate link: https://www.paypal.me/JoelCJ
5
  Requires at least: 3.5
6
- Tested up to: 5.8
7
- Stable tag: 3.0.8
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -128,6 +128,12 @@ Bug reports for 404 to 301 are always welcome. [Report here](https://duckdev.com
128
 
129
  == Changelog ==
130
 
 
 
 
 
 
 
131
  = 3.0.8 (12/06/2021) =
132
  **👌 Improvements**
133
 
@@ -434,9 +440,8 @@ Bug reports for 404 to 301 are always welcome. [Report here](https://duckdev.com
434
 
435
  == Upgrade Notice ==
436
 
437
- = 3.0.8 (12/06/2021) =
438
  **👌 Improvements**
439
 
440
- * Tested with WP 5.7.
441
- * Add capability checks for ajax actions - Thanks [Jerome](https://secure.nintechnet.com/).
442
- * Improve query preparations - Thanks [Jerome](https://secure.nintechnet.com/).
3
  Tags: 404, 301, 302, 307, not found, 404 redirect, 404 to 301, 301 redirect, seo redirect, error redirect, 404 seo, custom 404 page
4
  Donate link: https://www.paypal.me/JoelCJ
5
  Requires at least: 3.5
6
+ Tested up to: 5.7
7
+ Stable tag: 3.0.9
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
128
 
129
  == Changelog ==
130
 
131
+ = 3.0.9 (06/10/2021) =
132
+ **👌 Improvements**
133
+
134
+ * Tested with WP 5.8.
135
+ * Added nonce verification for bulk actions.
136
+
137
  = 3.0.8 (12/06/2021) =
138
  **👌 Improvements**
139
 
440
 
441
  == Upgrade Notice ==
442
 
443
+ = 3.0.9 (06/10/2021) =
444
  **👌 Improvements**
445
 
446
+ * Tested with WP 5.8.
447
+ * Added nonce verification for bulk actions.