Skip to content

Commit b28c566

Browse files
committed
4.8.9 Release
1 parent 7ed1ff8 commit b28c566

File tree

62 files changed

+836
-510
lines changed

Some content is hidden

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

62 files changed

+836
-510
lines changed

all_in_one_seo_pack.php

Lines changed: 1 addition & 1 deletion
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.8.8
8+
* Version: 4.8.9
99
* Text Domain: all-in-one-seo-pack
1010
* Domain Path: /languages
1111
* License: GPL-3.0+

app/AIOSEO.php

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,8 @@ private function loadVersion() {
221221
private function preLoad() {
222222
$this->core = new Common\Core\Core();
223223

224-
$this->backwardsCompatibility();
225-
226224
// Internal Options.
227-
$this->helpers = $this->pro ? new Pro\Utils\Helpers() : new Lite\Utils\Helpers();
225+
$this->helpers = $this->pro ? new Pro\Utils\Helpers() : new Lite\Utils\Helpers(); // Needs to load before preUpdates.
228226
$this->internalNetworkOptions = ( $this->pro && $this->helpers->isPluginNetworkActivated() ) ? new Pro\Options\InternalNetworkOptions() : new Common\Options\InternalNetworkOptions();
229227
$this->internalOptions = $this->pro ? new Pro\Options\InternalOptions() : new Lite\Options\InternalOptions();
230228
$this->uninstall = new Common\Main\Uninstall();
@@ -233,34 +231,6 @@ private function preLoad() {
233231
$this->preUpdates = $this->pro ? new Pro\Main\PreUpdates() : new Common\Main\PreUpdates();
234232
}
235233

236-
/**
237-
* To prevent errors and bugs from popping up,
238-
* we will run this backwards compatibility method.
239-
*
240-
* @since 4.1.9
241-
*
242-
* @return void
243-
*/
244-
private function backwardsCompatibility() {
245-
$this->db = $this->core->db;
246-
$this->cache = $this->core->cache;
247-
$this->transients = $this->cache;
248-
$this->cachePrune = $this->core->cachePrune;
249-
$this->optionsCache = $this->core->optionsCache;
250-
}
251-
252-
/**
253-
* To prevent errors and bugs from popping up,
254-
* we will run this backwards compatibility method.
255-
*
256-
* @since 4.2.0
257-
*
258-
* @return void
259-
*/
260-
private function backwardsCompatibilityLoad() {
261-
$this->postSettings->integrations = $this->standalone->pageBuilderIntegrations;
262-
}
263-
264234
/**
265235
* Load our classes.
266236
*
@@ -346,8 +316,6 @@ public function load() {
346316
$this->help = new Common\Help\Help();
347317
}
348318

349-
$this->backwardsCompatibilityLoad();
350-
351319
add_action( 'init', [ $this, 'loadInit' ], 999 );
352320
}
353321

app/Common/Admin/Admin.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,17 @@ public function hideScheduledActionsMenu() {
784784
return;
785785
}
786786

787+
// phpcs:disable WordPress.Security.NonceVerification.Recommended, HM.Security.NonceVerification.Recommended
788+
// Don't hide it if we're on the Scheduled Actions menu page.
789+
$page = isset( $_GET['page'] )
790+
? sanitize_text_field( wp_unslash( $_GET['page'] ) )
791+
: '';
792+
// phpcs:enable
793+
794+
if ( 'action-scheduler' === $page || aioseo()->helpers->isDev() ) {
795+
return;
796+
}
797+
787798
foreach ( $submenu['tools.php'] as $index => $props ) {
788799
if ( ! empty( $props[2] ) && 'action-scheduler' === $props[2] ) {
789800
unset( $submenu['tools.php'][ $index ] );

app/Common/Admin/Pointers.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public function registerPointer( $id, $pageSlug, $args ) {
8282
?>
8383
<script>
8484
jQuery( document ).ready( function( $ ) {
85-
var isClosed = false;
86-
var pointer = $( '#toplevel_page_aioseo > a' ).pointer( {
85+
const $menuItem = $( '#toplevel_page_aioseo' );
86+
const $pointer = $menuItem.pointer( {
8787
content :
8888
"<h3><?php esc_html_e( $args['title'], 'all-in-one-seo-pack' ); ?><\/h3>" +
8989
"<h4><?php esc_html_e( $args['subtitle'], 'all-in-one-seo-pack' ); ?><\/h4>" +
@@ -99,13 +99,15 @@ public function registerPointer( $id, $pageSlug, $args ) {
9999
edge : <?php echo is_rtl() ? "'right'" : "'left'"; ?>,
100100
align : 'center'
101101
},
102-
pointerWidth : 420,
102+
pointerWidth: 420,
103103
show: function(event, el) {
104-
el.pointer.css({'position':'fixed'});
105104
el.pointer.addClass('aioseo-wp-pointer');
105+
$menuItem.addClass('aioseo-pointer-active');
106106
},
107107
close : function() {
108-
isClosed = true;
108+
setTimeout(() => {
109+
$menuItem.removeClass('aioseo-pointer-active');
110+
}, 300);
109111
jQuery.get(
110112
window.location.href,
111113
{
@@ -115,6 +117,8 @@ public function registerPointer( $id, $pageSlug, $args ) {
115117
);
116118
}
117119
} ).pointer('open');
120+
121+
$menuItem.append($('body .wp-pointer.aioseo-wp-pointer'));
118122
} );
119123
</script>
120124
<?php

app/Common/Ai/Ai.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getAccessToken( $refresh = false ) {
8989
return;
9090
}
9191

92-
if ( aioseo()->cache->get( 'ai-access-token-error' ) ) {
92+
if ( aioseo()->core->cache->get( 'ai-access-token-error' ) ) {
9393
return;
9494
}
9595

@@ -100,7 +100,7 @@ public function getAccessToken( $refresh = false ) {
100100
] );
101101

102102
if ( is_wp_error( $response ) ) {
103-
aioseo()->cache->update( 'ai-access-token-error', true, 1 * HOUR_IN_SECONDS );
103+
aioseo()->core->cache->update( 'ai-access-token-error', true, 1 * HOUR_IN_SECONDS );
104104

105105
// Schedule another, one-time event in approx. 1 hour from now.
106106
aioseo()->actionScheduler->scheduleSingle( $this->creditFetchAction, 1 * ( HOUR_IN_SECONDS + wp_rand( 0, 30 * MINUTE_IN_SECONDS ) ), [] );
@@ -111,7 +111,7 @@ public function getAccessToken( $refresh = false ) {
111111
$body = wp_remote_retrieve_body( $response );
112112
$data = json_decode( $body );
113113
if ( empty( $data->accessToken ) ) {
114-
aioseo()->cache->update( 'ai-access-token-error', true, 1 * HOUR_IN_SECONDS );
114+
aioseo()->core->cache->update( 'ai-access-token-error', true, 1 * HOUR_IN_SECONDS );
115115

116116
// Schedule another, one-time event in approx. 1 hour from now.
117117
aioseo()->actionScheduler->scheduleSingle( $this->creditFetchAction, 1 * ( HOUR_IN_SECONDS + wp_rand( 0, 30 * MINUTE_IN_SECONDS ) ), [] );
@@ -152,7 +152,7 @@ public function scheduleCreditFetchAction() {
152152
* @return void
153153
*/
154154
public function updateCredits( $refresh = false ) {
155-
if ( aioseo()->cache->get( 'ai-credits-error' ) && ! $refresh ) {
155+
if ( aioseo()->core->cache->get( 'ai-credits-error' ) && ! $refresh ) {
156156
return;
157157
}
158158

@@ -165,7 +165,7 @@ public function updateCredits( $refresh = false ) {
165165
] );
166166

167167
if ( is_wp_error( $response ) ) {
168-
aioseo()->cache->update( 'ai-credits-error', true, HOUR_IN_SECONDS );
168+
aioseo()->core->cache->update( 'ai-credits-error', true, HOUR_IN_SECONDS );
169169

170170
// Schedule another, one-time event in approx. 1 hour from now.
171171
aioseo()->actionScheduler->scheduleSingle( $this->creditFetchAction, 1 * ( HOUR_IN_SECONDS + wp_rand( 0, 30 * MINUTE_IN_SECONDS ) ), [] );
@@ -181,7 +181,7 @@ public function updateCredits( $refresh = false ) {
181181
aioseo()->internalOptions->internal->ai->accessToken = '';
182182
}
183183

184-
aioseo()->cache->update( 'ai-credits-error', true, HOUR_IN_SECONDS );
184+
aioseo()->core->cache->update( 'ai-credits-error', true, HOUR_IN_SECONDS );
185185

186186
// Schedule another, one-time event in approx. 1 hour from now.
187187
aioseo()->actionScheduler->scheduleSingle( $this->creditFetchAction, 1 * ( HOUR_IN_SECONDS + wp_rand( 0, 30 * MINUTE_IN_SECONDS ) ), [] );

app/Common/Ai/Image.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ public function __construct() {
3030
add_action( $this->generateImageMetadataHook, [ $this, 'generateImageMetadata' ], 10, 2 );
3131
}
3232

33+
/**
34+
* Returns the data for Vue.
35+
*
36+
* @since 4.8.9
37+
*
38+
* @param int|null $objectId The object ID.
39+
* @return array The data.
40+
*/
41+
public function getVueDataEdit( $objectId = null ) {
42+
$objectId = $objectId ?: absint( get_the_ID() );
43+
44+
return [
45+
'extend' => [
46+
'imageBlockToolbar' => apply_filters( 'aioseo_ai_image_generator_extend_image_block_toolbar', true, $objectId ),
47+
'imageBlockPlaceholder' => apply_filters( 'aioseo_ai_image_generator_extend_image_block_placeholder', true, $objectId ),
48+
'featuredImageButton' => apply_filters( 'aioseo_ai_image_generator_extend_featured_image_button', true, $objectId ),
49+
]
50+
];
51+
}
52+
3353
/**
3454
* Creates a WordPress attachment from base64 image data.
3555
*

app/Common/Api/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ protected function getRouteData( $request ) {
365365
if ( empty( $routeData ) ) {
366366
foreach ( $this->getRoutes()[ $request->get_method() ] as $routeRegex => $routeInfo ) {
367367
$routeRegex = str_replace( '@', '\@', $routeRegex );
368-
if ( preg_match( "@{$routeRegex}@", (string) $route ) ) {
368+
if ( preg_match( "@^{$routeRegex}$@", (string) $route ) ) {
369369
$routeData = $routeInfo;
370370
break;
371371
}

app/Common/Api/Settings.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,10 @@ public static function prepareCSVImport( $fileContent ) {
451451
'postOptions' => null
452452
];
453453

454-
$rows = str_getcsv( $fileContent, "\n" );
454+
$rows = str_getcsv( $fileContent, "\n", '"', '\\' );
455455

456456
// Get the first row to check if the file has post_id or term_id.
457-
$header = str_getcsv( $rows[0], ',' );
457+
$header = str_getcsv( $rows[0], ',', '"', '\\' );
458458
$header = aioseo()->helpers->sanitizeOption( $header );
459459

460460
// Check if the file has post_id or term_id.
@@ -482,7 +482,7 @@ public static function prepareCSVImport( $fileContent ) {
482482

483483
foreach ( $rows as $row ) {
484484
$row = str_replace( '\\""', '\\"', $row );
485-
$row = str_getcsv( $row, ',' );
485+
$row = str_getcsv( $row, ',', '"', '\\' );
486486

487487
foreach ( $row as $key => $value ) {
488488
$key = aioseo()->helpers->sanitizeOption( $key );
@@ -769,7 +769,7 @@ public static function doTask( $request ) {
769769
break;
770770
case 'reset-data':
771771
aioseo()->uninstall->dropData( true );
772-
aioseo()->internalOptions->database->installedTables = '';
772+
aioseo()->core->cache->delete( 'db_schema' );
773773
aioseo()->internalOptions->internal->lastActiveVersion = '4.0.0';
774774
aioseo()->internalOptions->save( true );
775775
aioseo()->updates->addInitialCustomTablesForV4();
@@ -780,12 +780,12 @@ public static function doTask( $request ) {
780780
break;
781781
// Migrations
782782
case 'rerun-migrations':
783-
aioseo()->internalOptions->database->installedTables = '';
783+
aioseo()->core->cache->delete( 'db_schema' );
784784
aioseo()->internalOptions->internal->lastActiveVersion = '4.0.0';
785785
aioseo()->internalOptions->save( true );
786786
break;
787787
case 'rerun-addon-migrations':
788-
aioseo()->internalOptions->database->installedTables = '';
788+
aioseo()->core->cache->delete( 'db_schema' );
789789

790790
foreach ( $data as $sku ) {
791791
$convertedSku = aioseo()->helpers->dashesToCamelCase( $sku );

app/Common/Breadcrumbs/Block.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ private function getBlockOverrides() {
172172
$default = filter_var( $this->breadcrumbSettings['default'], FILTER_VALIDATE_BOOLEAN );
173173
if ( true === $default || ! aioseo()->pro ) {
174174
return [
175-
'postTitle' => ! empty( $this->postTitle ) ? $this->postTitle : null
175+
'postTitle' => ! empty( $this->postTitle ) ? $this->postTitle : null,
176+
'primaryTerm' => ! empty( $this->primaryTerm[ $this->breadcrumbSettings['taxonomy'] ] ) ? $this->primaryTerm[ $this->breadcrumbSettings['taxonomy'] ] : null
176177
];
177178
}
178179

app/Common/Breadcrumbs/Frontend.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function getBreadcrumbs() {
9898

9999
if ( is_search() ) {
100100
$type = 'search';
101-
$reference = htmlspecialchars( sanitize_text_field( get_search_query() ) );
101+
$reference = htmlspecialchars( sanitize_text_field( get_search_query() ), ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 );
102102
}
103103

104104
if ( is_404() ) {
@@ -245,7 +245,7 @@ protected function breadcrumbToDisplay( $item ) {
245245
function ( $matches ) {
246246
return '>' . $matches[1] . '>';
247247
},
248-
htmlentities( $templateItem['template'] )
248+
htmlentities( $templateItem['template'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 )
249249
);
250250

251251
// Restore html.

0 commit comments

Comments
 (0)