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

Version Description

urgent bug fix for PPF03

Download this release

Release Info

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

Code changes from version 11.2.1 to 11.1.4

404page.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin Name: 404page - your smart custom 404 error page
10
  * Plugin URI: https://petersplugins.com/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: 11.2.1
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/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: 11.1.4
13
  * Author: Peter Raschendorfer
14
  * Author URI: https://petersplugins.com
15
  * Text Domain: 404page
inc/class-404page-admin.php CHANGED
@@ -194,7 +194,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
194
 
195
  }
196
 
197
- echo '</p><br />';
198
 
199
  }
200
 
@@ -214,45 +214,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
214
 
215
  }
216
 
217
- echo '</p><br />';
218
-
219
- }
220
-
221
-
222
- // WP Super Cache
223
- // since 11.2.0
224
- if ( defined('WPCACHEHOME') ) {
225
-
226
- global $cache_enabled;
227
-
228
- // is caching active?
229
- if ( $cache_enabled ) {
230
-
231
- echo '<p class="pp-404page-info">';
232
- echo esc_html__( 'WP Super Cache detected. All 404 errors are automatically excluded from caching.', '404page' );
233
- echo '</p><br />';
234
-
235
- }
236
-
237
- }
238
-
239
-
240
- // W3 Total Cache
241
- // since 11.2.1
242
- if ( defined( 'W3TC' ) ) {
243
-
244
- if ( class_exists( 'W3TC\Dispatcher' ) ) {
245
-
246
- // is caching active?
247
- if ( W3TC\Dispatcher::config()->get_boolean( 'pgcache.enabled' ) ) {
248
-
249
- echo '<p class="pp-404page-info">';
250
- echo esc_html__( 'W3 Total Cache detected. All 404 errors are automatically excluded from caching.', '404page' );
251
- echo '</p><br />';
252
-
253
- }
254
-
255
- }
256
 
257
  }
258
 
@@ -287,7 +249,7 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
287
  esc_html__( 'Send an 404 error if the page is accessed directly by its URL', '404page' ),
288
  'settings_fire_404',
289
  false,
290
- '<span class="dashicons dashicons-info"></span>&nbsp;' . esc_html__( 'Uncheck this if you want the selected page to be accessible.', '404page' )
291
  );
292
 
293
  }
194
 
195
  }
196
 
197
+ echo '</p>';
198
 
199
  }
200
 
214
 
215
  }
216
 
217
+ echo '</p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
 
219
  }
220
 
249
  esc_html__( 'Send an 404 error if the page is accessed directly by its URL', '404page' ),
250
  'settings_fire_404',
251
  false,
252
+ '<span class="dashicons dashicons-info"></span>&nbsp;' . esc_html__( 'Uncheck this if you want the selected page to be accessible.', '404page' ) . ( function_exists( 'wpsupercache_activate' ) ? '<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/' . $this->core()->get_plugin_slug() . '/manual/#wp_super_cache' ) . '">' . esc_html__( 'Read more', '404page' ) . '</a>)' : '' )
253
  );
254
 
255
  }
