404 to 301 - Version 3.0.1

Version Description

(24/08/2018) = ** Improvements**

  • Make release automated.

** Bug Fixes**

  • Do not include exclude path items.
Download this release

Release Info

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

Code changes from version 3.0.0.1 to 3.0.1

404-to-301.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /**
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.0.1
7
  * Author: Joel James
8
  * Author URI: https://duckdev.com/
9
  * Donate link: https://paypal.me/JoelCJ
@@ -63,7 +63,7 @@ if ( ! class_exists( 'JJ_404_to_301' ) ) :
63
  'JJ4T3_DIR' => plugin_dir_path( __FILE__ ),
64
  'JJ4T3_URL' => plugin_dir_url( __FILE__ ),
65
  'JJ4T3_BASE_FILE' => __FILE__,
66
- 'JJ4T3_VERSION' => '3.0.0.1',
67
  'JJ4T3_DB_VERSION' => '11.0',
68
  'JJ4T3_TABLE' => $GLOBALS['wpdb']->prefix . '404_to_301',
69
  // Set who all can access plugin settings.
@@ -157,4 +157,4 @@ if ( ! class_exists( 'JJ_404_to_301' ) ) :
157
  // Signal that SDK was initiated.
158
  do_action( 'jj4t3_fs_loaded' );
159
 
160
- endif; // End if class_exists check.
1
  <?php
2
  /**
3
+ * Plugin Name: 404 to 301
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.1
7
  * Author: Joel James
8
  * Author URI: https://duckdev.com/
9
  * Donate link: https://paypal.me/JoelCJ
63
  'JJ4T3_DIR' => plugin_dir_path( __FILE__ ),
64
  'JJ4T3_URL' => plugin_dir_url( __FILE__ ),
65
  'JJ4T3_BASE_FILE' => __FILE__,
66
+ 'JJ4T3_VERSION' => '3.0.1',
67
  'JJ4T3_DB_VERSION' => '11.0',
68
  'JJ4T3_TABLE' => $GLOBALS['wpdb']->prefix . '404_to_301',
69
  // Set who all can access plugin settings.
157
  // Signal that SDK was initiated.
158
  do_action( 'jj4t3_fs_loaded' );
159
 
160
+ endif; // End if class_exists check.
README.md DELETED
@@ -1,26 +0,0 @@
1
- > ####WARNING: This latest version is not live yet. Use with caution!
2
-
3
- # [404 to 301](https://wordpress.org/plugins/404-to-301) - Redirect, Log and Notify 404 Errors
4
-
5
- Automatically redirect all 404 errors to any page using 301 redirect to boost your SEO in WordPress. This plugin also can log all 404 erros and list it to you. Also you can optionally get email alerts on 404 errors!
6
-
7
- <hr/>
8
-
9
- <strong>Contributors:</strong> <a href="https://github.com/joel-james/">Joel James</a>, <a href="https://github.com/gaiusmathew/">Gaius Mathew</a><br/>
10
- <strong>Requires at least:</strong> WordPress 3.0<br/>
11
- <strong>Tested up to:</strong> WordPress 4.9<br/>
12
- <strong>Stable tag:</strong> 3.0.0.1<br/>
13
-
14
- <h4>Important Links and Documentation</h4>
15
-
16
- <ul>
17
- <li><a href="https://duckdev.com/products/404-to-301/"><strong>Plugin Website</strong></a></li>
18
- <li><a href="https://wordpress.org/plugins/404-to-301/"><strong>WordPress Page</strong></a></li>
19
- <li><a href="https://wordpress.org/support/plugin/404-to-301/"><strong>Plugin Support Forum</strong></a></li>
20
- <li><a href="https://duckdev.com/support/docs/category/404-to-301/"><strong>Documentation</strong></a></li>
21
- </ul>
22
-
23
-
24
- <pre>Pull requests are always welcome!</pre>
25
-
26
- <strong>PS</strong>: Send pull request to <strong>dev</strong> branch
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{includes/admin → assets}/css/admin.min.css RENAMED
@@ -1 +1 @@
1
- .jj4t3-url-p{color:#E53531!important}.jj4t3-fixed-height{height:120px;margin-bottom:20px;overflow:auto;padding:0 20px 0 0}.jj4t3-notice{padding:10px}.jj4t3-p-desc{font-size:13px!important}.jj4t3-h2{font-size:23px;line-height:29px;font-weight:700!important}h2 .subtitle a{text-decoration:none}.jj4t3-hide{display:none}.jj4t3-handle{cursor:default!important}
1
+ .jj4t3-url-p{color:#e53531!important}.jj4t3-fixed-height{height:120px;margin-bottom:20px;overflow:auto;padding:0 20px 0 0}.jj4t3-notice{padding:10px}.jj4t3-p-desc{font-size:13px!important}.jj4t3-h2{font-size:23px;line-height:29px;font-weight:700!important}h2 .subtitle a{text-decoration:none}.jj4t3-hide{display:none}.jj4t3-handle{cursor:default!important}
{includes/admin → assets}/css/index.php RENAMED
File without changes
assets/js/admin.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";!function(t){t(function(){t("#jj4t3_redirect_to").change(function(){switch(t(this).val()){case"page":t("#custom_page").show(),t("#custom_url").hide();break;case"link":t("#custom_url").show(),t("#custom_page").hide();break;default:t("#custom_page").hide(),t("#custom_url").hide()}}),t(".jj4t3_redirect_thickbox").on("click",function(){var r={action:"jj4t3_redirect_thickbox",url_404:t(this).attr("url_404"),nonce:t(this).attr("wpnonce")};t.post(ajaxurl,r,function(r){tb_show(jj4t3strings.redirect,"#TB_inline?width=700&height=370&inlineId=jj4t3-redirect-modal"),t("#jj4t3_redirect_404").val(r.url_404),t("#jj4t3_redirect_404_text").html(r.url_404),t("#jj4t3_redirect_url").val(r.url),t("#jj4t3_custom_redirect_type").val(r.type),e("jj4t3_custom_redirect_redirect",r.redirect),e("jj4t3_custom_redirect_log",r.log),e("jj4t3_custom_redirect_alert",r.alert)})}),t("#jj4t3_custom_redirect_submit").on("click",function(){t(this).addClass("disabled"),t(".jj4t3-spinner").css("visibility","visible");var e=t("#jj4t3_custom_redirect_form").serialize();t.post(ajaxurl,e,function(e){tb_remove(),t("#jj4t3_custom_redirect_submit").removeClass("disabled"),t(".j4t3-spinner").css("visibility","hidden"),location.reload()})});var e=function(e,r){t("input[name="+e+"][value="+r+"]").prop("checked",!0)}})}(jQuery)}]);
{includes/admin/images → assets/js}/index.php RENAMED
File without changes
{includes/admin → assets/src}/css/admin.css RENAMED
File without changes
{includes/admin → assets/src}/js/admin.js RENAMED
File without changes
composer.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "name" : "joel-james/404-to-301",
3
- "version" : "3.0.0.1",
4
- "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.",
5
- "homepage" : "https://dclwp.com/",
6
- "license" : "GPL-2.0+",
7
- "type" : "wordpress-plugin",
8
- "require" : {
9
- "composer/installers": "~1.0"
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/admin/class-jj4t3-admin.php CHANGED
@@ -87,11 +87,11 @@ class JJ4T3_Admin {
87
  global $pagenow;
88
 
89
  // Use minified assets if SCRIPT_DEBUG is turned off.
90
- $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
91
 
92
  if ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'jj4t3-settings', 'jj4t3-logs' ) ) ) {
93
 
94
- wp_enqueue_style( JJ4T3_NAME, JJ4T3_URL . 'includes/admin/css/admin' . $suffix . '.css', array(), JJ4T3_VERSION, 'all' );
95
  }
96
  }
97
 
@@ -117,14 +117,14 @@ class JJ4T3_Admin {
117
  global $pagenow;
118
 
119
  // Use minified scripts if SCRIPT_DEBUG is turned off.
120
- $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
121
 
122
  if ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'jj4t3-settings', 'jj4t3-logs' ) ) ) {
123
 
124
- wp_enqueue_script( JJ4T3_NAME, JJ4T3_URL . 'includes/admin/js/admin' . $suffix . '.js', array( 'jquery' ), JJ4T3_VERSION, false );
125
 
126
  // Strings to translate in js.
127
- $strings = array( 'redirect' => esc_html__( 'Custom Redirect', JJ4T3_DOMAIN ) );
128
 
129
  wp_localize_script( JJ4T3_NAME, 'jj4t3strings', $strings );
130
  }
@@ -148,13 +148,13 @@ class JJ4T3_Admin {
148
  public function admin_menu() {
149
 
150
  // Main menu for error logs list.
151
- $hook = add_menu_page( __( '404 Error Logs', JJ4T3_DOMAIN ), __( '404 Errors', JJ4T3_DOMAIN ), JJ4T3_ACCESS, 'jj4t3-logs', array( $this, 'error_list' ), 'dashicons-redo', 90 );
152
 
153
  // Render screen options on listing table.
154
  add_action( "load-$hook", array( $this, 'screen_option' ) );
155
 
156
  // 404 to 301 settings menu.
157
- add_submenu_page( 'jj4t3-logs', __( '404 to 301 Settings', JJ4T3_DOMAIN ), __( '404 Settings', JJ4T3_DOMAIN ), JJ4T3_ACCESS, 'jj4t3-settings', array( $this, 'admin_page' ) );
158
 
159
  /**
160
  * Action hook to register new submenu item.
@@ -183,7 +183,7 @@ class JJ4T3_Admin {
183
  public function screen_option() {
184
 
185
  $args = array(
186
- 'label' => __( 'Error Logs', JJ4T3_DOMAIN ),
187
  'default' => 20,
188
  'option' => 'logs_per_page'
189
  );
@@ -209,7 +209,7 @@ class JJ4T3_Admin {
209
  public function error_list() {
210
  ?>
211
  <div class="wrap">
212
- <h2><?php _e( '404 Error Logs', JJ4T3_DOMAIN ); ?></h2>
213
  <div id="poststuff">
214
  <div id="post-body" class="metabox-holder">
215
  <div id="post-body-content">
@@ -267,7 +267,7 @@ class JJ4T3_Admin {
267
 
268
  global $menu;
269
 
270
- $menu[90][0] = __( '404 to 301', JJ4T3_DOMAIN );
271
  }
272
 
273
  /**
@@ -336,8 +336,8 @@ class JJ4T3_Admin {
336
  $plugin_file = basename( '404-to-301.php' );
337
 
338
  if ( basename( $file ) === $plugin_file ) {
339
- $settings_link = '<a href="admin.php?page=jj4t3-settings">' . __( 'Settings', JJ4T3_DOMAIN ) . '</a>';
340
- $settings_link .= ' | <a href="admin.php?page=jj4t3-logs">' . __( 'Logs', JJ4T3_DOMAIN ) . '</a>';
341
 
342
  // Add quick links to plugins listing page.
343
  array_unshift( $links, $settings_link );
87
  global $pagenow;
88
 
89
  // Use minified assets if SCRIPT_DEBUG is turned off.
90
+ $file = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'assets/src/css/admin.css' : 'assets/css/admin.min.css';
91
 
92
  if ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'jj4t3-settings', 'jj4t3-logs' ) ) ) {
93
 
94
+ wp_enqueue_style( JJ4T3_NAME, JJ4T3_URL . $file, array(), JJ4T3_VERSION, 'all' );
95
  }
96
  }
97
 
117
  global $pagenow;
118
 
119
  // Use minified scripts if SCRIPT_DEBUG is turned off.
120
+ $file = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'assets/src/js/admin.js' : 'assets/js/admin.min.js';
121
 
122
  if ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'jj4t3-settings', 'jj4t3-logs' ) ) ) {
123
 
124
+ wp_enqueue_script( JJ4T3_NAME, JJ4T3_URL . $file, array( 'jquery' ), JJ4T3_VERSION, false );
125
 
126
  // Strings to translate in js.
127
+ $strings = array( 'redirect' => esc_html__( 'Custom Redirect', '404-to-301' ) );
128
 
129
  wp_localize_script( JJ4T3_NAME, 'jj4t3strings', $strings );
130
  }
148
  public function admin_menu() {
149
 
150
  // Main menu for error logs list.
151
+ $hook = add_menu_page( __( '404 Error Logs', '404-to-301' ), __( '404 Errors', '404-to-301' ), JJ4T3_ACCESS, 'jj4t3-logs', array( $this, 'error_list' ), 'dashicons-redo', 90 );
152
 
153
  // Render screen options on listing table.
154
  add_action( "load-$hook", array( $this, 'screen_option' ) );
155
 
156
  // 404 to 301 settings menu.
157
+ add_submenu_page( 'jj4t3-logs', __( '404 to 301 Settings', '404-to-301' ), __( '404 Settings', '404-to-301' ), JJ4T3_ACCESS, 'jj4t3-settings', array( $this, 'admin_page' ) );
158
 
159
  /**
160
  * Action hook to register new submenu item.
183
  public function screen_option() {
184
 
185
  $args = array(
186
+ 'label' => __( 'Error Logs', '404-to-301' ),
187
  'default' => 20,
188
  'option' => 'logs_per_page'
189
  );
209
  public function error_list() {
210
  ?>
211
  <div class="wrap">
212
+ <h2><?php _e( '404 Error Logs', '404-to-301' ); ?></h2>
213
  <div id="poststuff">
214
  <div id="post-body" class="metabox-holder">
215
  <div id="post-body-content">
267
 
268
  global $menu;
269
 
270
+ $menu[90][0] = __( '404 to 301', '404-to-301' );
271
  }
272
 
273
  /**
336
  $plugin_file = basename( '404-to-301.php' );
337
 
338
  if ( basename( $file ) === $plugin_file ) {
339
+ $settings_link = '<a href="admin.php?page=jj4t3-settings">' . __( 'Settings', '404-to-301' ) . '</a>';
340
+ $settings_link .= ' | <a href="admin.php?page=jj4t3-logs">' . __( 'Logs', '404-to-301' ) . '</a>';
341
 
342
  // Add quick links to plugins listing page.
343
  array_unshift( $links, $settings_link );
includes/admin/class-jj4t3-log-listing.php CHANGED
@@ -43,8 +43,8 @@ class JJ4T3_Log_Listing extends WP_List_Table {
43
 
44
  parent::__construct(
45
  array(
46
- 'singular' => __( '404 Error Log', JJ4T3_DOMAIN ),
47
- 'plural' => __( '404 Error Logs', JJ4T3_DOMAIN ),
48
  'ajax' => false,
49
  )
50
  );
@@ -325,12 +325,12 @@ class JJ4T3_Log_Listing extends WP_List_Table {
325
 
326
  $columns = array(
327
  'cb' => '<input type="checkbox" style="width: 5%;" />',
328
- 'date' => __( 'Date', JJ4T3_DOMAIN ),
329
- 'url' => __( '404 Path', JJ4T3_DOMAIN ),
330
- 'ref' => __( 'From', JJ4T3_DOMAIN ),
331
- 'ip' => __( 'IP Address', JJ4T3_DOMAIN ),
332
- 'ua' => __( 'User Agent', JJ4T3_DOMAIN ),
333
- 'redirect' => __( 'Customization', JJ4T3_DOMAIN )
334
  );
335
 
336
  /**
@@ -394,7 +394,7 @@ class JJ4T3_Log_Listing extends WP_List_Table {
394
  *
395
  * @since 3.0.0
396
  */
