Skip to content

Commit 76db715

Browse files
committed
4.7.6 Release
1 parent cd5b454 commit 76db715

File tree

135 files changed

+3270
-4286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+3270
-4286
lines changed

all_in_one_seo_pack.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: SEO for WordPress. Features like XML Sitemaps, SEO for custom post types, SEO for blogs, business sites, ecommerce sites, and much more. More than 100 million downloads since 2007.
66
* Author: All in One SEO Team
77
* Author URI: https://aioseo.com/
8-
* Version: 4.7.5.1
8+
* Version: 4.7.6
99
* Text Domain: all-in-one-seo-pack
1010
* Domain Path: /languages
1111
* License: GPL-3.0+

app/AIOSEO.php

+1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ public function load() {
323323
$this->filters = $this->pro ? new Pro\Main\Filters() : new Lite\Main\Filters();
324324
$this->crawlCleanup = new Common\QueryArgs\CrawlCleanup();
325325
$this->emailReports = new Common\EmailReports\EmailReports();
326+
$this->thirdParty = new Common\ThirdParty\ThirdParty();
326327
$this->writingAssistant = new Common\WritingAssistant\WritingAssistant();
327328

328329
if ( ! wp_doing_ajax() && ! wp_doing_cron() ) {

app/AIOSEOAbstract.php

+12-3
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,20 @@ abstract class AIOSEOAbstract {
582582
public $emailReports = null;
583583

584584
/**
585-
* WritingAssistant class instance.
585+
* ThirdParty class instance.
586586
*
587-
* @since 4.7.4
587+
* @since 4.7.6
588588
*
589-
* @var null|\AIOSEO\Plugin\Common\WritingAssistant\WritingAssistant
589+
* @var \AIOSEO\Plugin\Common\ThirdParty\ThirdParty
590590
*/
591+
public $thirdParty = null;
592+
593+
/**
594+
* WritingAssistant class instance.
595+
*
596+
* @since 4.7.4
597+
*
598+
* @var null|\AIOSEO\Plugin\Common\WritingAssistant\WritingAssistant
599+
*/
591600
public $writingAssistant = null;
592601
}

app/Common/Admin/Admin.php

+18-7
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,16 @@ public function init() {
166166
add_action( 'admin_init', [ $this, 'addPluginScripts' ] );
167167

168168
// Add redirects messages to trashed posts.
169-
add_filter( 'bulk_post_updated_messages', [ $this, 'appendTrashedMessage' ] );
169+
add_filter( 'bulk_post_updated_messages', [ $this, 'appendTrashedMessage' ], PHP_INT_MAX );
170170

171171
$this->registerLinkFormatHooks();
172172

173173
add_action( 'admin_footer', [ $this, 'addAioseoModalPortal' ] );
174174
}
175175

176176
$this->loadTextDomain();
177-
$this->setPages();
177+
178+
add_action( 'init', [ $this, 'setPages' ] );
178179
}
179180

180181
/**
@@ -185,7 +186,7 @@ public function init() {
185186
*
186187
* @return void
187188
*/
188-
protected function setPages() {
189+
public function setPages() {
189190
// TODO: Remove this after a couple months.
190191
$newIndicator = '<span class="aioseo-menu-new-indicator">&nbsp;NEW!</span>';
191192

@@ -588,11 +589,16 @@ protected function addEditSeoMenuItem() {
588589
return;
589590
}
590591

592+
$href = get_edit_post_link( $post->ID );
593+
if ( ! $href ) {
594+
return;
595+
}
596+
591597
$this->adminBarMenuItems[] = [
592598
'id' => 'aioseo-edit-' . $post->ID,
593599
'parent' => 'aioseo-main',
594600
'title' => esc_html__( 'Edit SEO', 'all-in-one-seo-pack' ),
595-
'href' => get_edit_post_link( $post->ID ) . '#aioseo-settings',
601+
'href' => $href . '#aioseo-settings',
596602
];
597603
}
598604

@@ -1144,6 +1150,7 @@ public function getFirstAvailablePageSlug() {
11441150
*/
11451151
public function appendTrashedMessage( $messages ) {
11461152
// Let advanced users override this.
1153+
11471154
if ( apply_filters( 'aioseo_redirects_disable_trashed_posts_suggestions', false ) ) {
11481155
return $messages;
11491156
}
@@ -1152,7 +1159,7 @@ public function appendTrashedMessage( $messages ) {
11521159
return $messages;
11531160
}
11541161

1155-
if ( empty( $_GET['ids'] ) ) { // phpcs:ignore HM.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Recommended
1162+
if ( empty( $_GET['ids'] ) ) { // phpcs:ignore HM.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Recommended
11561163
return $messages;
11571164
}
11581165

@@ -1186,8 +1193,12 @@ public function appendTrashedMessage( $messages ) {
11861193
$url = aioseo()->slugMonitor->manualRedirectUrl( $posts );
11871194
$addRedirect = _n( 'Add Redirect to improve SEO', 'Add Redirects to improve SEO', count( $posts ), 'all-in-one-seo-pack' );
11881195

1189-
$messages['post']['trashed'] = $messages['post']['trashed'] . '&nbsp;<a href="' . $url . '" class="aioseo-redirects-trashed-post">' . $addRedirect . '</a> |';
1190-
$messages['page']['trashed'] = $messages['page']['trashed'] . '&nbsp;<a href="' . $url . '" class="aioseo-redirects-trashed-post">' . $addRedirect . '</a> |';
1196+
$postType = get_post_type( $id );
1197+
if ( empty( $messages[ $postType ]['trashed'] ) ) {
1198+
$messages[ $postType ]['trashed'] = $messages['post']['trashed'];
1199+
}
1200+
1201+
$messages[ $postType ]['trashed'] = $messages[ $postType ]['trashed'] . '&nbsp;<a href="' . $url . '" class="aioseo-redirects-trashed-post">' . $addRedirect . '</a> |';
11911202

11921203
return $messages;
11931204
}

app/Common/Admin/NetworkAdmin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct() {
4343
public function init() {
4444
add_action( 'network_admin_menu', [ $this, 'addNetworkMenu' ] );
4545

46-
$this->setPages();
46+
add_action( 'init', [ $this, 'setPages' ] );
4747
}
4848

4949
/**

app/Common/Admin/PostSettings.php

+1
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ public function saveSettingsMetabox( $postId ) {
239239

240240
// If there is no data, there likely was an error, e.g. if the hidden field wasn't populated on load and the user saved the post without making changes in the metabox.
241241
// In that case we should return to prevent a complete reset of the data.
242+
242243
if ( empty( $currentPost ) ) {
243244
return;
244245
}

app/Common/Admin/WritingAssistant.php

+15-3
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,27 @@ public function addMetabox() {
4848
return;
4949
}
5050

51+
$postType = get_post_type();
5152
if (
52-
! aioseo()->options->writingAssistant->postTypes->all &&
53-
! in_array( get_post_type(), aioseo()->options->writingAssistant->postTypes->included, true )
53+
(
54+
! aioseo()->options->writingAssistant->postTypes->all &&
55+
! in_array( $postType, aioseo()->options->writingAssistant->postTypes->included, true )
56+
) ||
57+
! in_array( $postType, aioseo()->helpers->getPublicPostTypes( true ), true )
5458
) {
5559
return;
5660
}
5761

5862
// Skip post types that do not support an editor.
59-
if ( ! post_type_supports( get_post_type(), 'editor' ) ) {
63+
if ( ! post_type_supports( $postType, 'editor' ) ) {
64+
return;
65+
}
66+
67+
// Ignore certain plugins.
68+
if (
69+
aioseo()->thirdParty->webStories->isPluginActive() &&
70+
'web-story' === $postType
71+
) {
6072
return;
6173
}
6274

app/Common/Breadcrumbs/Breadcrumbs.php

+3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ public function buildBreadcrumbs( $type, $reference, $paged = [] ) {
172172
$this->addCrumbs( $this->getPostParentCrumbs( $reference ) );
173173
$this->addCrumbs( $this->getPostCrumb( $reference ) );
174174
break;
175+
case 'buddypress':
176+
$this->addCrumbs( aioseo()->standalone->buddyPress->component->getCrumbs() );
177+
break;
175178
}
176179

177180
// Paged crumb.

app/Common/Breadcrumbs/Frontend.php

+62-54
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
exit;
77
}
88

9+
use AIOSEO\Plugin\Common\Integrations\BuddyPress as BuddyPressIntegration;
10+
911
/**
1012
* Class Frontend.
1113
*
@@ -33,71 +35,77 @@ public function getBreadcrumbs() {
3335
return apply_filters( 'aioseo_breadcrumbs_trail', $this->breadcrumbs );
3436
}
3537

36-
$type = '';
3738
$reference = get_queried_object();
38-
// These types need the queried object for reference.
39-
if ( is_object( $reference ) ) {
40-
if ( is_single() ) {
41-
$type = 'single';
42-
}
43-
44-
if ( is_singular( 'post' ) ) {
45-
$type = 'post';
46-
}
47-
48-
if ( is_page() && ! is_front_page() ) {
49-
$type = 'page';
50-
}
51-
52-
if ( is_category() || is_tag() ) {
53-
$type = 'category';
54-
}
55-
56-
if ( is_tax() ) {
57-
$type = 'taxonomy';
58-
}
59-
60-
if ( is_post_type_archive() ) {
61-
$type = 'postTypeArchive';
62-
}
39+
$type = '';
40+
if ( BuddyPressIntegration::isComponentPage() ) {
41+
$type = 'buddypress';
42+
}
6343

64-
if ( is_author() ) {
65-
$type = 'author';
44+
if ( ! $type ) {
45+
// These types need the queried object for reference.
46+
if ( is_object( $reference ) ) {
47+
if ( is_single() ) {
48+
$type = 'single';
49+
}
50+
51+
if ( is_singular( 'post' ) ) {
52+
$type = 'post';
53+
}
54+
55+
if ( is_page() && ! is_front_page() ) {
56+
$type = 'page';
57+
}
58+
59+
if ( is_category() || is_tag() ) {
60+
$type = 'category';
61+
}
62+
63+
if ( is_tax() ) {
64+
$type = 'taxonomy';
65+
}
66+
67+
if ( is_post_type_archive() ) {
68+
$type = 'postTypeArchive';
69+
}
70+
71+
if ( is_author() ) {
72+
$type = 'author';
73+
}
74+
75+
if ( is_home() ) {
76+
$type = 'blog';
77+
}
78+
79+
// Support WC shop page.
80+
if ( aioseo()->helpers->isWooCommerceShopPage() ) {
81+
$type = 'wcShop';
82+
}
83+
84+
// Support WC products.
85+
if ( aioseo()->helpers->isWooCommerceProductPage() ) {
86+
$type = 'wcProduct';
87+
}
6688
}
6789

68-
if ( is_home() ) {
69-
$type = 'blog';
90+
if ( is_date() ) {
91+
$type = 'date';
92+
$reference = [
93+
'year' => get_query_var( 'year' ),
94+
'month' => get_query_var( 'monthnum' ),
95+
'day' => get_query_var( 'day' )
96+
];
7097
}
7198

72-
// Support WC shop page.
73-
if ( aioseo()->helpers->isWooCommerceShopPage() ) {
74-
$type = 'wcShop';
99+
if ( is_search() ) {
100+
$type = 'search';
101+
$reference = htmlspecialchars( sanitize_text_field( get_search_query() ) );
75102
}
76103

77-
// Support WC products.
78-
if ( aioseo()->helpers->isWooCommerceProductPage() ) {
79-
$type = 'wcProduct';
104+
if ( is_404() ) {
105+
$type = 'notFound';
80106
}
81107
}
82108

83-
if ( is_date() ) {
84-
$type = 'date';
85-
$reference = [
86-
'year' => get_query_var( 'year' ),
87-
'month' => get_query_var( 'monthnum' ),
88-
'day' => get_query_var( 'day' )
89-
];
90-
}
91-
92-
if ( is_search() ) {
93-
$type = 'search';
94-
$reference = htmlspecialchars( sanitize_text_field( get_search_query() ) );
95-
}
96-
97-
if ( is_404() ) {
98-
$type = 'notFound';
99-
}
100-
101109
$paged = false;
102110
if ( is_paged() || ( is_singular() && 1 < get_query_var( 'page' ) ) ) {
103111
global $wp;

0 commit comments

Comments
 (0)