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

Version Description

Yoast SEO sitemap feature detection

Download this release

Release Info

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

Code changes from version 11.1.0 to 11.1.1

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.1.0
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.1
13
  * Author: Peter Raschendorfer
14
  * Author URI: https://petersplugins.com
15
  * Text Domain: 404page
inc/class-404page-admin.php CHANGED
@@ -178,17 +178,19 @@ if ( !class_exists( 'PP_404Page_Admin' ) ) {
178
  echo '<div id="404page_current_value" style="display: none">' . $this->settings()->get( 'page_id' ) . '</div>';
179
  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>';
180
 
181
- if ( defined( 'WPSEO_VERSION' ) ) {
 
 
182
 
183
  echo '<p class="pp-404page-info">';
184
 
185
  if ( $this->settings()->get( 'fire_error' ) ) {
186
 
187
- echo esc_html__( 'Yoast SEO Plugin detected. Your 404 page is automatically excluded from the XML sitemap created by Yoast (if you have actiavted this feature).', '404page' );
188
 
189
  } else {
190
 
191
- echo esc_html__( 'Yoast SEO Plugin detected. Your 404 page is NOT automatically excluded from the XML sitemap created by Yoast, because you disabled the option "Send an 404 error if the page is accessed directly by its URL" on the "Advanced" tab.', '404page' );
192
 
193
  }
194
 
178
  echo '<div id="404page_current_value" style="display: none">' . $this->settings()->get( 'page_id' ) . '</div>';
179
  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>';
180
 
181
+ if ( defined( 'WPSEO_VERSION' ) && method_exists( 'WPSEO_Options', 'get' ) && WPSEO_Options::get( 'enable_xml_sitemap' ) ) {
182
+
183
+ // as of version 11.1.1 we not only check inf Yoast SEO is active but also if Yoast SEO sitemap feature is activated
184
 
185
  echo '<p class="pp-404page-info">';
186
 
187
  if ( $this->settings()->get( 'fire_error' ) ) {
188
 
189
+ echo esc_html__( 'Yoast SEO sitemap detected. Your 404 page is automatically excluded from the XML sitemap created by Yoast.', '404page' );
190
 
191
  } else {
192
 
193
+ echo esc_html__( 'Yoast SEO sitemap detected. Your 404 page is NOT automatically excluded from the XML sitemap created by Yoast, because you disabled the option "Send an 404 error if the page is accessed directly by its URL" on the "Advanced" tab.', '404page' );
194
 
195
  }
196
 
inc/class-404page.php CHANGED
@@ -152,6 +152,7 @@ if ( !class_exists( 'PP_404Page' ) ) {
152
  // @since 6
153
  if ( $this->settings()->get( 'fire_error' ) ) {
154
 
 
155
  add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', function ( $alreadyExcluded ) {
156
  // as of 11.0.5 we add the page ID to the array of already excluded pages
157
  // plus we exclude the 404 page in all languages
152
  // @since 6
153
  if ( $this->settings()->get( 'fire_error' ) ) {
154
 
155
+ // we do not need to check if Yoast Sitemap feature is activated because the filter only fires if it is active
156
  add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', function ( $alreadyExcluded ) {
157
  // as of 11.0.5 we add the page ID to the array of already excluded pages
158
  // plus we exclude the 404 page in all languages
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.1.0'
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.1'
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.1.0
7
  Requires PHP: 5.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -171,6 +171,9 @@ Please use the [Support Forum](https://wordpress.org/support/plugin/404page).
171
 
172
  == Changelog ==
173
 
 
 
 
174
  = 11.1.0 (2019-11-10) =
175
  * now uses Plugin Foundation PPF02 for plugin compatibility
176
  * introduces two new functions for developers pp_404_get_page_id() and pp_404_get_all_page_ids()
@@ -326,6 +329,9 @@ Please use the [Support Forum](https://wordpress.org/support/plugin/404page).
326
 
327
  == Upgrade Notice ==
328
 
 
 
 
329
  = 11.1.0 =
330
  Plugin Foundation updated to version PPF02
331
  two new functions for developers
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.1
7
  Requires PHP: 5.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
171
 
172
  == Changelog ==
173
 
174
+ = 11.1.1 (2019-11-16) =
175
+ * from now on it is not only detected if Yoast SEO Plugin is active, but also if the sitemap feature is activated
176
+
177
  = 11.1.0 (2019-11-10) =
178
  * now uses Plugin Foundation PPF02 for plugin compatibility
179
  * introduces two new functions for developers pp_404_get_page_id() and pp_404_get_all_page_ids()
329
 
330
  == Upgrade Notice ==
331
 
332
+ = 11.1.1 =
333
+ Yoast SEO sitemap feature detection
334
+
335
  = 11.1.0 =
336
  Plugin Foundation updated to version PPF02
337
  two new functions for developers