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

Version Description

bugfix for bbPress

Download this release

Release Info

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

Code changes from version 3.3 to 4

Files changed (3) hide show
  1. 404page.php +1 -1
  2. inc/class-404page.php +35 -1
  3. readme.txt +19 -11
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: 3.3
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: 4
13
  * Author: Peter Raschendorfer
14
  * Author URI: https://petersplugins.com
15
  * Text Domain: 404page
inc/class-404page.php CHANGED
@@ -44,7 +44,7 @@ if ( !class_exists( 'PP_404Page' ) ) {
44
  $this->_file = $file;
45
  $this->plugin_name = '404page';
46
  $this->plugin_slug = '404page';
47
- $this->version = '3.3';
48
  $this->get_settings();
49
  $this->load();
50
  }
@@ -202,6 +202,25 @@ if ( !class_exists( 'PP_404Page' ) ) {
202
  function show404_standard_mode( $template ) {
203
 
204
  global $wp_query;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  if ( ! $this->settings['404page_native'] ) {
206
  $wp_query = null;
207
  $wp_query = new WP_Query();
@@ -216,6 +235,7 @@ if ( !class_exists( 'PP_404Page' ) ) {
216
  return $template;
217
 
218
  }
 
219
 
220
  /**
221
  * show 404 page
@@ -226,6 +246,20 @@ if ( !class_exists( 'PP_404Page' ) ) {
226
  // remove the filter so we handle only the first query - no custom queries
227
  remove_filter( 'the_posts', array( $this, 'show404_compatiblity_mode' ), 999 );
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  $pageid = $this->get_page_id();
230
  if ( ! $this->settings['404page_native'] ) {
231
  if ( empty( $posts ) && is_main_query() && !is_robots() && !is_home() && !is_feed() && !is_search() && !is_archive() && ( !defined('DOING_AJAX') || !DOING_AJAX ) ) {
44
  $this->_file = $file;
45
  $this->plugin_name = '404page';
46
  $this->plugin_slug = '404page';
47
+ $this->version = '4';
48
  $this->get_settings();
49
  $this->load();
50
  }
202
  function show404_standard_mode( $template ) {
203
 
204
  global $wp_query;
205
+
206
+ // @since 4
207
+ // fix for an ugly bbPress problem
208
+ // see https://wordpress.org/support/topic/not-fully-bbpress-compatible/
209
+ // see https://bbpress.trac.wordpress.org/ticket/3161
210
+ // if a bbPress member page is shown and the member has no topics created yet the 404_template filter hook fires
211
+ // this is a bbPress problem but it has not been fixed since 6 months
212
+ // so let's bypass the problem
213
+ if ( function_exists( 'bbp_is_single_user' ) ) {
214
+
215
+ if ( bbp_is_single_user() ) {
216
+
217
+ return $template;
218
+
219
+ }
220
+
221
+ }
222
+ // that's it
223
+
224
  if ( ! $this->settings['404page_native'] ) {
225
  $wp_query = null;
226
  $wp_query = new WP_Query();
235
  return $template;
236
 
237
  }
238
+
239
 
240
  /**
241
  * show 404 page
246
  // remove the filter so we handle only the first query - no custom queries
247
  remove_filter( 'the_posts', array( $this, 'show404_compatiblity_mode' ), 999 );
248
 
249
+ // @since 4
250
+ // fix for an ugly bbPress problem
251
+ // see show404_standard_mode()
252
+ if ( function_exists( 'bbp_is_single_user' ) ) {
253
+
254
+ if ( bbp_is_single_user() ) {
255
+
256
+ return $posts;
257
+
258
+ }
259
+
260
+ }
261
+ // that's it
262
+
263
  $pageid = $this->get_page_id();
264
  if ( ! $this->settings['404page_native'] ) {
265
  if ( empty( $posts ) && is_main_query() && !is_robots() && !is_home() && !is_feed() && !is_search() && !is_archive() && ( !defined('DOING_AJAX') || !DOING_AJAX ) ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://petersplugins.com/make-a-donation/
4
  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
5
  Requires at least: 3.0
6
  Tested up to: 4.9
7
- Stable tag: 3.3
8
  Requires PHP: 5.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -17,25 +17,27 @@ Custom 404 the easy way! Set any page as custom 404 error page. No coding needed
17
 
18
  It allows you to easily create your own 404 error page without any effort and it works with almost every theme.
19
 
20
- <blockquote>
21
- If you like this plugin please do me favor and leave a review here on wordpress.org so that other people know it is helpful for you. Thanks!
22
- </blockquote>
23
 
24
- [youtube https://youtu.be/HygoFMwdIuY]
25
-
26
- = Usage =
27
 
28
  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!
29
 
30
- * Different from other similar plugins the 404page plugin **does not create redirects**. That’s **quite important** because a correct code 404 is delivered which tells search engines that the page does not exist and has to be removed from the index. A redirect would result in a HTTP code 301 or 302 and the URL would remain in the search index.
31
- * Different from other similar plugins the 404page plugin **does not create additional server requests**.
 
 
 
32
 
33
- = Docs & Support =
 
 
34
 
35
  Video: [A quick Overview over the Advanced Settings](https://youtu.be/9rL9LbYiSJk=)
36
 
37
- More detailed information about the 404page plugin can be found in the [Plugin Manual](http://petersplugins.com/docs/404page/). For support check the [Support Forum](https://wordpress.org/support/plugin/404page).
38
 
 
39
 
40
  == Compatibility ==
41
 
@@ -119,6 +121,9 @@ The 404page plugin adds a CSS class `error404` to the `<body>` tag which can be
119
 
120
  == Changelog ==
121
 
 
 
 
122
  = 3.3 (2017-11-16) =
123
  * support for right-to-left-languages added
124
  * faulty display in WP 4.9 fixed
@@ -207,6 +212,9 @@ The 404page plugin adds a CSS class `error404` to the `<body>` tag which can be
207
 
208
  == Upgrade Notice ==
209
 
 
 
 
210
  = 3.3 =
211
  support for right-to-left-languages
212
 
4
  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
5
  Requires at least: 3.0
6
  Tested up to: 4.9
7
+ Stable tag: 4
8
  Requires PHP: 5.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
17
 
18
  It allows you to easily create your own 404 error page without any effort and it works with almost every theme.
19
 
20
+ <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!
 
 
21
 
22
+ == Usage ==
 
 
23
 
24
  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!
25
 
26
+ == Why use this plugin? ==
27
+
28
+ Different from other similar plugins the 404page plugin **does not create redirects**. That’s **quite important** because a correct code 404 is delivered which tells search engines that the page does not exist and has to be removed from the index.
29
+
30
+ Different from other similar plugins the 404page plugin **does not create additional server requests**.
31
 
32
+ == Docs & Support ==
33
+
34
+ Video: [A brief Introduction to the free WordPress Plugin 404page](https://youtu.be/HygoFMwdIuY)
35
 
36
  Video: [A quick Overview over the Advanced Settings](https://youtu.be/9rL9LbYiSJk=)
37
 
38
+ [Plugin Manual](http://petersplugins.com/docs/404page/)
39
 
40
+ [Support Forum](https://wordpress.org/support/plugin/404page)
41
 
42
  == Compatibility ==
43
 
121
 
122
  == Changelog ==
123
 
124
+ = 4 ( 2018-03-05) =
125
+ * bugfix for bbPress ([See Topic](https://wordpress.org/support/topic/not-fully-bbpress-compatible/)
126
+
127
  = 3.3 (2017-11-16) =
128
  * support for right-to-left-languages added
129
  * faulty display in WP 4.9 fixed
212
 
213
  == Upgrade Notice ==
214
 
215
+ = 4 =
216
+ bugfix for bbPress
217
+
218
  = 3.3 =
219
  support for right-to-left-languages
220