397
- _e( apply_filters( 'jj4t3_log_list_no_items_message', __( 'Ah! You are so clean that you still got ZERO errors.', JJ4T3_DOMAIN ) ) );
398
  }
399
 
400
  /**
@@ -472,9 +472,9 @@ class JJ4T3_Log_Listing extends WP_List_Table {
472
 
473
  $title = mysql2date( "j M Y, g:i a", $item['date'] );
474
 
475
- $confirm = __( 'Are you sure you want to delete this item?', JJ4T3_DOMAIN );
476
 
477
- $actions = array( 'delete' => sprintf( '<a href="?page=jj4t3-logs&action=%s&bulk-delete=%s&_wpnonce=%s" onclick="return confirm(\'%s\');">' . __( 'Delete', JJ4T3_DOMAIN ) . '</a>', 'delete', absint( $item['id'] ), $delete_nonce, $confirm ) );
478
 
479
  /**
480
  * Filter to change date colum html content.
@@ -621,9 +621,9 @@ class JJ4T3_Log_Listing extends WP_List_Table {
621
  $link = esc_url( $item['redirect'] );
622
 
623
  // Get default text if empty value.
624
- $title = empty( $link ) ? __( 'Default', JJ4T3_DOMAIN ) : $link;
625
 
626
- $redirect = '<a href="javascript:void(0)" title="' . __( 'Customize', JJ4T3_DOMAIN ) . '" class="jj4t3_redirect_thickbox" url_404="' . esc_url( $item['url'] ) . '" wpnonce="' . wp_create_nonce( "jj4t3_redirect_nonce" ) . '">' . $title . '</a>';
627
 
628
  return $redirect;
629
  }
@@ -693,9 +693,9 @@ class JJ4T3_Log_Listing extends WP_List_Table {
693
  public function get_bulk_actions() {
694
 
695
  $actions = array(
696
- 'bulk_delete' => __( 'Delete Selected', JJ4T3_DOMAIN ),
697
- 'bulk_clean' => __( 'Delete All', JJ4T3_DOMAIN ),
698
- 'bulk_delete_all' => __( 'Delete All (Keep redirects)', JJ4T3_DOMAIN ),
699
  );
700
 
701
  /**
@@ -732,13 +732,21 @@ class JJ4T3_Log_Listing extends WP_List_Table {
732
  // Add dropdown.
733
  echo '<div class="alignleft actions bulkactions">';
734
  echo '<select name="group_by_top" class="404_group_by">';
735
- echo '<option value="">' . __( 'Group by', JJ4T3_DOMAIN ) . '</option>';
736
  foreach ( $column_names as $column ) {
737
  echo '<option value="' . $column . '" ' . selected( $column, $this->group_by ) . '>' . $available_columns[ $column ] . '</option>';
738
  }
739
  echo '</select>';
740
- submit_button( __( 'Apply', JJ4T3_DOMAIN ), 'button', 'filter_action', false, array( 'id' => 'post-query' ) );
741
  echo '</div>';
 
 
 
 
 
 
 
 
742
  }
743
  }
744
 
43
 
44
  parent::__construct(
45
  array(
46
+ 'singular' => __( '404 Error Log', '404-to-301' ),
47
+ 'plural' => __( '404 Error Logs', '404-to-301' ),
48
  'ajax' => false,
49
  )
50
  );
325
 
326
  $columns = array(
327
  'cb' => '<input type="checkbox" style="width: 5%;" />',
328
+ 'date' => __( 'Date', '404-to-301' ),
329
+ 'url' => __( '404 Path', '404-to-301' ),
330
+ 'ref' => __( 'From', '404-to-301' ),
331
+ 'ip' => __( 'IP Address', '404-to-301' ),
332
+ 'ua' => __( 'User Agent', '404-to-301' ),
333
+ 'redirect' => __( 'Customization', '404-to-301' )
334
  );
335
 
336
  /**
394
  *
395
  * @since 3.0.0
396
  */
397
+ _e( apply_filters( 'jj4t3_log_list_no_items_message', __( 'Ah! You are so clean that you still got ZERO errors.', '404-to-301' ) ) );
398
  }
399
 
