404page – your smart custom 404 error page - Version 10.5

Version Description

some more security improvements

Download this release

Release Info

Developer petersplugins
Plugin Icon 128x128 404page – your smart custom 404 error page
Version 10.5
Comparing to
See all releases

Code changes from version 10.4 to 10.5

404page.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin Name: 404page - your smart custom 404 error page
10
  * Plugin URI: https://petersplugins.com/free-wordpress-plugins/404page/
11
  * Description: Custom 404 the easy way! Set any page as custom 404 error page. No coding needed. Works with (almost) every Theme.
12
- * Version: 10.4
13
  * Author: Peter Raschendorfer
14
  * Author URI: https://petersplugins.com
15
  * Text Domain: 404page
9
  * Plugin Name: 404page - your smart custom 404 error page
10
  * Plugin URI: https://petersplugins.com/free-wordpress-plugins/404page/
11
  * Description: Custom 404 the easy way! Set any page as custom 404 error page. No coding needed. Works with (almost) every Theme.
12
+ * Version: 10.5
13
  * Author: Peter Raschendorfer
14
  * Author URI: https://petersplugins.com
15
  * Text Domain: 404page
inc/admin/404page-admin-page.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="wrap pp-admin-page-wrapper" id="pp-404page-settings">
2
  <h1>
3
- <span><?php echo $this->_core->get_plugin_name(); ?></span>
4
  <nav>
