Skip to content

Commit

Permalink
* FIX: Fix the specified page doesnt exist message and probably other…
Browse files Browse the repository at this point in the history
… issues as a result of the publish status also being published now for some reason. Thanks to rik0399.
  • Loading branch information
aaron13100 committed Dec 16, 2022
1 parent d36f93b commit 2861f5a
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion 404-solution.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Author: Aaron J
Author URI: https://www.ajexperience.com/404-solution/
Version: 2.31.4
Version: 2.31.5
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog #

## Version 2.31.5 (December 16, 2022) ##
* FIX: Fix the specified page doesnt exist message and probably other issues as a result of the publish status also being published now for some reason. Thanks to rik0399.

## Version 2.31.4 (December 1, 2022) ##
* FIX: Various apparently minor issues from debug file participants.
* Improvement: Avoid casting things in SQL to make @shortcutsolutions happy.
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ Please try this website for studying Japanese flashcards.

## Changelog ##

## Version 2.31.5 (December 16, 2022) ##
* FIX: Fix the specified page doesnt exist message and probably other issues as a result of the publish status also being published now for some reason. Thanks to rik0399.

## Version 2.31.4 (December 1, 2022) ##
* FIX: Various apparently minor issues from debug file participants.
* Improvement: Avoid casting things in SQL to make @shortcutsolutions happy.
Expand Down
2 changes: 1 addition & 1 deletion includes/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
define('ABJ404_SOLUTION_BASENAME', function_exists('plugin_basename') ? plugin_basename(ABJ404_FILE) :
basename(dirname(ABJ404_FILE)) . '/' . basename(ABJ404_FILE));

define( 'ABJ404_VERSION', '2.31.4' );
define( 'ABJ404_VERSION', '2.31.5' );
define( 'URL_TRACKING_SUFFIX', '?utm_source=404SolutionPlugin&utm_medium=WordPress');
define( 'ABJ404_HOME_URL', 'https://www.ajexperience.com/404-solution/' . URL_TRACKING_SUFFIX);
define( 'ABJ404_FC_URL', 'https://www.ajexperience.com/' . URL_TRACKING_SUFFIX);
Expand Down
5 changes: 3 additions & 2 deletions includes/PluginLogic.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ function tryNormalPostQuery($options) {
if (!empty($pageid)) {
$permalink = urldecode(get_permalink($pageid));
$status = get_post_status($pageid);
if (($permalink != false) && ($status == 'publish')) {
if (($permalink != false) &&
(in_array($status, array('publish', 'published')))) {
$homeURL = get_home_url();
if ($homeURL == null) {
$homeURL = '';
Expand Down Expand Up @@ -221,7 +222,7 @@ function sendTo404Page($requestedURL, $reason = '') {
null, $options);

// make sure the page exists
if ($permalink['status'] != 'publish') {
if (!in_array($permalink['status'], array('publish', 'published'))) {
$msg = __("The user specified 404 page wasn't found. " .
"Please update the user-specified 404 page on the Options page.",
'404-solution');
Expand Down
2 changes: 1 addition & 1 deletion includes/SlugChangeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function save_postHandler($post_id, $post, $update) {
}

$postStatus = get_post_status($post_id);
if ('publish' != $postStatus) {
if (!in_array($postStatus, array('publish', 'published'))) {
$abj404logging->debugMessage(__CLASS__ . "/" . __FUNCTION__ . ": Post status: " .
$postStatus . " (skipped) (post ID " . $post_id . ").");
return;
Expand Down
2 changes: 1 addition & 1 deletion includes/SpellChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function savePostHandler($post_id, $post, $update, $saveOrDelete) {
}

// if the status is uninteresting then ignore it.
$interestingStatuses = array('publish');
$interestingStatuses = array('publish', 'published');
if (!in_array($oldStatus, $interestingStatuses) &&
!in_array($post->post_status, $interestingStatuses)) {

Expand Down
2 changes: 1 addition & 1 deletion includes/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ function getAdminOptionsPageAutoRedirects($options) {
if ($userSelectedDefault404Page != null) {
$permalink =
ABJ_404_Solution_Functions::permalinkInfoToArray($userSelectedDefault404Page, 0);
if ($permalink['status'] != 'publish') {
if (!in_array($permalink['status'], array('publish', 'published'))) {
$pageMissingWarning = __("(The specified page doesn't exist. " .
"Please update this setting.)", '404-solution');
}
Expand Down
2 changes: 1 addition & 1 deletion includes/sql/getIDsNeededForPermalinkCache.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ left outer join (
left outer join {wp_abj404_permalink_cache} pc
on wp_posts.ID = pc.id

where wp_posts.post_status = 'publish'
where wp_posts.post_status in ('publish', 'published')
and lcase(wp_posts.post_type) in ({recognizedPostTypes}) /* 'page', 'post', 'product' */


Expand Down
2 changes: 1 addition & 1 deletion includes/sql/getPublishedImageIDs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ left outer join (
) usefulterms
on wp_posts.ID = usefulterms.object_id

where wp_posts_parents.post_status = 'publish'
where wp_posts_parents.post_status in ('publish', 'published')

and ( usefulterms.grouped_terms is null or
usefulterms.grouped_terms not like '%exclude-from-search%'
Expand Down
2 changes: 1 addition & 1 deletion includes/sql/getPublishedPagesAndPostsIDs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on wp_posts.ID = usefulterms.object_id
left outer join {wp_abj404_permalink_cache} plc
on wp_posts.ID = plc.id

where wp_posts.post_status = 'publish'
where wp_posts.post_status in ('publish', 'published')
and lcase(wp_posts.post_type) in ({recognizedPostTypes}) /* 'page', 'post', 'product' */

/* only include this line if a slug has been specified. e.g.
Expand Down
2 changes: 1 addition & 1 deletion includes/sql/updatePermalinkCache.sql
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ from

where
/* only published posts. */
wpp.post_status = 'publish'
wpp.post_status in ('publish', 'published')
) subTable
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "404-solution",
"version": "2.31.4",
"version": "2.31.5",
"description": "The 404 Solution Plugin.",
"main": "Gulpfile.js",
"dependencies": {
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: aaron13100
Website: https://www.ajexperience.com/404-solution/
Tags: 404, page not found, redirect, 301, 302, permanent redirect, temporary redirect, error, permalink redirect, permalink
Requires at least: 3.9
Tested up to: 6.0
Stable tag: 2.31.4
Tested up to: 6.1
Stable tag: 2.31.5

Automatically redirect page not found errors (404s) when the slug matches (for permalink changes), when a very similar name match is found, or always to a default page.

Expand Down Expand Up @@ -84,6 +84,9 @@ Please try this website for studying flashcards.

== Changelog ==

= Version 2.31.5 (December 16, 2022) =
* FIX: Fix the specified page doesnt exist message and probably other issues as a result of the publish status also being published now for some reason. Thanks to rik0399.

= Version 2.31.4 (December 1, 2022) =
* FIX: Various apparently minor issues from debug file participants.
* Improvement: Avoid casting things in SQL to make @shortcutsolutions happy.
Expand Down

0 comments on commit 2861f5a

Please sign in to comment.