400
  /**
472
 
473
  $title = mysql2date( "j M Y, g:i a", $item['date'] );
474
 
475
+ $confirm = __( 'Are you sure you want to delete this item?', '404-to-301' );
476
 
477
+ $actions = array( 'delete' => sprintf( '<a href="?page=jj4t3-logs&action=%s&bulk-delete=%s&_wpnonce=%s" onclick="return confirm(\'%s\');">' . __( 'Delete', '404-to-301' ) . '</a>', 'delete', absint( $item['id'] ), $delete_nonce, $confirm ) );
478
 
479
  /**
480
  * Filter to change date colum html content.
621
  $link = esc_url( $item['redirect'] );
622
 
623
  // Get default text if empty value.
624
+ $title = empty( $link ) ? __( 'Default', '404-to-301' ) : $link;
625
 
626
+ $redirect = '<a href="javascript:void(0)" title="' . __( 'Customize', '404-to-301' ) . '" class="jj4t3_redirect_thickbox" url_404="' . esc_url( $item['url'] ) . '" wpnonce="' . wp_create_nonce( "jj4t3_redirect_nonce" ) . '">' . $title . '</a>';
627
 
628
  return $redirect;
629
  }
693
  public function get_bulk_actions() {
694
 
695
  $actions = array(
696
+ 'bulk_delete' => __( 'Delete Selected', '404-to-301' ),
697
+ 'bulk_clean' => __( 'Delete All', '404-to-301' ),
698
+ 'bulk_delete_all' => __( 'Delete All (Keep redirects)', '404-to-301' ),
699
  );
700
 
701
  /**
732
  // Add dropdown.
733
  echo '<div class="alignleft actions bulkactions">';
734
  echo '<select name="group_by_top" class="404_group_by">';
735
+ echo '<option value="">' . __( 'Group by', '404-to-301' ) . '</option>';
736
  foreach ( $column_names as $column ) {
737
  echo '<option value="' . $column . '" ' . selected( $column, $this->group_by ) . '>' . $available_columns[ $column ] . '</option>';
738
  }
739
  echo '</select>';
740
+ submit_button( __( 'Apply', '404-to-301' ), 'button', 'filter_action', false, array( 'id' => 'post-query' ) );
741
  echo '</div>';
742
+
743
+ /**
744
+ * Action hook to add extra items in actions area.
745
+ *
746
+ * @param object $this Class instance.
747
+ * @param string $which Current location (top or bottom).
748
+ */
749
+ do_action( 'jj4t3_log_list_extra_tablenav', $this, $which );
750
  }
751
  }
752
 
includes/admin/images/gray-grad.png DELETED
Binary file
includes/admin/js/admin.min.js DELETED
@@ -1 +0,0 @@
1
- !function(t){"use strict";t(function(){t("#jj4t3_redirect_to").change(function(){switch(t(this).val()){case"page":t("#custom_page").show(),t("#custom_url").hide();break;case"link":t("#custom_url").show(),t("#custom_page").hide();break;default:t("#custom_page").hide(),t("#custom_url").hide()}}),t(".jj4t3_redirect_thickbox").on("click",function(){var i={action:"jj4t3_redirect_thickbox",url_404:t(this).attr("url_404"),nonce:t(this).attr("wpnonce")};t.post(ajaxurl,i,function(i){tb_show(jj4t3strings.redirect,"#TB_inline?width=700&height=370&inlineId=jj4t3-redirect-modal"),t("#jj4t3_redirect_404").val(i.url_404),t("#jj4t3_redirect_404_text").html(i.url_404),t("#jj4t3_redirect_url").val(i.url),t("#jj4t3_custom_redirect_type").val(i.type),e("jj4t3_custom_redirect_redirect",i.redirect),e("jj4t3_custom_redirect_log",i.log),e("jj4t3_custom_redirect_alert",i.alert)})}),t("#jj4t3_custom_redirect_submit").on("click",function(){t(this).addClass("disabled"),t(".jj4t3-spinner").css("visibility","visible");var e=t("#jj4t3_custom_redirect_form").serialize();t.post(ajaxurl,e,function(e){tb_remove(),t("#jj4t3_custom_redirect_submit").removeClass("disabled"),t(".j4t3-spinner").css("visibility","hidden"),location.reload()})});var e=function(e,i){t("input[name="+e+"][value="+i+"]").prop("checked",!0)}})}(jQuery);
 
includes/admin/js/index.php DELETED
@@ -1 +0,0 @@
1
- <?php // Silence is golden
 
includes/admin/views/admin.php CHANGED
@@ -18,13 +18,13 @@ defined( 'ABSPATH' ) or exit;
18
  ?>
19
  <div class="wrap">
20
 
21
- <h2 class="jj4t3-h2"><?php _e( '404 to 301', JJ4T3_DOMAIN ); ?> <span class="subtitle"><?php printf( __( 'by <a href="%s">Joel James</a>', JJ4T3_DOMAIN ), 'https://duckdev.com' ); ?> ( v<?php echo JJ4T3_VERSION; ?> )</span></h2><br/>
22
 
23
  <!-- Settings updated message -->
24
  <?php settings_errors(); ?>
25
 
26
  <h2 class="nav-tab-wrapper">
27
- <a href="?page=jj4t3-settings" class="nav-tab nav-tab-active"><span class="dashicons dashicons-admin-generic"></span> <?php _e( 'Settings', JJ4T3_DOMAIN ); ?></a>
28
  <?php do_action( 'jj4t3_settings_tab' ); // Action hook to add new items to tab. ?>
29
  </h2>
30
 
18
  ?>
19
  <div class="wrap">
20
 
21
+ <h2 class="jj4t3-h2"><?php _e( '404 to 301', '404-to-301' ); ?> <span class="subtitle"><?php printf( __( 'by <a href="%s">Joel James</a>', '404-to-301' ), 'https://duckdev.com' ); ?> ( v<?php echo JJ4T3_VERSION; ?> )</span></h2><br/>
22
 
23
  <!-- Settings updated message -->
24
  <?php settings_errors(); ?>
25
 
26
  <h2 class="nav-tab-wrapper">
27
+ <a href="?page=jj4t3-settings" class="nav-tab nav-tab-active"><span class="dashicons dashicons-admin-generic"></span> <?php _e( 'Settings', '404-to-301' ); ?></a>
28
  <?php do_action( 'jj4t3_settings_tab' ); // Action hook to add new items to tab. ?>
29
  </h2>
30
 
includes/admin/views/custom-redirect.php CHANGED
@@ -8,38 +8,38 @@ defined( 'ABSPATH' ) or exit; ?>
8
  <form id="jj4t3_custom_redirect_form" action="javascript:void(0)">
9
  <table class="form-table">
10
  <tr>
11
- <th><?php _e( 'Redirecting from', JJ4T3_DOMAIN ); ?> :</th>
12
  <td><strong><p id="jj4t3_redirect_404_text"></p></strong></td>
13
  </tr>
14
  <tr>
15
- <th><?php _e( 'Redirect', JJ4T3_DOMAIN ); ?> :</th>
16
  <td>
17
- <input type="radio" name="jj4t3_custom_redirect_redirect" value="-1" checked> <?php _e( 'Default', JJ4T3_DOMAIN ); ?>
18
- <input type="radio" name="jj4t3_custom_redirect_redirect" value="1"> <?php _e( 'Enable', JJ4T3_DOMAIN ); ?>
19
- <input type="radio" name="jj4t3_custom_redirect_redirect" value="0"> <?php _e( 'Disable', JJ4T3_DOMAIN ); ?>
20
  </td>
21
  </tr>
22
  <tr>
23
- <th><?php _e( 'Error logging', JJ4T3_DOMAIN ); ?> :</th>
24
  <td>
25
- <input type="radio" name="jj4t3_custom_redirect_log" value="-1" checked> <?php _e( 'Default', JJ4T3_DOMAIN ); ?>
26
- <input type="radio" name="jj4t3_custom_redirect_log" value="1"> <?php _e( 'Enable', JJ4T3_DOMAIN ); ?>
27
- <input type="radio" name="jj4t3_custom_redirect_log" value="0"> <?php _e( 'Disable', JJ4T3_DOMAIN ); ?>
28
  </td>
29
  </tr>
30
  <tr>
31
- <th><?php _e( 'Email alert', JJ4T3_DOMAIN ); ?> :</th>
32
  <td>
33
- <input type="radio" name="jj4t3_custom_redirect_alert" value="-1" checked> <?php _e( 'Default', JJ4T3_DOMAIN ); ?>
34
- <input type="radio" name="jj4t3_custom_redirect_alert" value="1"> <?php _e( 'Enable', JJ4T3_DOMAIN ); ?>
35
- <input type="radio" name="jj4t3_custom_redirect_alert" value="0"> <?php _e( 'Disable', JJ4T3_DOMAIN ); ?>
36
  </td>
37
  </tr>
38
  <tr>
39
- <th><?php _e( 'Redirect to', JJ4T3_DOMAIN ); ?> :</th>
40
  <td>
41
  <input type="text" size="40" name="jj4t3_custom_redirect" id="jj4t3_redirect_url" value="">
42
- <p class="description"><?php _e( 'Enter the url if you want to set custom redirect for above 404 path. Enter the full url including http://. Leave empty if you want to follow deafult settings.', JJ4T3_DOMAIN ); ?></p>
43
  <input type="hidden" value="" id="jj4t3_redirect_404" name="jj4t3_redirect_404">
44
  <input type="hidden" value="<?php echo wp_create_nonce( "jj4t3_redirect_nonce" ); ?>" id="jj4t3_redirect_nonce" name="jj4t3_redirect_nonce">
45
  <input type="hidden" value="jj4t3_redirect_form" name="action">
@@ -48,21 +48,21 @@ defined( 'ABSPATH' ) or exit; ?>
48
  <?php $statuses = jj4t3_redirect_statuses(); ?>
49
  <?php if ( ! empty( $statuses ) ) : ?>
50
  <tr>
51
- <th><?php _e( 'Redirect type', JJ4T3_DOMAIN ); ?></th>
52
  <td>
53
  <select name="jj4t3_custom_redirect_type" id="jj4t3_custom_redirect_type">
54
  <?php foreach ( $statuses as $status => $label ) : ?>
55
  <option value='<?php echo $status; ?>' <?php selected( jj4t3_get_option( 'redirect_type' ), $status ); ?>><?php echo $label; ?></option>
56
  <?php endforeach; ?>
57
  </select>
58
- <p class="description jj4t3-p-desc"><?php _e( 'Select redirect type to override default one.', JJ4T3_DOMAIN ); ?></p>
59
  </td>
60
  </tr>
61
  <?php endif; ?>
62
  <tr>
63
  <td><span class="spinner jj4t3-spinner"></span></td>
64
  <td>
65
- <?php submit_button( __( 'Save Redirect', JJ4T3_DOMAIN ), 'primary', 'jj4t3_custom_redirect_submit', false, array( 'id' => 'jj4t3_custom_redirect_submit' ) ); ?>
66
  </td>
67
  </tr>
68
  </table>
8
  <form id="jj4t3_custom_redirect_form" action="javascript:void(0)">
9
  <table class="form-table">
10
  <tr>
