Skip to content

Commit

Permalink
4.7.5.1 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbroes committed Nov 19, 2024
1 parent 1c445f3 commit cd5b454
Show file tree
Hide file tree
Showing 72 changed files with 4,614 additions and 249 deletions.
2 changes: 1 addition & 1 deletion all_in_one_seo_pack.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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.
* Author: All in One SEO Team
* Author URI: https://aioseo.com/
* Version: 4.7.5
* Version: 4.7.5.1
* Text Domain: all-in-one-seo-pack
* Domain Path: /languages
* License: GPL-3.0+
Expand Down
12 changes: 2 additions & 10 deletions app/Common/Schema/Graphs/BreadcrumbList.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,11 @@ public function get() {
}

if ( $trailLength > $breadcrumb['position'] ) {
$listItem['nextItem'] = [
'@type' => 'ListItem',
'@id' => $breadcrumbs[ $breadcrumb['position'] ]['url'] . '#listItem',
'name' => $breadcrumbs[ $breadcrumb['position'] ]['name'],
];
$listItem['nextItem'] = $breadcrumbs[ $breadcrumb['position'] ]['url'] . '#listItem';
}

if ( 1 < $breadcrumb['position'] ) {
$listItem['previousItem'] = [
'@type' => 'ListItem',
'@id' => $breadcrumbs[ $breadcrumb['position'] - 2 ]['url'] . '#listItem',
'name' => $breadcrumbs[ $breadcrumb['position'] - 2 ]['name'],
];
$listItem['previousItem'] = $breadcrumbs[ $breadcrumb['position'] - 2 ]['url'] . '#listItem';
}