inc/class-404page.php CHANGED
@@ -287,8 +287,6 @@ if ( !class_exists( 'PP_404Page' ) ) {
287
 
288
  if ( ! $this->is_native() ) {
289
 
290
- $this->disable_caching();
291
-
292
  $wp_query = null;
293
  $wp_query = new WP_Query();
294
  $wp_query->query( 'page_id=' . $this->get_page_id() );
@@ -351,8 +349,6 @@ if ( !class_exists( 'PP_404Page' ) ) {
351
 
352
  remove_action( 'pre_get_posts', array ( $this, 'exclude_404page' ) );
353
  remove_filter( 'get_pages', array ( $this, 'remove_404page_from_array' ), 10, 2 );
354
-
355
- $this->disable_caching();
356
 
357
  $wp_query = null;
358
  $wp_query = new WP_Query();
@@ -360,7 +356,6 @@ if ( !class_exists( 'PP_404Page' ) ) {
360
  // @since 8
361
  // added suppress_filters for compatibilty with current WPML version
362
  $wp_query->query( array( 'page_id' => $pageid, 'suppress_filters' => true ) );
363
-
364
 
365
  $wp_query->the_post();
366
  $this->template = get_page_template();
@@ -371,8 +366,6 @@ if ( !class_exists( 'PP_404Page' ) ) {
371
  add_filter( 'body_class', array( $this, 'add_404_body_class' ) );
372
  add_filter( 'template_include', array( $this, 'change_404_template' ), 999 );
373
 
374
-
375
-
376
  $this->maybe_force_404();
377
  $this->do_404page_action();
378
 
@@ -413,46 +406,6 @@ if ( !class_exists( 'PP_404Page' ) ) {
413
  return $posts;
414
  }
415
 
416
- /**
417
- * disable caching for known caching plugins
418
- *
419
- * @since 11.2.0
420
- */
421
- function disable_caching() {
422
-
423
- // WP Super Cache
424
- if ( defined( 'WPCACHEHOME' ) ) {
425
-
426
- global $cache_enabled;
427
-
428
- // is caching active?
429
- if ( $cache_enabled ) {
430
-
431
- define( 'DONOTCACHEPAGE', true );
432
-
433
- }
434
-
435
- }
436
-
437
-
438
- // W3 Total Cache
439
- if ( defined( 'W3TC' ) ) {
440
-
441
- if ( class_exists( 'W3TC\Dispatcher' ) ) {
442
-
443
- // is caching active?
444
- if ( W3TC\Dispatcher::config()->get_boolean( 'pgcache.enabled' ) ) {
445
-
446
- define( 'DONOTCACHEPAGE', true );
447
-
448
- }
449
-
450
- }
451
-
452
- }
453
-
454
- }
455
-
456
 
457
  /**
458
  * for DW Question & Answer plugin
287
 
288
  if ( ! $this->is_native() ) {
289
 
 
 
290
  $wp_query = null;
291
  $wp_query = new WP_Query();
292
  $wp_query->query( 'page_id=' . $this->get_page_id() );
349
 
350
  remove_action( 'pre_get_posts', array ( $this, 'exclude_404page' ) );
351
  remove_filter( 'get_pages', array ( $this, 'remove_404page_from_array' ), 10, 2 );
 
 
352
 
353
  $wp_query = null;
354
  $wp_query = new WP_Query();
356
  // @since 8
357
  // added suppress_filters for compatibilty with current WPML version
358
  $wp_query->query( array( 'page_id' => $pageid, 'suppress_filters' => true ) );
 
359
 
360
  $wp_query->the_post();
361
  $this->template = get_page_template();
366
  add_filter( 'body_class', array( $this, 'add_404_body_class' ) );
367
  add_filter( 'template_include', array( $this, 'change_404_template' ), 999 );
368
 
 
 
369
  $this->maybe_force_404();
370
  $this->do_404page_action();
371
 
406
  return $posts;
407
  }
408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
 
410
  /**
411
  * for DW Question & Answer plugin
inc/ppf/ppf-plugin-addon.php DELETED
@@ -1,203 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Plugin Addon Base Class
5
- *
6
- * Peter's Plugins Foundation 04
7
- *
8
- * @package PPF04
9
- * @author Peter Raschendorfer
10
- * @license GPL2+
11
- */
12
-
13
-
14
- if ( !class_exists( 'PPF04_Plugin_Addon' ) ) {
15
-
16
- abstract class PPF04_Plugin_Addon extends PPF04_Plugin {
17
-
18
- /**
19
- * Base Plugin Name
20
- *
21
- * @since PPF04
22
- * @var string
23
- * @access private
24
- */
25
- private $base_plugin_name;
26
-
27
-
28
- /**
29
- * Base Plugin Function
30
- *
31
- * @since PPF04
32
- * @var string
33
- * @access private
34
- */
35
- private $base_plugin_function;
36
-
37
-
38
- /**
39
- * Base Plugin Min Required Version
40
- *
41
- * @since PPF04
42
- * @var string
43
- * @access private
44
- */
45
- private $base_plugin_min_version;
46
-
47
-
48
- /**
49
- * Settings Class ( if the plugin uses settings )
50
- *
51
- * @since PPF01
52
- * @var object
53
- * @access private
54
- */
55
- private $settings;
56
-
57
-
58
- /**
59
- * Init the Class
60
- *
61
- * @since PPF04
62
- * same as PPFxx_Plugin plus
63
- * @type string $base_plugin_name Name of Base Plugin
64
- * @type string $base_plugin_function Function to access Base Plugin
65
- * @type string $base_plugin_min_version Minimal required version of Base Plugin
66
- */
67
- public function __construct( $settings ) {
68
-
69
- $this->plugin_file = $settings['file'];
70
- $this->plugin_slug = $settings['slug'];
71
- $this->plugin_name = $settings['name'];
72
- $this->plugin_shortname = $settings['shortname'];
73
- $this->plugin_version = $settings['version'];
74
-
75
- $this->base_plugin_name = $settings['base_plugin_name'];
76
- $this->base_plugin_function = $settings['base_plugin_function'];
77
- $this->base_plugin_min_version = $settings['base_plugin_min_version'];
78
-
79
- $this->_data_key = str_replace( '-', '_', $settings['slug'] ) . '_data';
80
- $this->data_load();
81
-
82
- $this->plugin_file = $settings['file'];
83
-
84
- $this->addon_check();
85
-
86
- }
87
-
88
-
89
- /**
90
- * get Base Plugin Name
91
- *
92
- * @since PPF04
93
- * @access public
94
- * @return string
95
- */
96
- public function get_base_plugin_name() {
97
-
98
- return $this->base_plugin_name;
99
-
100
- }
101
-
102
-
103
- /**
104
- * get Base Plugin Function
105
- *
106
- * @since PPF04
107
- * @access public
108
- * @return string
109
- */
110
- public function get_base_plugin_function() {
111
-
112
- return $this->base_plugin_function;
113
-
114
- }
115
-
116
-
117
- /**
118
- * get Base Plugin minimum required version^
119
- *
120
- * @since PPF04
121
- * @access public
122
- * @return string
123
- */
124
- public function get_base_plugin_min_version() {
125
-
126
- return $this->base_plugin_min_version;
127
-
128
- }
129
-
130
-
131
- /**
132
- * check if base plugin exists and has required minimum version
133
- *
134
- * @since PPF04
135
- * @access private
136
- */
137
- private function addon_check() {
138
-
139
- // we need to place all the stuff in plugins_loaded to ensure the base plugin is loaded
140
-
141
- add_action( 'plugins_loaded', function() {
142
-
143
- $this->plugin_install_update();
144
-
145
- $this->plugin_init();
146
-
147
- $base = $this->get_base_plugin_function();
148
-
149
- if ( ! function_exists( $base ) ) {
150
-
151
- add_action('admin_notices', array( $this, 'admin_notice_base_plugin_not_found' ) );
152
-
153
- } elseif ( version_compare( $this->get_base_plugin_min_version(), $base()->get_plugin_version(), '>' ) ) {
154
-
155
- add_action('admin_notices', array( $this, 'admin_notice_base_plugin_version_insufficient' ) );
156
-
157
- } else {
158
-
159
- $this->addon_init();
160
-
161
- }
162
-
163
- } );
164
-
165
-
166
- }
167
-
168
-
169
- /**
170
- * addon init
171
- *
172
- * force to be defined
173
- *
174
- * @since PPF04
175
- */
176
- abstract public function addon_init();
177
-
178
-
179
- /**
180
- * add admin notice if base plugin not found
181
- *
182
- * force to be defined
183
- *
184
- * @since PPF04
185
- */
186
- abstract public function admin_notice_base_plugin_not_found();
187
-
188
-
189
- /**
190
- * add admin notice if base plugin version insufficient
191
- *
192
- * force to be defined
193
- *
194
- * @since PPF04
195
- */
196
- abstract public function admin_notice_base_plugin_version_insufficient();
197
-
198
-
199
- }
200
-
201
- }
202
-
203
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
loader.php CHANGED
@@ -42,7 +42,7 @@ function pp_404page() {
42
  'slug' => pathinfo( dirname( __FILE__ ) . '/404page.php', PATHINFO_FILENAME ),
43
  'name' => '404page - your smart custom 404 error page',
44
  'shortname' => '404page',
45
- 'version' => '11.2.1'
46
  ) );
47
 
48
  }
42
  'slug' => pathinfo( dirname( __FILE__ ) . '/404page.php', PATHINFO_FILENAME ),
43
  'name' => '404page - your smart custom 404 error page',
44
  'shortname' => '404page',
45
+ 'version' => '11.1.4'
46
  ) );
47
 
48
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.3
6
- Stable tag: 11.2.1
7
  Requires PHP: 5.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -75,7 +75,7 @@ The only requirement for this plugin is that you change the Permalink Structure
75
  * [Twenty Sixteen](https://wordpress.org/themes/twentysixteen/)
76
  * [Twenty Seventeen](https://wordpress.org/themes/twentyseventeen/)
77
  * [Twenty Nineteen](https://wordpress.org/themes/twentynineteen/)
78
- * [Twenty Twenty](https://wordpress.org/themes/twentytwenty/)
79
  * [Vantage](https://wordpress.org/themes/vantage/)
80
  * [Virtue](https://wordpress.org/themes/virtue/)
81
  * [Zerif Lite](http://themeisle.com/themes/zerif-lite/)
@@ -171,12 +171,6 @@ Please use the [Support Forum](https://wordpress.org/support/plugin/404page).
171
 
172
  == Changelog ==
173
 
174
- = 11.2.1 (2020-01-04) =
175
- * if W3 Total Cache is installed and caching is active URLs that result in an 404 error are automatically excluded from caching
176
-
177
- = 11.2.0 (2020-01-01) =
178
- * if WP Super Cache is installed and caching is active URLs that result in an 404 error are automatically excluded from caching
179
-
180
  = 11.1.4 (2019-12-29) =
181
  * urgent bug fix for PPF03
182
 
@@ -344,12 +338,6 @@ Please use the [Support Forum](https://wordpress.org/support/plugin/404page).
344
 
345
  == Upgrade Notice ==
346
 
347
- = 11.2.1 =
348
- if W3 Total Cache is installed and caching is active URLs that result in an 404 error are automatically excluded from caching
349
-
350
- = 11.2.0 =
351
- if WP Super Cache is installed and caching is active URLs that result in an 404 error are automatically excluded from caching
352
-
353
  = 11.1.4 =
354
  urgent bug fix for PPF03
355
 
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.3
6
+ Stable tag: 11.1.4
7
  Requires PHP: 5.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
75
  * [Twenty Sixteen](https://wordpress.org/themes/twentysixteen/)
76
  * [Twenty Seventeen](https://wordpress.org/themes/twentyseventeen/)
77
  * [Twenty Nineteen](https://wordpress.org/themes/twentynineteen/)
78
+ * [Twenty Twenty]
79
  * [Vantage](https://wordpress.org/themes/vantage/)
80
  * [Virtue](https://wordpress.org/themes/virtue/)
81
  * [Zerif Lite](http://themeisle.com/themes/zerif-lite/)
171
 
172
  == Changelog ==
173
 
 
 
 
 
 
 
174
  = 11.1.4 (2019-12-29) =
175
  * urgent bug fix for PPF03
176
 
338
 
339
  == Upgrade Notice ==
340
 
 
 
 
 
 
 
341
  = 11.1.4 =
342
  urgent bug fix for PPF03
343