11
+ <th><?php _e( 'Redirecting from', '404-to-301' ); ?> :</th>
12
  <td><strong><p id="jj4t3_redirect_404_text"></p></strong></td>
13
  </tr>
14
  <tr>
15
+ <th><?php _e( 'Redirect', '404-to-301' ); ?> :</th>
16
  <td>
17
+ <input type="radio" name="jj4t3_custom_redirect_redirect" value="-1" checked> <?php _e( 'Default', '404-to-301' ); ?>
18
+ <input type="radio" name="jj4t3_custom_redirect_redirect" value="1"> <?php _e( 'Enable', '404-to-301' ); ?>
19
+ <input type="radio" name="jj4t3_custom_redirect_redirect" value="0"> <?php _e( 'Disable', '404-to-301' ); ?>
20
  </td>
21
  </tr>
22
  <tr>
23
+ <th><?php _e( 'Error logging', '404-to-301' ); ?> :</th>
24
  <td>
25
+ <input type="radio" name="jj4t3_custom_redirect_log" value="-1" checked> <?php _e( 'Default', '404-to-301' ); ?>
26
+ <input type="radio" name="jj4t3_custom_redirect_log" value="1"> <?php _e( 'Enable', '404-to-301' ); ?>
27
+ <input type="radio" name="jj4t3_custom_redirect_log" value="0"> <?php _e( 'Disable', '404-to-301' ); ?>
28
  </td>
29
  </tr>
30
  <tr>
31
+ <th><?php _e( 'Email alert', '404-to-301' ); ?> :</th>
32
  <td>
33
+ <input type="radio" name="jj4t3_custom_redirect_alert" value="-1" checked> <?php _e( 'Default', '404-to-301' ); ?>
34
+ <input type="radio" name="jj4t3_custom_redirect_alert" value="1"> <?php _e( 'Enable', '404-to-301' ); ?>
35
+ <input type="radio" name="jj4t3_custom_redirect_alert" value="0"> <?php _e( 'Disable', '404-to-301' ); ?>
36
  </td>
37
  </tr>
38
  <tr>
39
+ <th><?php _e( 'Redirect to', '404-to-301' ); ?> :</th>
40
  <td>
41
  <input type="text" size="40" name="jj4t3_custom_redirect" id="jj4t3_redirect_url" value="">
42
+ <p class="description"><?php _e( 'Enter the url if you want to set custom redirect for above 404 path. Enter the full url including http://. Leave empty if you want to follow deafult settings.', '404-to-301' ); ?></p>
43
  <input type="hidden" value="" id="jj4t3_redirect_404" name="jj4t3_redirect_404">
44
  <input type="hidden" value="<?php echo wp_create_nonce( "jj4t3_redirect_nonce" ); ?>" id="jj4t3_redirect_nonce" name="jj4t3_redirect_nonce">
45
  <input type="hidden" value="jj4t3_redirect_form" name="action">
48
  <?php $statuses = jj4t3_redirect_statuses(); ?>
49
  <?php if ( ! empty( $statuses ) ) : ?>
50
  <tr>
51
+ <th><?php _e( 'Redirect type', '404-to-301' ); ?></th>
52
  <td>
53
  <select name="jj4t3_custom_redirect_type" id="jj4t3_custom_redirect_type">
54
  <?php foreach ( $statuses as $status => $label ) : ?>
55
  <option value='<?php echo $status; ?>' <?php selected( jj4t3_get_option( 'redirect_type' ), $status ); ?>><?php echo $label; ?></option>
56
  <?php endforeach; ?>
57
  </select>
58
+ <p class="description jj4t3-p-desc"><?php _e( 'Select redirect type to override default one.', '404-to-301' ); ?></p>
59
  </td>
60
  </tr>
61
  <?php endif; ?>
62
  <tr>
63
  <td><span class="spinner jj4t3-spinner"></span></td>
64
  <td>
65
+ <?php submit_button( __( 'Save Redirect', '404-to-301' ), 'primary', 'jj4t3_custom_redirect_submit', false, array( 'id' => 'jj4t3_custom_redirect_submit' ) ); ?>
66
  </td>
67
  </tr>
68
  </table>
includes/admin/views/settings.php CHANGED
@@ -14,77 +14,77 @@ defined( 'ABSPATH' ) or exit; ?>
14
  <?php $statuses = jj4t3_redirect_statuses(); ?>
15
  <?php if ( !empty( $statuses ) ) : ?>
16
  <tr>
17
- <th><?php _e( 'Redirect type', JJ4T3_DOMAIN ); ?></th>
18
  <td>
19
  <select name='i4t3_gnrl_options[redirect_type]'>
20
  <?php foreach ( $statuses as $status => $label ) : ?>
21
  <option value='<?php echo $status; ?>' <?php selected( $options['redirect_type'], $status ); ?>><?php echo $label; ?></option>
22
  <?php endforeach; ?>
23
  </select>
24
- <p class="description jj4t3-p-desc"><a target="_blank" href="https://moz.com/learn/seo/redirection"><strong><?php _e( 'Learn more', JJ4T3_DOMAIN ); ?></strong></a> <?php _e( 'about these redirect types', JJ4T3_DOMAIN ); ?>
25
  </p>
26
  </td>
27
  </tr>
28
  <?php endif; ?>
29
  <tr>
30
- <th><?php _e( 'Redirect to', JJ4T3_DOMAIN ); ?></th>
31
  <td>
32
  <select name='i4t3_gnrl_options[redirect_to]' id='jj4t3_redirect_to'>
33
- <option value='page' <?php selected( $options['redirect_to'], 'page' ); ?>><?php _e( 'Existing Page', JJ4T3_DOMAIN ); ?></option>
34
- <option value='link' <?php selected( $options['redirect_to'], 'link' ); ?>><?php _e( 'Custom URL', JJ4T3_DOMAIN ); ?></option>
35
- <option value='0' <?php selected( $options['redirect_to'], 0 ); ?>><?php _e( 'No Redirect', JJ4T3_DOMAIN ); ?></option>
36
  </select>
37
- <p class="description jj4t3-p-desc"><strong><?php _e( 'Existing Page', JJ4T3_DOMAIN ); ?>:</strong> <?php _e( 'Select any WordPress page as a 404 page', JJ4T3_DOMAIN ); ?>.</p>
38
- <p class="description jj4t3-p-desc"><strong><?php _e( 'Custom URL', JJ4T3_DOMAIN ); ?>:</strong> <?php _e( 'Redirect 404 requests to a specific URL', JJ4T3_DOMAIN ); ?>.</p>
39
- <p class="description jj4t3-p-desc"><strong><?php _e( 'No Redirect', JJ4T3_DOMAIN ); ?>:</strong> <?php _e( 'To disable redirect', JJ4T3_DOMAIN ); ?>.</p>
40
- <p class="description jj4t3-p-desc"><strong><?php _e( 'You can override this by setting individual custom redirects from error logs list.', JJ4T3_DOMAIN ); ?></strong></p>
41
  </td>
42
  </tr>
43
  <tr id="custom_page" class="<?php echo $cp_style; ?>">
44
- <th><?php _e( 'Select the page', JJ4T3_DOMAIN ); ?></th>
45
  <td>
46
  <?php wp_dropdown_pages( array( 'name' => 'i4t3_gnrl_options[redirect_page]', 'selected' => $options['redirect_page'] ) ); ?>
47
- <p class="description jj4t3-p-desc"><?php _e( 'The default 404 page will be replaced by the page you choose in this list.', JJ4T3_DOMAIN ); ?></p>
48
- <p class="description jj4t3-p-desc"><?php printf( __( 'You can <a href="%s" target="_blank">create a custom 404</a> page and assign that page here.', JJ4T3_DOMAIN ), admin_url( 'post-new.php?post_type=page' ) ); ?></p>
49
  </td>
50
  </tr>
51
  <tr id="custom_url" class="<?php echo $cl_style; ?>">
52
- <th><?php _e( 'Custom URL', JJ4T3_DOMAIN ); ?></th>
53
  <td>
54
  <input type="url" size="40" placeholder="<?php echo home_url(); ?>" name="i4t3_gnrl_options[redirect_link]" value="<?php echo $options['redirect_link']; ?>">
55
- <p class="description jj4t3-p-desc"><?php _e( 'Enter any url (including http://)', JJ4T3_DOMAIN ); ?></p>
56
  </td>
57
  </tr>
58
  <tr>
59
- <th><?php _e( 'Log 404 Errors', JJ4T3_DOMAIN ); ?></th>
60
  <td>
61
  <input type="checkbox" name="i4t3_gnrl_options[redirect_log]" value="1" <?php checked( jj4t3_get_option( 'redirect_log' ), 1 ); ?> />
62
- <p class="description jj4t3-p-desc"><?php _e( 'Enable/Disable Logging', JJ4T3_DOMAIN ); ?></p>
63
  </td>
64
  </tr>
65
  <tr>
66
- <th><?php _e( 'Email notifications', JJ4T3_DOMAIN ); ?></th>
67
  <td>
68
  <input type="checkbox" name="i4t3_gnrl_options[email_notify]" value="1" <?php checked( jj4t3_get_option( 'email_notify' ), 1 ); ?> />
69
- <p class="description jj4t3-p-desc"><?php _e( 'If you check this, an email will be sent on every 404 log on the admin email account.', JJ4T3_DOMAIN ); ?></p>
70
  </td>
71
  </tr>
72
  <tr>
73
- <th><?php _e( 'Email address', JJ4T3_DOMAIN ); ?></th>
74
  <td>
75
  <?php $notify_address = ( isset( $options['email_notify_address'] ) ) ? $options['email_notify_address'] : get_option( 'admin_email' ); ?>
76
  <input type="email" placeholder="<?php echo get_option( 'admin_email' ); ?>" name="i4t3_gnrl_options[email_notify_address]" value="<?php echo $notify_address; ?>">
77
- <p class="description jj4t3-p-desc"><?php _e( 'Change the recipient email address for error log notifications.', JJ4T3_DOMAIN ); ?></p>
78
  </td>
79
  </tr>
80
  <tr>
81
- <th><?php _e( 'Exclude paths', JJ4T3_DOMAIN ); ?></th>
82
  <td>
83
  <textarea rows="5" cols="50" placeholder="wp-content/plugins/abc-plugin/css/" name="i4t3_gnrl_options[exclude_paths]"><?php echo $options['exclude_paths']; ?></textarea>