$listItems[] = $listItem;
Expand Down
4 changes: 3 additions & 1 deletion app/Common/SearchStatistics/Api/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function __construct( $route, $args = [], $method = 'POST' ) {
*
* @since 4.3.0
*
* @return mixed The response.
* @return mixed $value The response.
*/
public function request() {
// Make sure we're not blocked.
Expand Down Expand Up @@ -223,6 +223,7 @@ public function request() {

$body['timezone'] = gmdate( 'e' );
$body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_ADDR'] ) ) : '';
$body['internalOptions'] = aioseo()->internalOptions->internal->searchStatistics->all();

// 2. SET HEADERS
$headers = array_merge( [
Expand All @@ -244,6 +245,7 @@ public function request() {
];

// 4. EXECUTE REQUEST
$response = null;
if ( 'GET' === $this->method ) {
$queryString = http_build_query( $body, '', '&' );

Expand Down
4 changes: 1 addition & 3 deletions app/Common/Sitemap/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ public function getTotal() {
// Check if requested index has a dedicated method.
$methodName = aioseo()->helpers->dashesToCamelCase( aioseo()->sitemap->indexName );
if ( method_exists( $this, $methodName ) ) {
$res = $this->$methodName();

return ! empty( $res ) ? count( $res ) : 0;
return count( $this->$methodName() );
}

// Check if requested index is a registered post type.
Expand Down
2 changes: 1 addition & 1 deletion app/Common/Sitemap/Image/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private function extract() {
$thirdParty = new ThirdParty( $this->post, $parsedPostContent );
$images = array_merge( $images, $thirdParty->extract() );

preg_match_all( '#<img[^>]+src="([^">]+)"#', (string) $parsedPostContent, $matches );
preg_match_all( '#<img[^>]+src="([^">]+)"#', $parsedPostContent, $matches );
foreach ( $matches[1] as $url ) {
$images[] = aioseo()->helpers->makeUrlAbsolute( $url );
}
Expand Down
116 changes: 116 additions & 0 deletions app/Common/Sitemap/Ping.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?php
namespace AIOSEO\Plugin\Common\Sitemap;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

use AIOSEO\Plugin\Common\Models;

/**
* Handles our sitemap search engine ping feature.
*
* @since 4.0.0
*/
class Ping {
/**
* Registers our hooks.
*
* @since 4.0.0
*/
public function init() {
if ( 0 === (int) get_option( 'blog_public' ) ) {
return;
}

add_action( 'init', [ $this, 'scheduleRecurring' ] );

// Ping sitemap on each post update.
add_action( 'save_post', [ $this, 'schedule' ], 1000, 2 );
add_action( 'delete_post', [ $this, 'schedule' ], 1000, 2 );

// Action Scheduler hooks.
add_action( 'aioseo_sitemap_ping', [ $this, 'ping' ] );
add_action( 'aioseo_sitemap_ping_recurring', [ $this, 'ping' ] );
}

/**
* Schedules a sitemap ping.
*
* @since 4.0.0
*
* @param integer $postId The ID of the post.
* @param \WP_Post $post The post object.
* @return void
*/
public function schedule( $postId, $post = null ) {
if ( ! aioseo()->helpers->isValidPost( $post ) ) {
return;
}

// If Limit Modified Date is enabled, let's return early.
$aioseoPost = Models\Post::getPost( $postId );
if ( $aioseoPost->limit_modified_date ) {
return;
}

// First, unschedule any ping actions that might already be enqueued.
aioseo()->actionScheduler->unschedule( 'aioseo_sitemap_ping' );
// Then, schedule the new ping.
aioseo()->actionScheduler->scheduleSingle( 'aioseo_sitemap_ping', 30 );
}

/**
* Schedules the recurring sitemap ping.
*
* @since 4.0.0
*
* @return void
*/
public function scheduleRecurring() {
try {
if ( ! as_next_scheduled_action( 'aioseo_sitemap_ping_recurring' ) ) {

$interval = apply_filters( 'aioseo_sitemap_ping_recurring', DAY_IN_SECONDS );
as_schedule_recurring_action( strtotime( 'tomorrow' ), $interval, 'aioseo_sitemap_ping_recurring', [], 'aioseo' );
}
} catch ( \Exception $e ) {
// Do nothing.
}
}

/**
* Pings search engines when the sitemap is updated.
*
* @since 4.0.0
*
* @param array $sitemapUrls Sitemap URLs that should be sent to the remote endpoints.
* @return void
*/
public function ping( $sitemapUrls = [] ) {
$endpoints = apply_filters( 'aioseo_sitemap_ping_urls', [
'https://www.google.com/ping?sitemap='
] );

if ( aioseo()->options->sitemap->general->enable ) {
$sitemapUrls[] = aioseo()->sitemap->helpers->getUrl( 'general' );
}
if ( aioseo()->options->sitemap->rss->enable ) {
$sitemapUrls[] = aioseo()->sitemap->helpers->getUrl( 'rss' );
}

$addonsSitemapUrls = aioseo()->addons->doAddonFunction( 'ping', 'getPingUrls' );
foreach ( $addonsSitemapUrls as $addonSitemapUrls ) {
if ( is_array( $addonSitemapUrls ) ) {
$sitemapUrls = array_merge( $sitemapUrls, $addonSitemapUrls );
}
}

foreach ( $endpoints as $endpoint ) {
foreach ( $sitemapUrls as $url ) {
wp_remote_get( $endpoint . urlencode( $url ) );
}
}
}
}
2 changes: 1 addition & 1 deletion app/Common/Sitemap/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public function terms( $taxonomy, $additionalArgs = [] ) {
`tt`.`count` > 0 OR
EXISTS (
SELECT 1
FROM `wp_term_taxonomy` as tt2
FROM `$termTaxonomyTable` as tt2
WHERE `tt2`.`parent` = `tt`.`term_id`
AND `tt2`.`count` > 0
)
Expand Down
8 changes: 2 additions & 6 deletions app/Common/Social/Twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ public function getCardType() {
*/
public function getCreator() {
$post = aioseo()->helpers->getPost();
if (
! is_a( $post, 'WP_Post' ) ||
! post_type_supports( $post->post_type, 'author' ) ||
! aioseo()->options->social->twitter->general->showAuthor
) {
if ( ! is_a( $post, 'WP_Post' ) || ! aioseo()->options->social->twitter->general->showAuthor ) {
return '';
}

Expand Down Expand Up @@ -252,7 +248,7 @@ public function getAdditionalData() {
return $data;
}

if ( $post->post_author && post_type_supports( $post->post_type, 'author' ) ) {
if ( $post->post_author ) {
$data[] = [
'label' => __( 'Written by', 'all-in-one-seo-pack' ),
'value' => get_the_author_meta( 'display_name', $post->post_author )
Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: SEO, Google Search Console, XML Sitemap, meta description, schema
Tested up to: 6.7
Requires at least: 5.3
Requires PHP: 7.0
Stable tag: 4.7.5
Stable tag: 4.7.5.1
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.txt

Expand Down Expand Up @@ -226,6 +226,10 @@ AIOSEO&reg; is a registered trademark of Semper Plugins LLC. When writing about

== Changelog ==

**New in Version 4.7.5.1**

* Fixed: XML sitemap not including terms in some cases due to DB error.

**New in Version 4.7.5**

* Updated: XML sitemaps now include parent terms without posts if they have any children with posts.
Expand All @@ -250,6 +254,7 @@ AIOSEO&reg; is a registered trademark of Semper Plugins LLC. When writing about
* Fixed: Searching for non-English strings in redirects/404 log tables returned no results.
* Fixed: BuddyPress schema markup causing an error in Google Search Console.
* Fixed: PHP error due to unpacking an array with string keys.
* Fixed: SEO Preview URL character encoding.

**New in Version 4.7.4.2**

Expand Down Expand Up @@ -409,6 +414,6 @@ Additionally, AIOSEO can also provide you with data on the most frequently used

== Upgrade Notice ==

= 4.7.5 =
= 4.7.5.1 =

This update adds major improvements and bug fixes.
16 changes: 8 additions & 8 deletions src/react/link-format/block/formats/link/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,16 @@ function InlineLinkUI ({

return (
<Popover
key={mountingKey}
anchor={anchorValue}
focusOnMount={addingLink ? 'firstElement' : false}
onClose={stopAddingLink}
key={ mountingKey }
anchor={ anchorValue }
focusOnMount={ addingLink ? 'firstElement' : false }
onClose={ stopAddingLink }
>
<LinkControl
value={linkValue}
onChange={onChangeLink}
forceIsEditingLink={addingLink}
selectedText={selectedText}
value={ linkValue }
onChange={ onChangeLink }
forceIsEditingLink={ addingLink }
selectedText={ selectedText }
/>
</Popover>
)
Expand Down
10 changes: 1 addition & 9 deletions src/vue/components/common/core/wp/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,6 @@ export default {
blurRows : Boolean,
disableTable : Boolean,
showItemsPerPage : Boolean,
resetSelection : {
type : Boolean,
default () {
return true
}
},
exportColumns : {
type : Array,
default () {
Expand Down Expand Up @@ -600,9 +594,7 @@ export default {
return
}
if (this.resetSelection) {
this.resetSelectedItems()
}
this.resetSelectedItems()
},
processPaginate (page) {
this.pageNumber = page
Expand Down
18 changes: 18 additions & 0 deletions src/vue/composables/HeadlineResult.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { __ } from '@wordpress/i18n'

const td = import.meta.env.VITE_TEXTDOMAIN

export const useHeadlineResult = () => {
const strings = {
wordBalance : __('Word balance', td),
characterCount : __('Character Count', td),
sentiment : __('Sentiment', td),
wordCount : __('Word Count', td),
headlineType : __('Headline Type', td),
goal : __('Goal: ', td)
}

return {
strings
}
}
38 changes: 38 additions & 0 deletions src/vue/composables/SearchConsole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { __, sprintf } from '@wordpress/i18n'
import { useRootStore } from '@/vue/stores'

const td = import.meta.env.VITE_TEXTDOMAIN

export function useSearchConsole () {
const strings = {
aioseoCanNowVerify : sprintf(
// Translators: 1 - The plugin short name ("AIOSEO").
__('%1$s can now verify whether your site is correctly verified with Google Search Console and that your sitemaps have been submitted correctly. Connect with Google Search Console now to ensure your content is being added to Google as soon as possible for increased rankings.', td),
import.meta.env.VITE_SHORT_NAME
),
connectToGoogleSearchConsole : __('Connect to Google Search Console', td),
connectToGoogleToAddSitemaps : __('Connect to Google to automatically add sitemaps and keep them in sync.', td),
syncYourSiteWithGsc : __('Upgrade to Pro to unlock Search Statistics and sync your site with Google Search Console. Get valuable insights right inside your WordPress dashboard, track keyword rankings and search performance for individual posts with actionable insights to help you rank higher in search results!', td),
fixSitemapErrors : __('Fix Errors', td),
aioseoHasFoundSomeErrorsInSitemaps : sprintf(
// Translators: 1 - The plugin short name ("AIOSEO").
__('%1$s has found some errors in sitemaps that were previously submitted to Google Search Console. Since %1$s manages your sitemaps, these additional sitemaps can be removed.', td),
import.meta.env.VITE_SHORT_NAME
),
thereAreSitemapsWithErrors : __('There are sitemaps with errors', td),
gscFeature1 : __('Google Search Console Metrics', td),
gscFeature2 : __('SEO Changes Performance Tracking', td),
gscFeature3 : __('Top Content Discovery', td),
gscFeature4 : __('Content Decay Tracking', td)
}

const redirectToGscSettings = () => {
const rootStore = useRootStore()
window.location.href = `${rootStore.aioseo.urls.aio.settings}&aioseo-scroll=google-search-console-settings&aioseo-highlight=google-search-console-settings#/webmaster-tools?activetool=googleSearchConsole`
}

return {
strings,
redirectToGscSettings
}
}
25 changes: 25 additions & 0 deletions src/vue/composables/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useAccessControl } from './AccessControl'
import { useHeadlineResult } from './HeadlineResult'
import { useJsonValues } from './JsonValues'
import { useNotifications } from './Notifications'
import { useSeoSiteScore } from './SeoSiteScore'
import { useTruSeoScore } from './TruSeoScore'
import { useIndexStatus } from './IndexStatus'
import { useSearchConsole } from './SearchConsole'
import { useWebmasterTools } from './WebmasterTools'
import { useWidgets } from './Widgets'
import { useWizard } from './Wizard'

export {
useAccessControl,
useHeadlineResult,
useJsonValues,
useNotifications,
useSeoSiteScore,
useTruSeoScore,
useIndexStatus,
useSearchConsole,
useWebmasterTools,
useWidgets,
useWizard
}
Loading

0 comments on commit cd5b454

Please sign in to comment.