5
  <?php $this->show_nav_icons( array(
6
  array(
@@ -44,11 +44,11 @@
44
 
45
  <form method="POST" action="options.php">
46
 
47
- <h2><?php _e( 'General', '404page' ); ?></h2>
48
  <?php settings_fields( '404page_settings' ); ?>
49
  <?php do_settings_sections( '404page_settings_section' ); ?>
50
  <div id="pp-settings-advanced">
51
- <h2><?php _e( 'Advanced', '404page' ); ?></h2>
52
  <?php do_settings_sections( '404page_settings_section_advanced' ); ?>
53
  </div>
54
  <?php submit_button(); ?>
@@ -61,7 +61,7 @@
61
  <div class="postbox">
62
  <div class="inside">
63
  <div id="pp-404page-videos">
64
- <h2><?php _e( 'Watch the Explainer Videos', '404page' ); ?></h2>
65
  <?php $this->show_videos(); ?>
66
  </div>
67
  </div>
1
  <div class="wrap pp-admin-page-wrapper" id="pp-404page-settings">
2
  <h1>
3
+ <span><?php echo esc_html( $this->_core->get_plugin_name() ); ?></span>
4
  <nav>
5
  <?php $this->show_nav_icons( array(
6
  array(
44
 
45
  <form method="POST" action="options.php">
46
 
47
+ <h2><?php esc_html_e( 'General', '404page' ); ?></h2>
48
  <?php settings_fields( '404page_settings' ); ?>
49
  <?php do_settings_sections( '404page_settings_section' ); ?>
50
  <div id="pp-settings-advanced">
51
+ <h2><?php esc_html_e( 'Advanced', '404page' ); ?></h2>
52
  <?php do_settings_sections( '404page_settings_section_advanced' ); ?>
53
  </div>
54
  <?php submit_button(); ?>
61
  <div class="postbox">
62
  <div class="inside">
63
  <div id="pp-404page-videos">
64
+ <h2><?php esc_html_e( 'Watch the Explainer Videos', '404page' ); ?></h2>
65
  <?php $this->show_videos(); ?>
66
  </div>
67
  </div>
inc/class-404page-admin.php CHANGED
@@ -101,7 +101,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
101
  register_setting( '404page_settings', '404page_force_error' );
102
  register_setting( '404page_settings', '404page_no_url_guessing' );
103
  register_setting( '404page_settings', '404page_http410_if_trashed' );
104
- add_settings_field( '404page_settings_404page', __( 'Page to be displayed as 404 page', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_select_page"></a>' , array( $this, 'admin_404page' ), '404page_settings_section', '404page-settings', array( 'label_for' => '404page_page_id' ) );
105
  add_settings_field( '404page_settings_hide', '' , array( $this, 'admin_hide' ), '404page_settings_section_advanced', '404page-settings', array( 'label_for' => '404page_hide' ) );
106
  add_settings_field( '404page_settings_fire', '' , array( $this, 'admin_fire404' ), '404page_settings_section_advanced', '404page-settings', array( 'label_for' => '404page_fire_error' ) );
107
  add_settings_field( '404page_settings_force', '' , array( $this, 'admin_force404' ), '404page_settings_section_advanced', '404page-settings', array( 'label_for' => '404page_force_error' ) );
@@ -135,8 +135,8 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
135
  function admin_hide() {
136
 
137
  echo '<p class="toggle"><input type="checkbox" id="404page_hide" name="404page_hide" value="1"' . checked( true, $this->_settings->get_hide(), false ) . '/>';
138
- echo '<label for="404page_hide" class="check"></label>' . __( 'Hide the selected page from the Pages list', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_hide_page"></a><br />';
139
- echo '<span class="dashicons dashicons-info"></span>&nbsp;' . __( 'For Administrators the page is always visible.', '404page' ) . '</p><div class="clear"></div>';
140
 
141
  }
142
 
@@ -148,12 +148,12 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
148
  function admin_fire404() {
149
 
150
  echo '<p class="toggle"><input type="checkbox" id="404page_fire_error" name="404page_fire_error" value="1"' . checked( true, $this->_settings->get_fire_error(), false ) . '/>';
151
- echo '<label for="404page_fire_error" class="check"></label>' . __( 'Send an 404 error if the page is accessed directly by its URL', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_fire_404"></a><br />';
152
- echo '<span class="dashicons dashicons-info"></span>&nbsp;' . __( 'Uncheck this if you want the selected page to be accessible.', '404page' );
153
 
154
  if ( function_exists( 'wpsupercache_activate' ) ) {
155
 
156
- echo '<br /><span class="dashicons dashicons-warning"></span>&nbsp;<strong>' . __( 'WP Super Cache Plugin detected', '404page' ) . '</strong>. ' . __ ( 'If the page you selected as 404 error page is in cache, always a HTTP code 200 is sent. To avoid this and send a HTTP code 404 you have to exlcude this page from caching', '404page' ) . ' (<a href="' . admin_url( 'options-general.php?page=wpsupercache&tab=settings#rejecturi' ) . '">' . __( 'Click here', '404page' ) . '</a>).<br />(<a href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#wp_super_cache">' . __( 'Read more', '404page' ) . '</a>)';
157
 
158
  }
159
 
@@ -169,8 +169,8 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
169
  function admin_force404() {
170
 
171
  echo '<p class="toggle"><input type="checkbox" id="404page_force_error" name="404page_force_error" value="1"' . checked( true, $this->_settings->get_force_error(), false ) . '/>';
172
- echo '<label for="404page_force_error" class="check warning"></label>' . __( 'Force 404 error after loading page', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_force_404"></a>&nbsp;<a class="dashicons dashicons-video-alt3" href="https://youtu.be/09OOCbFLfnI" data-lity></a><br />';
173
- echo '<span class="dashicons dashicons-warning"></span>&nbsp;' . __( 'Generally this is not needed. It is not recommended to activate this option, unless it is necessary. Please note that this may cause problems with your theme.', '404page' ) . '</p><div class="clear"></div>';
174
 
175
  }
176
 
@@ -182,8 +182,8 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
182
  function admin_noguess() {
183
 
184
  echo '<p class="toggle"><input type="checkbox" id="404page_no_url_guessing" name="404page_no_url_guessing" value="1"' . checked( true, $this->_settings->get_no_url_guessing(), false ) . '/>';
185
- echo '<label for="404page_no_url_guessing" class="check warning"></label>' . __( 'Disable URL autocorrection guessing', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_stop_guessing"></a>&nbsp;<a class="dashicons dashicons-video-alt3" href="https://youtu.be/H0EdtFcAGl4" data-lity></a><br />';
186
- echo '<span class="dashicons dashicons-warning"></span>&nbsp;' . __( 'This stops WordPress from URL autocorrection guessing. Only activate, if you are sure about the consequences.', '404page' ) . '</p><div class="clear"></div>';
187
 
188
  }
189
 
@@ -196,8 +196,8 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
196
  function admin_http410() {
197
 
198
  echo '<p class="toggle"><input type="checkbox" id="404page_http410_if_trashed" name="404page_http410_if_trashed" value="1"' . checked( true, $this->_settings->get_http410_if_trashed(), false ) . '/>';
199
- echo '<label for="404page_http410_if_trashed" class="check"></label>' . __( 'Send an HTTP 410 error instead of HTTP 404 in case the requested object is in trash', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_maybe_send_http410"></a>&nbsp;<a class="dashicons dashicons-video-alt3" href="https://youtu.be/O5xPM0BMZxM" data-lity></a><br />';
200
- echo '<span class="dashicons dashicons-info"></span>&nbsp;' . __( 'Check this if you want to inform search engines that the resource requested is no longer available and will not be available again so it can be removed from the search index immediately.', '404page' );
201
 
202
  }
203
 
@@ -218,27 +218,27 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
218
  }
219
 
220
  echo '<p class="toggle"><input type="checkbox" id="404page_method" name="404page_method" value="CMP"' . checked( 'CMP', $this->_settings->get_method(), false ) . $dis . '/>';
221
- echo '<label for="404page_method" class="check"></label>' . __( 'Activate Compatibility Mode', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_operating_method"></a>&nbsp;<a class="dashicons dashicons-video-alt3" href="https://youtu.be/wqSepDyQeqY" data-lity></a><br />';
222
  echo '<span class="dashicons dashicons-info"></span>&nbsp;';
223
 
224
  if ( $this->_settings->get_native() ) {
225
 
226
- _e( 'This setting is not available because the Theme you are using natively supports the 404page plugin.', '404page' );
227
- echo ' (<a href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#native_mode">' . __( 'Read more', '404page' ) . '</a>)';
228
 
229
  } elseif ( defined( 'CUSTOMIZR_VER' ) ) {
230
 
231
- _e( 'This setting is not availbe because the 404page Plugin works in Customizr Compatibility Mode.', '404page' );
232
- echo ' (<a href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#special_modes">' . __( 'Read more', '404page' ) . '</a>)';
233
 
234
  } elseif ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
235
 
236
- _e( 'This setting is not availbe because the 404page Plugin works in WPML Mode.', '404page' );
237
- echo ' (<a href="https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#special_modes">' . __( 'Read more', '404page' ) . '</a>)';
238
 
239
  } else {
240
 
241
- _e( 'If you are using a theme or plugin that modifies the WordPress Template System, the 404page plugin may not work properly. Compatibility Mode maybe can fix the problem. Activate Compatibility Mode only if you have any problems.', '404page' );
242
 
243
  }
244
 
@@ -252,7 +252,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
252
  * moved to PP_404Page_Admin in v 10
253
  */
254
  function admin_menu() {
255
- $this->admin_handle = add_theme_page ( __( '404 Error Page', "404page" ), __( '404 Error Page', '404page' ), 'manage_options', '404pagesettings', array( $this, 'show_admin' ) );
256
  }
257
 
258
 
@@ -287,15 +287,15 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
287
 
288
  if ( $this->_core->get_id() < 0 ) {
289
 
290
- echo '<div class="error form-invalid" style="line-height: 3em">' . __( 'The page you have selected as 404 page does not exist anymore. Please choose another page.', '404page' ) . '</div>';
291
  }
292
 
293
- wp_dropdown_pages( array( 'name' => '404page_page_id', 'id' => 'select404page', 'echo' => 1, 'show_option_none' => __( '&mdash; NONE (WP default 404 page) &mdash;', '404page'), 'option_none_value' => '0', 'selected' => $this->_core->get_id() ) );
294
 
295
  echo '<div id="404page_edit_link" style="display: none">' . get_edit_post_link( $this->_core->get_id() ) . '</div>';
296
  echo '<div id="404page_test_link" style="display: none">' . get_site_url() . '/404page-test-' . md5( rand() ) . '</div>';
297
  echo '<div id="404page_current_value" style="display: none">' . $this->_core->get_id() . '</div>';
298
- echo '<p class="submit"><input type="button" name="edit_404_page" id="edit_404_page" class="button secondary" value="' . __( 'Edit Page', '404page' ) . '" />&nbsp;<input type="button" name="test_404_page" id="test_404_page" class="button secondary" value="' . __( 'Test 404 error', '404page' ) . '" /></p>';
299
 
300
  }
301
 
@@ -346,7 +346,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
346
 
347
  if ( !current_user_can( 'manage_options' ) ) {
348
 
349
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
350
 
351
  }
352
 
@@ -364,7 +364,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
364
 
365
  foreach ( $icons as $icon ) {
366
 
367
- echo '<a href="' . $icon['link'] . '" title="' . $icon['title'] . '"><span class="dashicons ' . $icon['icon'] . '"></span><span class="text">' . $icon['title'] . '</span></a>';
368
 
369
  }
370
 
@@ -387,7 +387,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
387
  * if ( current_user_can( 'manage_options' ) && get_user_meta( get_current_user_id(), 'pp-404page-update-notice-v9', true ) != 'dismissed' ) {
388
  * ?>
389
  * <div class="notice is-dismissible pp-404page-admin-notice" id="pp-404page-update-notice-v9">
390
- * <p><img src="<?php echo $this->_core->get_asset_file( 'img', '/pluginicon.png' ); ?>" style="width: 48px; height: 48px; float: left; margin-right: 20px" /><strong><?php _e( 'What\'s new in Version 9?', '404page' ); ?></strong><br /><?php _e( 'Display a note in Block Editor Gutenberg if the currently edited page is the custom 404 error page.', '404page' ); ?><br />[<a href="https://wordpress.org/plugins/404page/#developers"><?php _e( 'Changelog', '404page' ); ?></a>]<div class="clear"></div></p>
391
  * </div>
392
  * <?php
393
  * }
@@ -398,7 +398,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
398
  if ( current_user_can( 'manage_options' ) && get_user_meta( get_current_user_id(), 'pp-404page-admin-notice-1', true ) != 'dismissed' ) {
399
  ?>
400
  <div class="notice is-dismissible pp-404page-admin-notice" id="pp-404page-admin-notice-1">
401
- <p><img src="<?php echo $this->_core->get_asset_file( 'img', '/pluginicon.png' ); ?>" style="width: 48px; height: 48px; float: left; margin-right: 20px" /><strong><?php _e( 'Do you like the 404page plugin?', '404page' ); ?></strong><br /><?php _e( 'Follow me:', '404page' ); ?> <a class="dashicons dashicons-facebook-alt" href="https://www.facebook.com/petersplugins" title="<?php _e( 'Authors facebook Page', '404page' ); ?>"></a><div class="clear"></div></p>
402
  </div>
403
  <?php
404
  }
@@ -412,7 +412,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
412
  if ( current_user_can( 'manage_options' ) && get_user_meta( get_current_user_id(), 'pp-404page-admin-notice-2', true ) != 'dismissed' ) {
413
  ?>
414
  <div class="notice is-dismissible pp-404page-admin-notice" id="pp-404page-admin-notice-2">
415
- <p><img src="<?php echo $this->_core->get_asset_file( 'img', 'pluginicon.png' ); ?>" style="width: 48px; height: 48px; float: left; margin-right: 20px" /><?php _e( 'If you like the 404page plugin please support my work with giving it a good rating so that other users know it is helpful for you. Thanks.', '404page' ); ?><br /><a href="https://wordpress.org/support/plugin/<?php echo $this->_core->get_plugin_slug(); ?>/reviews/#new-post" title="<?php _e( 'Please rate plugin', '404page' ); ?>"><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></a><div class="clear"></div></p>
416
  </div>
417
  <?php
418
  }
@@ -432,10 +432,10 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
432
 
433
  if ( isset( $_POST['pp_404page_dismiss_admin_notice'] ) ) {
434
 
435
- // since 104 check value
436
  if (strpos( $_POST['pp_404page_dismiss_admin_notice'], 'pp-404page-admin-notice-') === 0 ) {
437
 
438
- update_user_meta( get_current_user_id(), $_POST['pp_404page_dismiss_admin_notice'], 'dismissed' );
439
 
440
  }
441
 
@@ -454,7 +454,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
454
  */
455
  function add_settings_links( $links ) {
456
 
457
- return array_merge( $links, array( '<a href="' . admin_url( 'themes.php?page=404pagesettings' ) . '" title="' . __( 'Settings', '404page' ) . '">' . __( 'Settings', '404page' ) . '</a>', '<a href="https://wordpress.org/support/plugin/' . $this->_core->get_plugin_slug() . '/reviews/" title="' . __( 'Please rate plugin', '404page' ) . '">' . __( 'Please rate plugin', '404page' ) . '</a>' ) );
458
 
459
  }
460
 
@@ -480,7 +480,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
480
 
481
  foreach( $videos as $video ) {
482
 
483
- echo '<a href="https://youtu.be/' . $video['id'] . '" title="' . $video['title'] . '" data-lity><div><img src="' . $this->_core->get_asset_file( 'img/videos', $video['img'] . '.png' ) . '" title="' . $video['title'] . '" alt="' . $video['title'] . '"></div></a>';
484
 
485
  }
486
 
101
  register_setting( '404page_settings', '404page_force_error' );
102
  register_setting( '404page_settings', '404page_no_url_guessing' );
103
  register_setting( '404page_settings', '404page_http410_if_trashed' );
104
+ add_settings_field( '404page_settings_404page', esc_html__( 'Page to be displayed as 404 page', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_select_page' ) . '"></a>' , array( $this, 'admin_404page' ), '404page_settings_section', '404page-settings', array( 'label_for' => '404page_page_id' ) );
105
  add_settings_field( '404page_settings_hide', '' , array( $this, 'admin_hide' ), '404page_settings_section_advanced', '404page-settings', array( 'label_for' => '404page_hide' ) );
106
  add_settings_field( '404page_settings_fire', '' , array( $this, 'admin_fire404' ), '404page_settings_section_advanced', '404page-settings', array( 'label_for' => '404page_fire_error' ) );
107
  add_settings_field( '404page_settings_force', '' , array( $this, 'admin_force404' ), '404page_settings_section_advanced', '404page-settings', array( 'label_for' => '404page_force_error' ) );
135
  function admin_hide() {
136
 
137
  echo '<p class="toggle"><input type="checkbox" id="404page_hide" name="404page_hide" value="1"' . checked( true, $this->_settings->get_hide(), false ) . '/>';
138
+ echo '<label for="404page_hide" class="check"></label>' . esc_html__( 'Hide the selected page from the Pages list', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_hide_page' ) . '"></a><br />';
139
+ echo '<span class="dashicons dashicons-info"></span>&nbsp;' . esc_html__( 'For Administrators the page is always visible.', '404page' ) . '</p><div class="clear"></div>';
140
 
141
  }
142
 
148
  function admin_fire404() {
149
 
150
  echo '<p class="toggle"><input type="checkbox" id="404page_fire_error" name="404page_fire_error" value="1"' . checked( true, $this->_settings->get_fire_error(), false ) . '/>';
151
+ echo '<label for="404page_fire_error" class="check"></label>' . esc_html__( 'Send an 404 error if the page is accessed directly by its URL', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . esc_url ( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_fire_404' ) . '"></a><br />';
152
+ echo '<span class="dashicons dashicons-info"></span>&nbsp;' . esc_html__( 'Uncheck this if you want the selected page to be accessible.', '404page' );
153
 
154
  if ( function_exists( 'wpsupercache_activate' ) ) {
155
 
156
+ echo '<br /><span class="dashicons dashicons-warning"></span>&nbsp;<strong>' . esc_html__( 'WP Super Cache Plugin detected', '404page' ) . '</strong>. ' . __ ( 'If the page you selected as 404 error page is in cache, always a HTTP code 200 is sent. To avoid this and send a HTTP code 404 you have to exlcude this page from caching', '404page' ) . ' (<a href="' . admin_url( 'options-general.php?page=wpsupercache&tab=settings#rejecturi' ) . '">' . esc_html__( 'Click here', '404page' ) . '</a>).<br />(<a href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#wp_super_cache' ) . '">' . esc_html__( 'Read more', '404page' ) . '</a>)';
157
 
158
  }
159
 
169
  function admin_force404() {
170
 
171
  echo '<p class="toggle"><input type="checkbox" id="404page_force_error" name="404page_force_error" value="1"' . checked( true, $this->_settings->get_force_error(), false ) . '/>';
172
+ echo '<label for="404page_force_error" class="check warning"></label>' . esc_html__( 'Force 404 error after loading page', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_force_404' ) .'"></a>&nbsp;<a class="dashicons dashicons-video-alt3" href="https://youtu.be/09OOCbFLfnI" data-lity></a><br />';
173
+ echo '<span class="dashicons dashicons-warning"></span>&nbsp;' . esc_html__( 'Generally this is not needed. It is not recommended to activate this option, unless it is necessary. Please note that this may cause problems with your theme.', '404page' ) . '</p><div class="clear"></div>';
174
 
175
  }
176
 
182
  function admin_noguess() {
183
 
184
  echo '<p class="toggle"><input type="checkbox" id="404page_no_url_guessing" name="404page_no_url_guessing" value="1"' . checked( true, $this->_settings->get_no_url_guessing(), false ) . '/>';
185
+ echo '<label for="404page_no_url_guessing" class="check warning"></label>' . esc_html__( 'Disable URL autocorrection guessing', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_stop_guessing' ) . '"></a>&nbsp;<a class="dashicons dashicons-video-alt3" href="https://youtu.be/H0EdtFcAGl4" data-lity></a><br />';
186
+ echo '<span class="dashicons dashicons-warning"></span>&nbsp;' . esc_html__( 'This stops WordPress from URL autocorrection guessing. Only activate, if you are sure about the consequences.', '404page' ) . '</p><div class="clear"></div>';
187
 
188
  }
189
 
196
  function admin_http410() {
197
 
198
  echo '<p class="toggle"><input type="checkbox" id="404page_http410_if_trashed" name="404page_http410_if_trashed" value="1"' . checked( true, $this->_settings->get_http410_if_trashed(), false ) . '/>';
199
+ echo '<label for="404page_http410_if_trashed" class="check"></label>' . esc_html__( 'Send an HTTP 410 error instead of HTTP 404 in case the requested object is in trash', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_maybe_send_http410' ) .'"></a>&nbsp;<a class="dashicons dashicons-video-alt3" href="https://youtu.be/O5xPM0BMZxM" data-lity></a><br />';
200
+ echo '<span class="dashicons dashicons-info"></span>&nbsp;' . esc_html__( 'Check this if you want to inform search engines that the resource requested is no longer available and will not be available again so it can be removed from the search index immediately.', '404page' );
201
 
202
  }
203
 
218
  }
219
 
220
  echo '<p class="toggle"><input type="checkbox" id="404page_method" name="404page_method" value="CMP"' . checked( 'CMP', $this->_settings->get_method(), false ) . $dis . '/>';
221
+ echo '<label for="404page_method" class="check"></label>' . esc_html__( 'Activate Compatibility Mode', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#settings_operating_method' ) . '"></a>&nbsp;<a class="dashicons dashicons-video-alt3" href="https://youtu.be/wqSepDyQeqY" data-lity></a><br />';
222
  echo '<span class="dashicons dashicons-info"></span>&nbsp;';
223
 
224
  if ( $this->_settings->get_native() ) {
225
 
226
+ esc_html_e( 'This setting is not available because the Theme you are using natively supports the 404page plugin.', '404page' );
227
+ echo ' (<a href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#native_mode' ) . '">' . esc_html__( 'Read more', '404page' ) . '</a>)';
228
 
229
  } elseif ( defined( 'CUSTOMIZR_VER' ) ) {
230
 
231
+ esc_html_e( 'This setting is not availbe because the 404page Plugin works in Customizr Compatibility Mode.', '404page' );
232
+ echo ' (<a href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#special_modes' ) .'">' . esc_html__( 'Read more', '404page' ) . '</a>)';
233
 
234
  } elseif ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
235
 
236
+ esc_html_e( 'This setting is not availbe because the 404page Plugin works in WPML Mode.', '404page' );
237
+ echo ' (<a href="' . esc_url( 'https://petersplugins.com/docs/' . $this->_core->get_plugin_slug() . '/#special_modes' ) . '">' . esc_html__( 'Read more', '404page' ) . '</a>)';
238
 
239
  } else {
240
 
241
+ esc_html_e( 'If you are using a theme or plugin that modifies the WordPress Template System, the 404page plugin may not work properly. Compatibility Mode maybe can fix the problem. Activate Compatibility Mode only if you have any problems.', '404page' );
242
 
243
  }
244
 
252
  * moved to PP_404Page_Admin in v 10
253
  */
254
  function admin_menu() {
255
+ $this->admin_handle = add_theme_page ( esc_html__( '404 Error Page', "404page" ), esc_html__( '404 Error Page', '404page' ), 'manage_options', '404pagesettings', array( $this, 'show_admin' ) );
256
  }
257
 
258
 
287
 
288
  if ( $this->_core->get_id() < 0 ) {
289
 
290
+ echo '<div class="error form-invalid" style="line-height: 3em">' . esc_html__( 'The page you have selected as 404 page does not exist anymore. Please choose another page.', '404page' ) . '</div>';
291
  }
292
 
293
+ wp_dropdown_pages( array( 'name' => '404page_page_id', 'id' => 'select404page', 'echo' => 1, 'show_option_none' => esc_html__( '&mdash; NONE (WP default 404 page) &mdash;', '404page'), 'option_none_value' => '0', 'selected' => $this->_core->get_id() ) );
294
 
295
  echo '<div id="404page_edit_link" style="display: none">' . get_edit_post_link( $this->_core->get_id() ) . '</div>';
296
  echo '<div id="404page_test_link" style="display: none">' . get_site_url() . '/404page-test-' . md5( rand() ) . '</div>';
297
  echo '<div id="404page_current_value" style="display: none">' . $this->_core->get_id() . '</div>';
298
+ echo '<p class="submit"><input type="button" name="edit_404_page" id="edit_404_page" class="button secondary" value="' . esc_html__( 'Edit Page', '404page' ) . '" />&nbsp;<input type="button" name="test_404_page" id="test_404_page" class="button secondary" value="' . esc_html__( 'Test 404 error', '404page' ) . '" /></p>';
299
 
300
  }
301
 
346
 
347
  if ( !current_user_can( 'manage_options' ) ) {
348
 
349
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );
350
 
351
  }
352
 
364
 
365
  foreach ( $icons as $icon ) {
366
 
367
+ echo '<a href="' . esc_url( $icon['link'] ) . '" title="' . $icon['title'] . '"><span class="dashicons ' . $icon['icon'] . '"></span><span class="text">' . $icon['title'] . '</span></a>';
368
 
369
  }
370
 
387
  * if ( current_user_can( 'manage_options' ) && get_user_meta( get_current_user_id(), 'pp-404page-update-notice-v9', true ) != 'dismissed' ) {
388
  * ?>
389
  * <div class="notice is-dismissible pp-404page-admin-notice" id="pp-404page-update-notice-v9">
390
+ * <p><img src="<?php echo $this->_core->get_asset_file( 'img', '/pluginicon.png' ); ?>" style="width: 48px; height: 48px; float: left; margin-right: 20px" /><strong><?php esc_html_e( 'What\'s new in Version 9?', '404page' ); ?></strong><br /><?php esc_html_e( 'Display a note in Block Editor Gutenberg if the currently edited page is the custom 404 error page.', '404page' ); ?><br />[<a href="https://wordpress.org/plugins/404page/#developers"><?php esc_html_e( 'Changelog', '404page' ); ?></a>]<div class="clear"></div></p>
391
  * </div>
392
  * <?php
393
  * }
398
  if ( current_user_can( 'manage_options' ) && get_user_meta( get_current_user_id(), 'pp-404page-admin-notice-1', true ) != 'dismissed' ) {
399
  ?>
400
  <div class="notice is-dismissible pp-404page-admin-notice" id="pp-404page-admin-notice-1">
401
+ <p><img src="<?php echo $this->_core->get_asset_file( 'img', '/pluginicon.png' ); ?>" style="width: 48px; height: 48px; float: left; margin-right: 20px" /><strong><?php esc_html_e( 'Do you like the 404page plugin?', '404page' ); ?></strong><br /><?php esc_html_e( 'Follow me:', '404page' ); ?> <a class="dashicons dashicons-facebook-alt" href="https://www.facebook.com/petersplugins" title="<?php esc_html_e( 'Authors facebook Page', '404page' ); ?>"></a><div class="clear"></div></p>
402
  </div>
403
  <?php
404
  }
412
  if ( current_user_can( 'manage_options' ) && get_user_meta( get_current_user_id(), 'pp-404page-admin-notice-2', true ) != 'dismissed' ) {
413
  ?>
414
  <div class="notice is-dismissible pp-404page-admin-notice" id="pp-404page-admin-notice-2">
415
+ <p><img src="<?php echo $this->_core->get_asset_file( 'img', 'pluginicon.png' ); ?>" style="width: 48px; height: 48px; float: left; margin-right: 20px" /><?php esc_html_e( 'If you like the 404page plugin please support my work with giving it a good rating so that other users know it is helpful for you. Thanks.', '404page' ); ?><br /><a href="<?php echo esc_url( 'https://wordpress.org/support/plugin/' . $this->_core->get_plugin_slug() . '/reviews/#new-post' ); ?>" title="<?php esc_html_e( 'Please rate plugin', '404page' ); ?>"><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></a><div class="clear"></div></p>
416
  </div>
417
  <?php
418
  }
432
 
433
  if ( isset( $_POST['pp_404page_dismiss_admin_notice'] ) ) {
434
 
435
+ // since 10.4 check value
436
  if (strpos( $_POST['pp_404page_dismiss_admin_notice'], 'pp-404page-admin-notice-') === 0 ) {
437
 
438
+ update_user_meta( get_current_user_id(), sanitize_key( $_POST['pp_404page_dismiss_admin_notice'] ), 'dismissed' );
439
 
440
  }
441
 
454
  */
455
  function add_settings_links( $links ) {
456
 
457
+ return array_merge( $links, array( '<a href="' . admin_url( 'themes.php?page=404pagesettings' ) . '" title="' . esc_html__( 'Settings', '404page' ) . '">' . esc_html__( 'Settings', '404page' ) . '</a>', '<a href="' . esc_url( 'https://wordpress.org/support/plugin/' . $this->_core->get_plugin_slug() . '/reviews/' ) . '" title="' . esc_html__( 'Please rate plugin', '404page' ) . '">' . esc_html__( 'Please rate plugin', '404page' ) . '</a>' ) );
458
 
459
  }
460
 
480
 
481
  foreach( $videos as $video ) {
482
 
483
+ echo '<a href="' . esc_url( 'https://youtu.be/' . $video['id'] ) . '" title="' . $video['title'] . '" data-lity><div><img src="' . $this->_core->get_asset_file( 'img/videos', $video['img'] . '.png' ) . '" title="' . $video['title'] . '" alt="' . $video['title'] . '"></div></a>';
484
 
485
  }
486
 
inc/class-404page-block-editor.php CHANGED
@@ -67,7 +67,7 @@ if ( !class_exists( 'PP_404Page_BlockEditor' ) ) {
67
 
68
  ?>
69
  <style type="text/css">
70
- .edit-post-layout__content:before { content: "<?php _e( 'You are currently editing your custom 404 error page', '404page'); ?>"; background-color: #333; color: #FFF; padding: 8px; font-size: 16px; display: block };
71
  </style>
72
  <?php
73
 
67
 
68
  ?>
69
  <style type="text/css">
70
+ .edit-post-layout__content:before { content: "<?php esc_html_e( 'You are currently editing your custom 404 error page', '404page'); ?>"; background-color: #333; color: #FFF; padding: 8px; font-size: 16px; display: block };
71
  </style>
72
  <?php
73
 
inc/class-404page-classic-editor.php CHANGED
@@ -73,7 +73,7 @@ if ( !class_exists( 'PP_404Page_ClassicEditor' ) ) {
73
 
74
  ?>
75
  <style type="text/css">
76
- #post-body-content:before { content: "<?php _e( 'You are currently editing your custom 404 error page', '404page'); ?>"; background-color: #333; color: #FFF; padding: 8px; font-size: 16px; display: block; margin-bottom: 10px };
77
  </style>
78
  <?php
79
 
73
 
74
  ?>
75
  <style type="text/css">
76
+ #post-body-content:before { content: "<?php esc_html_e( 'You are currently editing your custom 404 error page', '404page'); ?>"; background-color: #333; color: #FFF; padding: 8px; font-size: 16px; display: block; margin-bottom: 10px };
77
  </style>
78
  <?php
79
 
inc/class-404page.php CHANGED
@@ -1179,7 +1179,7 @@ if ( !class_exists( 'PP_404Page' ) ) {
1179
  // print title - native theme support
1180
  function pp_404_the_title() {
1181
 
1182
- echo $this->pp_404_get_the_title();
1183
 
1184
  }
1185
 
@@ -1201,7 +1201,7 @@ if ( !class_exists( 'PP_404Page' ) ) {
1201
  // print content - native theme support
1202
  function pp_404_the_content() {
1203
 
1204
- echo $this->pp_404_get_the_content();
1205
 
1206
  }
1207
 
1179
  // print title - native theme support
1180
  function pp_404_the_title() {
1181
 
1182
+ echo esc_html( $this->pp_404_get_the_title() );
1183
 
1184
  }
1185
 
1201
  // print content - native theme support
1202
  function pp_404_the_content() {
1203
 
1204
+ echo esc_html( $this->pp_404_get_the_content() );
1205
 
1206
  }
1207
 
loader.php CHANGED
@@ -40,7 +40,7 @@ function pp_404page() {
40
  'file' => dirname( __FILE__ ) . '/404page.php',
41
  'slug' => pathinfo( dirname( __FILE__ ) . '/404page.php', PATHINFO_FILENAME ),
42
  'name' => '404page - your smart custom 404 error page',
43
- 'version' => '10.4'
44
  ) );
45
 
46
  }
40
  'file' => dirname( __FILE__ ) . '/404page.php',
41
  'slug' => pathinfo( dirname( __FILE__ ) . '/404page.php', PATHINFO_FILENAME ),
42
  'name' => '404page - your smart custom 404 error page',
43
+ 'version' => '10.5'
44
  ) );
45
 
46
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === 404page - your smart custom 404 error page ===
2
  Contributors: petersplugins
3
- Tags: page, 404, error, error page, 404 page, page not found, page not found error, 404 error page, missing, broken link, template, 404 link, seo, custom 404, custom 404 page, custom 404 error, custom 404 error page, customize 404, customize 404 page, customize 404 error page
4
  Requires at least: 4.0
5
- Tested up to: 5.1
6
- Stable tag: 10.4
7
  Requires PHP: 5.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -18,8 +18,6 @@ Bringing visitors to your website takes time and effort. Every visitor is import
18
 
19
  This handy plugin allows you to easily create your own 404 error page without any effort and it works with almost every theme.
20
 
21
- <strong>If you like this plugin</strong> please do me favor and leave a review here on wordpress.org so that other people know it is helpful for you. Thanks!
22
-
23
  == Usage ==
24
 
25
  Create your custom 404 error page just like any other page using the WordPress Page Editor. Then go to 'Appearance' -> '404 Error Page' and select the created page as your custom 404 error page. That's it!
@@ -54,14 +52,6 @@ The only requirement for this plugin is that you change the Permalink Structure
54
 
55
  ["Compatibility Mode" explained](https://youtu.be/wqSepDyQeqY)
56
 
57
- == Plugin Privacy Information ==
58
-
59
- * This plugin does not set cookies
60
- * This plugin does not collect or store any data
61
- * This plugin does not send any data to external servers
62
-
63
- [Peters' Plugins Privacy Information Page](https://petersplugins.com/plugin-privacy-information/)
64
-
65
  == Compatibility ==
66
 
67
  = The 404page plugin was sucessfully tested by the author with the following themes =
@@ -113,7 +103,23 @@ The plugin adds an action hook 404page_after_404 which you can use to add extra
113
  = Native Support =
114
  If you are a theme developer you can add native support for the 404page plugin to your theme for full control. [Read more](http://petersplugins.com/docs/404page/#theme_native_support).
115
 
116
- = More plugins from Peter =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
 
118
  * **[hashtagger](https://wordpress.org/plugins/hashtagger/)** - Use hashtags in WordPress
119
  * **[smart Archive Page Remove](https://wordpress.org/plugins/smart-archive-page-remove/)** - Completely remove unwated Archive Pages from your Blog
@@ -152,8 +158,11 @@ Please use the [Support Forum](https://wordpress.org/support/plugin/404page).
152
 
153
  == Changelog ==
154
 
 
 
 
155
  = 10.4 (2019-03-31) =
156
- * security vulnerability in AJAX call fixed
157
 
158
  = 10.3 (2019-02-21) =
159
  * fix for compatibility with iThemes Sync ([ticket](https://wordpress.org/support/topic/ithemes-sync-issue/))
@@ -281,6 +290,9 @@ Please use the [Support Forum](https://wordpress.org/support/plugin/404page).
281
 
282
  == Upgrade Notice ==
283
 
 
 
 
284
  = 10.4 =
285
  security vulnerability in AJAX call fixed
286
 
1
  === 404page - your smart custom 404 error page ===
2
  Contributors: petersplugins
3
+ Tags: page, 404, error, error page, 404 page, page not found, page not found error, 404 error page, missing, broken link, template, 404 link, seo, custom 404, custom 404 page, custom 404 error, custom 404 error page, customize 404, customize 404 page, customize 404 error page, classicpress
4
  Requires at least: 4.0
5
+ Tested up to: 5.2
6
+ Stable tag: 10.5
7
  Requires PHP: 5.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
18
 
19
  This handy plugin allows you to easily create your own 404 error page without any effort and it works with almost every theme.
20
 
 
 
21
  == Usage ==
22
 
23
  Create your custom 404 error page just like any other page using the WordPress Page Editor. Then go to 'Appearance' -> '404 Error Page' and select the created page as your custom 404 error page. That's it!
52
 
53
  ["Compatibility Mode" explained](https://youtu.be/wqSepDyQeqY)
54
 
 
 
 
 
 
 
 
 
55
  == Compatibility ==
56
 
57
  = The 404page plugin was sucessfully tested by the author with the following themes =
103
  = Native Support =
104
  If you are a theme developer you can add native support for the 404page plugin to your theme for full control. [Read more](http://petersplugins.com/docs/404page/#theme_native_support).
105
 
106
+ == Do you like this plugin? ==
107
+
108
+ I spend a lot of my precious spare time to develop and maintain my free WordPress plugins. You don’t need to make a donation. No money, no beer, no coffee. If you like this plugin then please do me a favor and [give it a good rating](https://wordpress.org/support/plugin/404page/reviews/). Thanks.
109
+
110
+ == Plugin Privacy Information ==
111
+
112
+ * This plugin does not set cookies
113
+ * This plugin does not collect or store any data
114
+ * This plugin does not send any data to external servers
115
+
116
+ [Peters' Plugins Privacy Information Page](https://petersplugins.com/plugin-privacy-information/)
117
+
118
+ == ClassicPress ==
119
+
120
+ This plugin is compatible with [ClassicPress](https://www.classicpress.net/).
121
+
122
+ == More plugins from Peter ==
123
 
124
  * **[hashtagger](https://wordpress.org/plugins/hashtagger/)** - Use hashtags in WordPress
125
  * **[smart Archive Page Remove](https://wordpress.org/plugins/smart-archive-page-remove/)** - Completely remove unwated Archive Pages from your Blog
158
 
159
  == Changelog ==
160
 
161
+ = 10.5 (2019-04-01) =
162
+ * some more security improvements
163
+
164
  = 10.4 (2019-03-31) =
165
+ * security vulnerability in AJAX call fixed (thanks to [Julio Potier](https://secupress.me/) for pointing me to this)
166
 
167
  = 10.3 (2019-02-21) =
168
  * fix for compatibility with iThemes Sync ([ticket](https://wordpress.org/support/topic/ithemes-sync-issue/))
290
 
291
  == Upgrade Notice ==
292
 
293
+ = 10.5 =
294
+ some more security improvements
295
+
296
  = 10.4 =
297
  security vulnerability in AJAX call fixed
298