84
- <p class="description jj4t3-p-desc"><?php _e( 'If you want to exclude few paths from error logs, enter here. One per line.', JJ4T3_DOMAIN ); ?></p>
85
  </td>
86
  </tr>
87
  </tbody>
88
  </table>
89
- <?php submit_button( __( 'Save settings', JJ4T3_DOMAIN ) ); ?>
90
  </form><!-- /.form -->
14
  <?php $statuses = jj4t3_redirect_statuses(); ?>
15
  <?php if ( !empty( $statuses ) ) : ?>
16
  <tr>
17
+ <th><?php _e( 'Redirect type', '404-to-301' ); ?></th>
18
  <td>
19
  <select name='i4t3_gnrl_options[redirect_type]'>
20
  <?php foreach ( $statuses as $status => $label ) : ?>
21
  <option value='<?php echo $status; ?>' <?php selected( $options['redirect_type'], $status ); ?>><?php echo $label; ?></option>
22
  <?php endforeach; ?>
23
  </select>
24
+ <p class="description jj4t3-p-desc"><a target="_blank" href="https://moz.com/learn/seo/redirection"><strong><?php _e( 'Learn more', '404-to-301' ); ?></strong></a> <?php _e( 'about these redirect types', '404-to-301' ); ?>
25
  </p>
26
  </td>
27
  </tr>
28
  <?php endif; ?>
29
  <tr>
30
+ <th><?php _e( 'Redirect to', '404-to-301' ); ?></th>
31
  <td>
32
  <select name='i4t3_gnrl_options[redirect_to]' id='jj4t3_redirect_to'>
33
+ <option value='page' <?php selected( $options['redirect_to'], 'page' ); ?>><?php _e( 'Existing Page', '404-to-301' ); ?></option>
34
+ <option value='link' <?php selected( $options['redirect_to'], 'link' ); ?>><?php _e( 'Custom URL', '404-to-301' ); ?></option>
35
+ <option value='0' <?php selected( $options['redirect_to'], 0 ); ?>><?php _e( 'No Redirect', '404-to-301' ); ?></option>
36
  </select>
37
+ <p class="description jj4t3-p-desc"><strong><?php _e( 'Existing Page', '404-to-301' ); ?>:</strong> <?php _e( 'Select any WordPress page as a 404 page', '404-to-301' ); ?>.</p>
38
+ <p class="description jj4t3-p-desc"><strong><?php _e( 'Custom URL', '404-to-301' ); ?>:</strong> <?php _e( 'Redirect 404 requests to a specific URL', '404-to-301' ); ?>.</p>
39
+ <p class="description jj4t3-p-desc"><strong><?php _e( 'No Redirect', '404-to-301' ); ?>:</strong> <?php _e( 'To disable redirect', '404-to-301' ); ?>.</p>
40
+ <p class="description jj4t3-p-desc"><strong><?php _e( 'You can override this by setting individual custom redirects from error logs list.', '404-to-301' ); ?></strong></p>
41
  </td>
42
  </tr>
43
  <tr id="custom_page" class="<?php echo $cp_style; ?>">
44
+ <th><?php _e( 'Select the page', '404-to-301' ); ?></th>
45
  <td>
46
  <?php wp_dropdown_pages( array( 'name' => 'i4t3_gnrl_options[redirect_page]', 'selected' => $options['redirect_page'] ) ); ?>
47
+ <p class="description jj4t3-p-desc"><?php _e( 'The default 404 page will be replaced by the page you choose in this list.', '404-to-301' ); ?></p>
48
+ <p class="description jj4t3-p-desc"><?php printf( __( 'You can <a href="%s" target="_blank">create a custom 404</a> page and assign that page here.', '404-to-301' ), admin_url( 'post-new.php?post_type=page' ) ); ?></p>
49
  </td>
50
  </tr>
51
  <tr id="custom_url" class="<?php echo $cl_style; ?>">
52
+ <th><?php _e( 'Custom URL', '404-to-301' ); ?></th>
53
  <td>
54
  <input type="url" size="40" placeholder="<?php echo home_url(); ?>" name="i4t3_gnrl_options[redirect_link]" value="<?php echo $options['redirect_link']; ?>">
55
+ <p class="description jj4t3-p-desc"><?php _e( 'Enter any url (including http://)', '404-to-301' ); ?></p>
56
  </td>
57
  </tr>
58
  <tr>
59
+ <th><?php _e( 'Log 404 Errors', '404-to-301' ); ?></th>
60
  <td>
61
  <input type="checkbox" name="i4t3_gnrl_options[redirect_log]" value="1" <?php checked( jj4t3_get_option( 'redirect_log' ), 1 ); ?> />
62
+ <p class="description jj4t3-p-desc"><?php _e( 'Enable/Disable Logging', '404-to-301' ); ?></p>
63
  </td>
64
  </tr>
65
  <tr>
66
+ <th><?php _e( 'Email notifications', '404-to-301' ); ?></th>
67
  <td>
68
  <input type="checkbox" name="i4t3_gnrl_options[email_notify]" value="1" <?php checked( jj4t3_get_option( 'email_notify' ), 1 ); ?> />
69
+ <p class="description jj4t3-p-desc"><?php _e( 'If you check this, an email will be sent on every 404 log on the admin email account.', '404-to-301' ); ?></p>
70
  </td>
71
  </tr>
72
  <tr>
73
+ <th><?php _e( 'Email address', '404-to-301' ); ?></th>
74
  <td>
75
  <?php $notify_address = ( isset( $options['email_notify_address'] ) ) ? $options['email_notify_address'] : get_option( 'admin_email' ); ?>
76
  <input type="email" placeholder="<?php echo get_option( 'admin_email' ); ?>" name="i4t3_gnrl_options[email_notify_address]" value="<?php echo $notify_address; ?>">
77
+ <p class="description jj4t3-p-desc"><?php _e( 'Change the recipient email address for error log notifications.', '404-to-301' ); ?></p>
78
  </td>
79
  </tr>
80
  <tr>
81
+ <th><?php _e( 'Exclude paths', '404-to-301' ); ?></th>
82
  <td>
83
  <textarea rows="5" cols="50" placeholder="wp-content/plugins/abc-plugin/css/" name="i4t3_gnrl_options[exclude_paths]"><?php echo $options['exclude_paths']; ?></textarea>
84
+ <p class="description jj4t3-p-desc"><?php _e( 'If you want to exclude few paths from error logs, enter here. One per line.', '404-to-301' ); ?></p>
85
  </td>
86
  </tr>
87
  </tbody>
88
  </table>
89
+ <?php submit_button( __( 'Save settings', '404-to-301' ) ); ?>
90
  </form><!-- /.form -->
includes/class-jj4t3-i18n.php CHANGED
@@ -37,7 +37,7 @@ class JJ4T3_i18n {
37
  */
38
  public function textdomain() {
39
 
40
- load_plugin_textdomain( JJ4T3_DOMAIN, false, JJ4T3_DIR . '/languages/' );
41
  }
42
 
43
  }
37
  */
38
  public function textdomain() {
39
 
40
+ load_plugin_textdomain( '404-to-301', false, JJ4T3_DIR . '/languages/' );
41
  }
42
 
43
  }
includes/functions/jj4t3-general-functions.php CHANGED
@@ -280,9 +280,9 @@ function jj4t3_is_human() {
280
  function jj4t3_redirect_statuses() {
281
 
282
  $statuses = array(
283
- 301 => __( '301 Redirect (SEO)', JJ4T3_DOMAIN ),
284
- 302 => __( '302 Redirect', JJ4T3_DOMAIN ),
285
- 307 => __( '307 Redirect', JJ4T3_DOMAIN ),
286
  );
287
 
288
  /**
@@ -314,12 +314,12 @@ function jj4t3_redirect_statuses() {
314
  function jj4t3_log_columns() {
315
 
316
  $columns = array(
317
- 'date' => __( 'Date', JJ4T3_DOMAIN ),
318
- 'url' => __( '404 Path', JJ4T3_DOMAIN ),
319
- 'ref' => __( 'From', JJ4T3_DOMAIN ),
320
- 'ip' => __( 'IP Address', JJ4T3_DOMAIN ),
321
- 'ua' => __( 'User Agent', JJ4T3_DOMAIN ),
322
- 'redirect' => __( 'Redirect', JJ4T3_DOMAIN ),
323
  );
324
 
325
  /**
280
  function jj4t3_redirect_statuses() {
281
 
282
  $statuses = array(
283
+ 301 => __( '301 Redirect (SEO)', '404-to-301' ),
284
+ 302 => __( '302 Redirect', '404-to-301' ),
285
+ 307 => __( '307 Redirect', '404-to-301' ),
286
  );
287
 
288
  /**
314
  function jj4t3_log_columns() {
315
 
316
  $columns = array(
317
+ 'date' => __( 'Date', '404-to-301' ),
318
+ 'url' => __( '404 Path', '404-to-301' ),
319
+ 'ref' => __( 'From', '404-to-301' ),
320
+ 'ip' => __( 'IP Address', '404-to-301' ),
321
+ 'ua' => __( 'User Agent', '404-to-301' ),
322
+ 'redirect' => __( 'Redirect', '404-to-301' ),
323
  );
324
 
325
  /**
includes/public/class-jj4t3-404-actions.php CHANGED
@@ -119,7 +119,7 @@ class JJ4T3_404_Actions extends JJ4T3_404_Data {
119
  // Set options for current 404.
120
  $this->set_options();
121
 
122
- // Log errotr details to database.
123
  $this->log_error();
124
 
125
  // Send email alert about the error.
@@ -129,53 +129,53 @@ class JJ4T3_404_Actions extends JJ4T3_404_Data {
129
  $this->redirect();
130
 
131
  } catch ( Exception $ex ) {
132
- // Stay cool.
133
  }
134
  }
135
 
136
  /**
137
- * Log details of error to the database.
138
  *
139
  * @since 3.0.0
140
  * @access public
141
  *
142
  * @return void
143
  */
144
- public function log_error() {
145
 
146
- // Only if we can.
147
- if ( ! $this->log_enabled ) {
 
 
 
 
148
  return;
149
  }
150
 
151
- // Error logging class.
152
- $logging = new JJ4T3_404_Logging( $this );
153
- $logging->log_error();
 
154
  }
155
 
156
  /**
157
- * Send email about the error.
158
  *
159
  * @since 3.0.0
160
  * @access public
161
  *
162
  * @return void
163
  */
164
- public function email_alert() {
165
 
166
- /**
167
- * Filter to completely disable email alerts.
168
- *
169
- * @since 3.0.0
170
- */
171
- if ( ! apply_filters( 'jj4t3_can_email_alert', $this->alert_enabled ) ) {
172
  return;
173
  }
174
 
175
-
176
- // Email alert class.
177
- $email = new JJ4T3_404_Email( $this );
178
- $email->send_email();
179
  }
180
 
181
  /**
@@ -360,7 +360,7 @@ class JJ4T3_404_Actions extends JJ4T3_404_Data {
360
  $enabled = jj4t3_log_enabled();
361
  }
362
 
363
- if ( $enabled && jj4t3_is_human() ) {
364
  $this->log_enabled = true;
365
  }
366
  }
@@ -387,7 +387,7 @@ class JJ4T3_404_Actions extends JJ4T3_404_Data {
387
  $enabled = jj4t3_email_notify_enabled();
388
  }
389
 
390
- if ( $enabled && jj4t3_is_human() ) {
391
  $this->alert_enabled = true;
392
  }
393
  }
119
  // Set options for current 404.
120
  $this->set_options();
121
 
122
+ // Log error details to database.
123
  $this->log_error();
124
 
125
  // Send email alert about the error.
129
  $this->redirect();
130
 
131
  } catch ( Exception $ex ) {
132
+ // Who cares?
133
  }
134
  }
135
 
136
  /**
137
+ * Send email about the error.
138
  *
139
  * @since 3.0.0
140
  * @access public
141
  *
142
  * @return void
143
  */
144
+ public function email_alert() {
145
 
146
+ /**
147
+ * Filter to completely disable email alerts.
148
+ *
149
+ * @since 3.0.0
150
+ */
151
+ if ( ! apply_filters( 'jj4t3_can_email_alert', $this->alert_enabled ) ) {
152
  return;
153
  }
154
 
155
+
156
+ // Email alert class.
157
+ $email = new JJ4T3_404_Email( $this );
158
+ $email->send_email();
159
  }
160
 
161
  /**
162
+ * Log details of error to the database.
163
  *
164
  * @since 3.0.0
165
  * @access public
166
  *
167
  * @return void
168
  */
169
+ public function log_error() {
170
 
171
+ // Only if we can.
172
+ if ( ! $this->log_enabled ) {
 
 
 
 
173
  return;
174
  }
175
 
176
+ // Error logging class.
177
+ $logging = new JJ4T3_404_Logging( $this );
178
+ $logging->log_error();
 
179
  }
180
 
181
  /**
360
  $enabled = jj4t3_log_enabled();
361
  }
362
 
363
+ if ( $enabled && jj4t3_is_human() && $this->common_check_passed ) {
364
  $this->log_enabled = true;
365
  }
366
  }
387
  $enabled = jj4t3_email_notify_enabled();
388
  }
389
 
390
+ if ( $enabled && jj4t3_is_human() && $this->common_check_passed ) {
391
  $this->alert_enabled = true;
392
  }
393
  }
includes/public/class-jj4t3-404-email.php CHANGED
@@ -138,7 +138,7 @@ class JJ4T3_404_Email {
138
  private function set_subject() {
139
 
140
  // Include site title.
141
- $message = __( 'Snap! One more 404 on ', JJ4T3_DOMAIN ) . get_bloginfo( 'name' );
142
 
143
  /**
144
  * Filter to alter email subject text.
@@ -186,31 +186,31 @@ class JJ4T3_404_Email {
186
  */
187
  private function set_body() {
188
 
189
- $message = "<p>" . __( 'Bummer! You have one more 404', JJ4T3_DOMAIN ) . "</p>";
190
  $message .= '<table>';
191
  // 404 path.
192
  $message .= '<tr>';
193
- $message .= '<th align="left">' . __( '404 Path', JJ4T3_DOMAIN ) . '</th>';
194
  $message .= '<td align="left">' . $this->error_data->url . '</td>';
195
  $message .= '</tr>';
196
  // IP Address.
197
  $message .= '<tr>';
198
- $message .= '<th align="left">' . __( 'IP Address', JJ4T3_DOMAIN ) . '</th>';
199
  $message .= '<td align="left">' . $this->error_data->ip . '</td>';
200
  $message .= '</tr>';
201
  // Date and time.
202
  $message .= '<tr>';
203
- $message .= '<th align="left">' . __( 'Time', JJ4T3_DOMAIN ) . '</th>';
204
  $message .= '<td align="left">' . $this->error_data->time . '</td>';
205
  $message .= '</tr>';
206
  // Referral url.
207
  $message .= '<tr>';
208
- $message .= '<th align="left">' . __( 'Referral Page', JJ4T3_DOMAIN ) . '</th>';
209
  $message .= '<td align="left">' . $this->error_data->ref . '</td>';
210
  $message .= '</tr>';
211
  $message .= '</table>';
212
  // Who sent me this alert?
213
- $message .= '<p>Alert sent by the <strong>404 to 301</strong> plugin for WordPress.</p>';
214
 
215
  /**
216
  * Filter to alter email content.
138
  private function set_subject() {
139
 
140
  // Include site title.
141
+ $message = __( 'Snap! One more 404 on ', '404-to-301' ) . get_bloginfo( 'name' );
142
 
143
  /**
144
  * Filter to alter email subject text.
186
  */
187
  private function set_body() {
188
 
189
+ $message = "<p>" . __( 'Bummer! You have one more 404', '404-to-301' ) . "</p>";
190
  $message .= '<table>';
191
  // 404 path.
192
  $message .= '<tr>';
193
+ $message .= '<th align="left">' . __( '404 Path', '404-to-301' ) . '</th>';
194
  $message .= '<td align="left">' . $this->error_data->url . '</td>';
195
  $message .= '</tr>';
196
  // IP Address.
197
  $message .= '<tr>';
198
+ $message .= '<th align="left">' . __( 'IP Address', '404-to-301' ) . '</th>';
199
  $message .= '<td align="left">' . $this->error_data->ip . '</td>';
200
  $message .= '</tr>';
201
  // Date and time.
202
  $message .= '<tr>';
203
+ $message .= '<th align="left">' . __( 'Time', '404-to-301' ) . '</th>';
204
  $message .= '<td align="left">' . $this->error_data->time . '</td>';
205
  $message .= '</tr>';
206
  // Referral url.
207
  $message .= '<tr>';
208
+ $message .= '<th align="left">' . __( 'Referral Page', '404-to-301' ) . '</th>';
209
  $message .= '<td align="left">' . $this->error_data->ref . '</td>';
210
  $message .= '</tr>';
211
  $message .= '</table>';
212
  // Who sent me this alert?
213
+ $message .= '<p>' . sprintf( __( 'Alert sent by the %s404 to 301%s plugin for WordPress.', '404-to-301' ), '<strong>', '</strong>' ) . '</p>';
214
 
215
  /**
216
  * Filter to alter email content.
languages/404-to-301.mo ADDED
Binary file
languages/404-to-301.pot CHANGED
@@ -1,23 +1,28 @@
1
- #, fuzzy
 
2
  msgid ""
3
  msgstr ""
4
- "Project-Id-Version: 404 to 301\n"
5
- "POT-Creation-Date: 2018-06-20 00:50+0530\n"
6
- "PO-Revision-Date: 2016-03-22 23:53+0000\n"
7
- "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
 
11
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
12
- "X-Generator: Poedit 1.8.7.1\n"
13
  "X-Poedit-SourceCharset: UTF-8\n"
14
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
15
- "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
16
- "esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
17
- "X-Poedit-Basepath: ..\n"
18
- "X-Poedit-WPHeader: 404-to-301.php\n"
19
- "Last-Translator: \n"
20
  "X-Poedit-SearchPath-0: .\n"
 
 
 
21
 
22
  #: includes/admin/class-jj4t3-admin.php:127
23
  msgid "Custom Redirect"
@@ -45,7 +50,7 @@ msgstr ""
45
  msgid "Error Logs"
46
  msgstr ""
47
 
48
- #: includes/admin/class-jj4t3-admin.php:270 includes/admin/views/admin.php:21
49
  msgid "404 to 301"
50
  msgstr ""
51
 
@@ -92,10 +97,6 @@ msgstr ""
92
  msgid "Customization"
93
  msgstr ""
94
 
95
- #: includes/admin/class-jj4t3-log-listing.php:397
96
- msgid "Ah! You are so clean that you still got ZERO errors."
97
- msgstr ""
98
-
99
  #: includes/admin/class-jj4t3-log-listing.php:475
100
  msgid "Are you sure you want to delete this item?"
101
  msgstr ""
@@ -136,7 +137,6 @@ msgid "Apply"
136
  msgstr ""
137
 
138
  #: includes/admin/views/admin.php:21
139
- #, php-format
140
  msgid "by <a href=\"%s\">Joel James</a>"
141
  msgstr ""
142
 
@@ -229,8 +229,8 @@ msgstr ""
229
 
230
  #: includes/admin/views/settings.php:40
231
  msgid ""
232
- "You can override this by setting individual custom redirects from error logs "
233
- "list."
234
  msgstr ""
235
 
236
  #: includes/admin/views/settings.php:44
@@ -238,12 +238,10 @@ msgid "Select the page"
238
  msgstr ""
239
 
240
  #: includes/admin/views/settings.php:47
241
- msgid ""
242
- "The default 404 page will be replaced by the page you choose in this list."
243
  msgstr ""
244
 
245
  #: includes/admin/views/settings.php:48
246
- #, php-format
247
  msgid ""
248
  "You can <a href=\"%s\" target=\"_blank\">create a custom 404</a> page and "
249
  "assign that page here."
@@ -267,8 +265,8 @@ msgstr ""
267
 
268
  #: includes/admin/views/settings.php:69
269
  msgid ""
270
- "If you check this, an email will be sent on every 404 log on the admin email "
271
- "account."
272
  msgstr ""
273
 
274
  #: includes/admin/views/settings.php:73
@@ -284,8 +282,7 @@ msgid "Exclude paths"
284
  msgstr ""
285
 
286
  #: includes/admin/views/settings.php:84
287
- msgid ""
288
- "If you want to exclude few paths from error logs, enter here. One per line."
289
  msgstr ""
290
 
291
  #: includes/admin/views/settings.php:89
@@ -319,3 +316,26 @@ msgstr ""
319
  #: includes/public/class-jj4t3-404-email.php:208
320
  msgid "Referral Page"
321
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2018 Joel James
2
+ # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: 404 to 301 3.0.1\n"
6
+ "Report-Msgid-Bugs-To: https://duckdev.com/products/404-to-301/\n"
7
+ "POT-Creation-Date: 2018-08-24 08:32:46+00:00\n"
 
8
  "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: Joel James <me@joelsays.com>\n"
13
+ "Language-Team: Joel James <me@joelsays.com>\n"
14
+ "Language: en\n"
15
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-Country: United States\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: "
19
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
20
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
21
+ "X-Poedit-Basepath: ../\n"
 
 
22
  "X-Poedit-SearchPath-0: .\n"
23
+ "X-Poedit-Bookmarks: \n"
24
+ "X-Textdomain-Support: yes\n"
25
+ "X-Generator: grunt-wp-i18n1.0.2\n"
26
 
27
  #: includes/admin/class-jj4t3-admin.php:127
28
  msgid "Custom Redirect"
50
  msgid "Error Logs"
51
  msgstr ""
52
 
53
+ #. Plugin Name of the plugin/theme
54
  msgid "404 to 301"
55
  msgstr ""
56
 
97
  msgid "Customization"
98
  msgstr ""
99
 
 
 
 
 
100
  #: includes/admin/class-jj4t3-log-listing.php:475
101
  msgid "Are you sure you want to delete this item?"
102
  msgstr ""
137
  msgstr ""
138
 
139
  #: includes/admin/views/admin.php:21
 
140
  msgid "by <a href=\"%s\">Joel James</a>"
141
  msgstr ""
142
 
229
 
230
  #: includes/admin/views/settings.php:40
231
  msgid ""
232
+ "You can override this by setting individual custom redirects from error "
233
+ "logs list."
234
  msgstr ""
235
 
236
  #: includes/admin/views/settings.php:44
238
  msgstr ""
239
 
240
  #: includes/admin/views/settings.php:47
241
+ msgid "The default 404 page will be replaced by the page you choose in this list."
 
242
  msgstr ""
243
 
244
  #: includes/admin/views/settings.php:48
 
245
  msgid ""
246
  "You can <a href=\"%s\" target=\"_blank\">create a custom 404</a> page and "
247
  "assign that page here."
265
 
266
  #: includes/admin/views/settings.php:69
267
  msgid ""
268
+ "If you check this, an email will be sent on every 404 log on the admin "
269
+ "email account."
270
  msgstr ""
271
 
272
  #: includes/admin/views/settings.php:73
282
  msgstr ""
283
 
284
  #: includes/admin/views/settings.php:84
285
+ msgid "If you want to exclude few paths from error logs, enter here. One per line."
 
286
  msgstr ""
287
 
288
  #: includes/admin/views/settings.php:89
316
  #: includes/public/class-jj4t3-404-email.php:208
317
  msgid "Referral Page"
318
  msgstr ""
319
+
320
+ #: includes/public/class-jj4t3-404-email.php:213
321
+ msgid "Alert sent by the %s404 to 301%s plugin for WordPress."
322
+ msgstr ""
323
+
324
+ #. Plugin URI of the plugin/theme
325
+ msgid "https://duckdev.com/products/404-to-301/"
326
+ msgstr ""
327
+
328
+ #. Description of the plugin/theme
329
+ msgid ""
330
+ "Automatically redirect all <strong>404 errors</strong> to any page using "
331
+ "<strong>301 redirect for SEO</strong>. You can <strong>redirect and "
332
+ "log</strong> every 404 errors. No more 404 errors in Webmaster tool."
333
+ msgstr ""
334
+
335
+ #. Author of the plugin/theme
336
+ msgid "Joel James"
337
+ msgstr ""
338
+
339
+ #. Author URI of the plugin/theme
340
+ msgid "https://duckdev.com/"
341
+ msgstr ""
languages/index.php DELETED
@@ -1 +0,0 @@
1
- <?php // Silence is golden
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === 404 to 301 - Redirect, Log and Notify 404 Errors ===
2
  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: 4.9
7
- Stable tag: 3.0.0.1
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,15 @@ Bug reports for 404 to 301 are always welcome. [Report here](https://duckdev.com
128
 
129
  == Changelog ==
130
 
 
 
 
 
 
 
 
 
 
131
  = 3.0.0.1 (25/06/2018) =
132
  **Bug Fixes**
133
 
@@ -379,8 +388,11 @@ Bug reports for 404 to 301 are always welcome. [Report here](https://duckdev.com
379
 
380
  == Upgrade Notice ==
381
 
382
- = 3.0.0.1 (25/06/2018) =
383
- **Bug Fixes**
384
 
385
- - Using template_redirect hook for redirect instead of wp hook.
386
- - Fixed an issue with do_action in Freemius SDK.
 
 
 
1
+ === 404 to 301 ===
2
  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: 4.9
7
+ Stable tag: 3.0.1
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.1 (24/08/2018) =
132
+ **👌 Improvements**
133
+
134
+ * Make release automated.
135
+
136
+ **🐛 Bug Fixes**
137
+
138
+ * Do not include exclude path items.
139
+
140
  = 3.0.0.1 (25/06/2018) =
141
  **Bug Fixes**
142
 
388
 
389
  == Upgrade Notice ==
390
 
391
+ = 3.0.1 (24/08/2018) =
392
+ **👌 Improvements**
393
 
394
+ * Make release automated.
395
+
396
+ **🐛 Bug Fixes**
397
+
398
+ * Do not include exclude path items.
vendor/freemius/assets/css/admin/common.css CHANGED
@@ -1,2 +1,2 @@
1
  .theme-browser .theme .fs-premium-theme-badge{position:absolute;top:10px;right:0;background:#71ae00;color:#fff;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);font-size:1.1em}#iframe{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
2
- .fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("../../../../../../../wp-admin/images/wpspin_light-2x.gif");background-size:contain}.wrap.fs-section h2{text-align:left}
1
  .theme-browser .theme .fs-premium-theme-badge{position:absolute;top:10px;right:0;background:#71ae00;color:#fff;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);font-size:1.1em}#iframe{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
2
+ .fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("/wp-admin/images/wpspin_light-2x.gif");background-size:contain}.wrap.fs-section h2{text-align:left}
vendor/freemius/assets/scss/admin/common.scss CHANGED
@@ -207,7 +207,7 @@ span.fs-submenu-item.fs-sub:before
207
  margin-right: 5px;
208
  vertical-align: sub;
209
  display: inline-block;
210
- background: url('../../../../../../../wp-admin/images/wpspin_light-2x.gif');
211
  background-size: contain;
212
  }
213
 
207
  margin-right: 5px;
208
  vertical-align: sub;
209
  display: inline-block;
210
+ background: url('/wp-admin/images/wpspin_light-2x.gif');
211
  background-size: contain;
212
  }
213
 
vendor/freemius/includes/class-freemius.php CHANGED
@@ -1348,7 +1348,10 @@
1348
  add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
1349
  }
1350
 
1351
- if ( $this->is_theme() && self::is_customizer() ) {
 
 
 
1352
  // Register customizer upsell.
1353
  add_action( 'customize_register', array( &$this, '_customizer_register' ) );
1354
  }
@@ -6192,19 +6195,21 @@
6192
  }
6193
 
6194
  if ( $this->is_plugin_new_install() || $this->is_only_premium() ) {
6195
- // Show notice for new plugin installations.
6196
- $this->_admin_notices->add(
6197
- sprintf(
6198
- $this->get_text_inline( 'You are just one step away - %s', 'you-are-step-away' ),
6199
- sprintf( '<b><a href="%s">%s</a></b>',
6200
- $this->get_activation_url( array(), ! $this->is_delegated_connection() ),
6201
- sprintf( $this->get_text_x_inline( 'Complete "%s" Activation Now',
6202
- '%s - plugin name. As complete "PluginX" activation now', 'activate-x-now' ), $this->get_plugin_name() )
6203
- )
6204
- ),
6205
- '',
6206
- 'update-nag'
6207
- );
 
 
6208
  } else {
6209
  if ( $this->should_add_sticky_optin_notice() ) {
6210
  $this->add_sticky_optin_admin_notice();
@@ -14878,7 +14883,7 @@
14878
 
14879
  // Add upgrade/pricing page.
14880
  $this->add_submenu_item(
14881
- $pricing_cta_text . '&nbsp;&nbsp;' . ( is_rtl() ? '&#x2190;' : '&#x27a4;' ),
14882
  array( &$this, '_pricing_page_render' ),
14883
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
14884
  'manage_options',
@@ -15585,7 +15590,8 @@
15585
  return;
15586
  }
15587
 
15588
- $encrypted_site = clone ( is_object( $site ) ? $site : $this->_site );
 
15589
 
15590
  $sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id );
15591
 
@@ -17587,19 +17593,21 @@
17587
 
17588
  $api = $this->get_api_site_or_plugin_scope();
17589
 
 
 
17590
  /**
17591
  * @since 1.2.1
17592
  *
17593
  * If there's a cached version of the add-ons and not asking
17594
  * for a flush, just use the currently stored add-ons.
17595
  */
17596
- if ( ! $flush && $api->is_cached( '/addons.json?enriched=true' ) ) {
17597
  $addons = self::get_all_addons();
17598
 
17599
  return $addons[ $this->_plugin->id ];
17600
  }
17601
 
17602
- $result = $api->get( '/addons.json?enriched=true', $flush );
17603
 
17604
  $addons = array();
17605
  if ( $this->is_api_result_object( $result, 'plugins' ) &&
@@ -18415,9 +18423,9 @@
18415
  $vars = array( 'id' => $this->_module_id );
18416
 
18417
  if ( 'true' === fs_request_get( 'checkout', false ) ) {
18418
- fs_require_once_template( 'checkout.php', $vars );
18419
  } else {
18420
- fs_require_once_template( 'pricing.php', $vars );
18421
  }
18422
  }
18423
 
@@ -18435,7 +18443,15 @@
18435
  $this->_logger->entrance();
18436
 
18437
  $vars = array( 'id' => $this->_module_id );
18438
- fs_require_once_template( 'contact.php', $vars );
 
 
 
 
 
 
 
 
18439
  }
18440
 
18441
  #endregion ------------------------------------------------------------------------
@@ -18741,14 +18757,14 @@
18741
 
18742
  // Show promotion if never shown before and 24 hours after initial activation with FS.
18743
  if ( ! $was_promotion_shown_before &&
18744
- $this->_storage->install_timestamp > ( time() - WP_FS__TIME_24_HOURS_IN_SEC )
18745
  ) {
18746
  return false;
18747
  }
18748
 
18749
  // OR if promotion was shown before, try showing it every 30 days.
18750
  if ( $was_promotion_shown_before &&
18751
- 30 * WP_FS__TIME_24_HOURS_IN_SEC > time() - $last_time_trial_promotion_shown
18752
  ) {
18753
  return false;
18754
  }
@@ -20150,6 +20166,10 @@
20150
  $icon_found = false;
20151
  $local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.png" );
20152
 
 
 
 
 
20153
  $have_write_permissions = ( 'direct' === get_filesystem_method( array(), fs_normalize_path( $img_dir ) ) );
20154
 
20155
  /**
1348
  add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
1349
  }
1350
 
1351
+ if ( $this->is_theme() &&
1352
+ self::is_customizer() &&
1353
+ $this->apply_filters( 'show_customizer_upsell', true )
1354
+ ) {
1355
  // Register customizer upsell.
1356
  add_action( 'customize_register', array( &$this, '_customizer_register' ) );
1357
  }
6195
  }
6196
 
6197
  if ( $this->is_plugin_new_install() || $this->is_only_premium() ) {
6198
+ if ( ! $this->_anonymous_mode ) {
6199
+ // Show notice for new plugin installations.
6200
+ $this->_admin_notices->add(
6201
+ sprintf(
6202
+ $this->get_text_inline( 'You are just one step away - %s', 'you-are-step-away' ),
6203
+ sprintf( '<b><a href="%s">%s</a></b>',
6204
+ $this->get_activation_url( array(), ! $this->is_delegated_connection() ),
6205
+ sprintf( $this->get_text_x_inline( 'Complete "%s" Activation Now',
6206
+ '%s - plugin name. As complete "PluginX" activation now', 'activate-x-now' ), $this->get_plugin_name() )
6207
+ )
6208
+ ),
6209
+ '',
6210
+ 'update-nag'
6211
+ );
6212
+ }
6213
  } else {
6214
  if ( $this->should_add_sticky_optin_notice() ) {
6215
  $this->add_sticky_optin_admin_notice();
14883
 
14884
  // Add upgrade/pricing page.
14885
  $this->add_submenu_item(
14886
+ $pricing_cta_text . '&nbsp;&nbsp;' . ( is_rtl() ? $this->get_text_x_inline( '&#x2190;', 'ASCII arrow left icon', 'symbol_arrow-left' ) : $this->get_text_x_inline( '&#x27a4;', 'ASCII arrow right icon', 'symbol_arrow-right' ) ),
14887
  array( &$this, '_pricing_page_render' ),
14888
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
14889
  'manage_options',
15590
  return;
15591
  }
15592
 
15593
+ $site_clone = is_object( $site ) ? $site : $this->_site;
15594
+ $encrypted_site = clone $site_clone;
15595
 
15596
  $sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id );
15597
 
17593
 
17594
  $api = $this->get_api_site_or_plugin_scope();
17595
 
17596
+ $path = $this->add_show_pending( '/addons.json?enriched=true' );
17597
+
17598
  /**
17599
  * @since 1.2.1
17600
  *
17601
  * If there's a cached version of the add-ons and not asking
17602
  * for a flush, just use the currently stored add-ons.
17603
  */
17604
+ if ( ! $flush && $api->is_cached( $path ) ) {
17605
  $addons = self::get_all_addons();
17606
 
17607
  return $addons[ $this->_plugin->id ];
17608
  }
17609
 
17610
+ $result = $api->get( $path, $flush );
17611
 
17612
  $addons = array();
17613
  if ( $this->is_api_result_object( $result, 'plugins' ) &&
18423
  $vars = array( 'id' => $this->_module_id );
18424
 
18425
  if ( 'true' === fs_request_get( 'checkout', false ) ) {
18426
+ echo $this->apply_filters( 'templates/checkout.php', fs_get_template( 'checkout.php', $vars ) );
18427
  } else {
18428
+ echo $this->apply_filters( 'templates/pricing.php', fs_get_template( 'pricing.php', $vars ) );
18429
  }
18430
  }
18431
 
18443
  $this->_logger->entrance();
18444
 
18445
  $vars = array( 'id' => $this->_module_id );
18446
+
18447
+ /**
18448
+ * Added filter to the template to allow developers wrapping the template
18449
+ * in custom HTML (e.g. within a wizard/tabs).
18450
+ *
18451
+ * @author Vova Feldman (@svovaf)
18452
+ * @since 2.1.3
18453
+ */
18454
+ echo $this->apply_filters( 'templates/contact.php', fs_get_template( 'contact.php', $vars ) );
18455
  }
18456
 
18457
  #endregion ------------------------------------------------------------------------
18757
 
18758
  // Show promotion if never shown before and 24 hours after initial activation with FS.
18759
  if ( ! $was_promotion_shown_before &&
18760
+ $this->_storage->install_timestamp > ( time() - $this->apply_filters( 'show_first_trial_after_n_sec', WP_FS__TIME_24_HOURS_IN_SEC ) )
18761
  ) {
18762
  return false;
18763
  }
18764
 
18765
  // OR if promotion was shown before, try showing it every 30 days.
18766
  if ( $was_promotion_shown_before &&
18767
+ $this->apply_filters( 'reshow_trial_after_every_n_sec', 30 * WP_FS__TIME_24_HOURS_IN_SEC ) > time() - $last_time_trial_promotion_shown
18768
  ) {
18769
  return false;
18770
  }
20166
  $icon_found = false;
20167
  $local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.png" );
20168
 
20169
+ if ( ! function_exists( 'get_filesystem_method' ) ) {
20170
+ require_once ABSPATH . 'wp-admin/includes/file.php';
20171
+ }
20172
+
20173
  $have_write_permissions = ( 'direct' === get_filesystem_method( array(), fs_normalize_path( $img_dir ) ) );
20174
 
20175
  /**
vendor/freemius/start.php CHANGED
@@ -15,7 +15,7 @@
15
  *
16
  * @var string
17
  */
18
- $this_sdk_version = '2.1.1';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
15
  *
16
  * @var string
17
  */
18
+ $this_sdk_version = '2.1.2';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
vendor/freemius/templates/checkout.php CHANGED
@@ -121,7 +121,7 @@
121
 
122
  $fs_user = Freemius::_get_user_by_email( $current_user->user_email );
123
 
124
- if ( is_object( $fs_user ) ) {
125
  $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
126
  $fs_user,
127
  $timestamp,
121
 
122
  $fs_user = Freemius::_get_user_by_email( $current_user->user_email );
123
 
124
+ if ( is_object( $fs_user ) && $fs_user->is_verified() ) {
125
  $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
126
  $fs_user,
127
  $timestamp,
vendor/freemius/templates/connect.php CHANGED
@@ -253,6 +253,17 @@
253
  <a class="show-license-resend-modal show-license-resend-modal-<?php echo $fs->get_unique_affix() ?>"
254
  href="#"><?php fs_esc_html_echo_inline( "Can't find your license key?", 'cant-find-license-key', $slug ); ?></a>
255
  </div>
 
 
 
 
 
 
 
 
 
 
 
256
  <?php
257
  $send_updates_text = sprintf(
258
  '%s<span class="action-description"> - %s</span>',
@@ -718,11 +729,14 @@
718
  // Redirect to the "Account" page and sync the license.
719
  window.location.href = resultObj.next_page;
720
  } else {
 
 
721
  // Show error.
722
  $('.fs-content').prepend('<p class="fs-error">' + (resultObj.error.message ? resultObj.error.message : resultObj.error) + '</p>');
723
-
724
- resetLoadingMode();
725
  }
 
 
 
726
  }
727
  });
728
 
253
  <a class="show-license-resend-modal show-license-resend-modal-<?php echo $fs->get_unique_affix() ?>"
254
  href="#"><?php fs_esc_html_echo_inline( "Can't find your license key?", 'cant-find-license-key', $slug ); ?></a>
255
  </div>
256
+
257
+ <?php
258
+ /**
259
+ * Allows developers to include custom HTML after the license input container.
260
+ *
261
+ * @author Vova Feldman
262
+ * @since 2.1.2
263
+ */
264
+ $fs->do_action( 'connect/after_license_input' );
265
+ ?>
266
+
267
  <?php
268
  $send_updates_text = sprintf(
269
  '%s<span class="action-description"> - %s</span>',
729
  // Redirect to the "Account" page and sync the license.
730
  window.location.href = resultObj.next_page;
731
  } else {
732
+ resetLoadingMode();
733
+
734
  // Show error.
735
  $('.fs-content').prepend('<p class="fs-error">' + (resultObj.error.message ? resultObj.error.message : resultObj.error) + '</p>');
 
 
736
  }
737
+ },
738
+ error: function () {
739
+ resetLoadingMode();
740
  }
741
  });
742
 
vendor/freemius/templates/tabs.php CHANGED
@@ -26,7 +26,11 @@
26
  foreach ( $menu_items as $priority => $items ) {
27
  foreach ( $items as $item ) {
28
  if ( ! $item['show_submenu'] ) {
29
- if ( ! $is_free_wp_org_theme || ! $fs->is_submenu_item_visible( $item['menu_slug'], true ) ) {
 
 
 
 
30
  continue;
31
  }
32
  }
26
  foreach ( $menu_items as $priority => $items ) {
27
  foreach ( $items as $item ) {
28
  if ( ! $item['show_submenu'] ) {
29
+ $submenu_name = ('wp-support-forum' === $item['menu_slug']) ?
30
+ 'support' :
31
+ $item['menu_slug'];
32
+
33
+ if ( ! $is_free_wp_org_theme || ! $fs->is_submenu_item_visible( $submenu_name, true ) ) {
34
  continue;
35
  }
36
  }