Skip to content

Commit

Permalink
4.7.4.1 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbroes committed Nov 5, 2024
1 parent ab1c26c commit 3c6b23f
Show file tree
Hide file tree
Showing 96 changed files with 7,378 additions and 105 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.3.1
* Version: 4.7.4.1
* Text Domain: all-in-one-seo-pack
* Domain Path: /languages
* License: GPL-3.0+
Expand Down
1 change: 1 addition & 0 deletions app/AIOSEO.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ public function load() {
$this->filters = $this->pro ? new Pro\Main\Filters() : new Lite\Main\Filters();
$this->crawlCleanup = new Common\QueryArgs\CrawlCleanup();
$this->emailReports = new Common\EmailReports\EmailReports();
$this->writingAssistant = new Common\WritingAssistant\WritingAssistant();

if ( ! wp_doing_ajax() && ! wp_doing_cron() ) {
$this->rss = new Common\Rss();
Expand Down
9 changes: 9 additions & 0 deletions app/AIOSEOAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -580,4 +580,13 @@ abstract class AIOSEOAbstract {
* @var null|\AIOSEO\Plugin\Common\EmailReports\EmailReports
*/
public $emailReports = null;

/**
* WritingAssistant class instance.
*
* @since 4.7.4
*
* @var null|\AIOSEO\Plugin\Common\WritingAssistant\WritingAssistant
*/
public $writingAssistant = null;
}
1 change: 1 addition & 0 deletions app/Common/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class Admin {
*/
public function __construct() {
new SeoAnalysis();
new WritingAssistant();

include_once ABSPATH . 'wp-admin/includes/plugin.php';
if (
Expand Down
2 changes: 1 addition & 1 deletion app/Common/Admin/PostSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public function getPostTypeOverview( $postType ) {
'{"focus":{"keyphrase":""%',
'{"focus":{"keyphrase":""%',
$postType,
...$specialPageIds
...array_values( $specialPageIds )
),
ARRAY_A
);
Expand Down
110 changes: 110 additions & 0 deletions app/Common/Admin/WritingAssistant.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php
namespace AIOSEO\Plugin\Common\Admin;

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

use AIOSEO\Plugin\Common\Models;

/**
* The Admin class.
*
* @since 4.7.4
*/
class WritingAssistant {
/**
* Class constructor.
*
* @since 4.7.4
*/
public function __construct() {
add_action( 'add_meta_boxes', [ $this, 'addMetabox' ] );
add_action( 'delete_post', [ $this, 'deletePost' ] );
}

/**
* Deletes the writing assistant post.
*
* @param int $postId The post id.
* @return void
*/
public function deletePost( $postId ) {
Models\WritingAssistantPost::getPost( $postId )->delete();
}

/**
* Adds a meta box to the page/posts screens.
*
* @since 4.7.4
*
* @return void
*/
public function addMetabox() {
if ( ! aioseo()->access->hasCapability( 'aioseo_page_writing_assistant_settings' ) ) {
return;
}

if (
! aioseo()->options->writingAssistant->postTypes->all &&
! in_array( get_post_type(), aioseo()->options->writingAssistant->postTypes->included, true )
) {
return;
}

// Skip post types that do not support an editor.
if ( ! post_type_supports( get_post_type(), 'editor' ) ) {
return;
}

add_action( 'admin_enqueue_scripts', [ $this, 'enqueueAssets' ] );

// Translators: 1 - The plugin short name ("AIOSEO").
$aioseoMetaboxTitle = sprintf( esc_html__( '%1$s Writing Assistant', 'all-in-one-seo-pack' ), AIOSEO_PLUGIN_SHORT_NAME );

add_meta_box(
'aioseo-writing-assistant-metabox',
$aioseoMetaboxTitle,
[ $this, 'renderMetabox' ],
null,
'normal',
'low'
);
}

/**
* Render the on-page settings metabox with the Vue App wrapper.
*
* @since 4.7.4
*
* @return void
*/
public function renderMetabox() {
?>
<div id="aioseo-writing-assistant-metabox-app">
<?php aioseo()->templates->getTemplate( 'parts/loader.php' ); ?>
</div>
<?php
}

/**
* Enqueues the JS/CSS for the standalone.
*
* @since 4.7.4
*
* @return void
*/
public function enqueueAssets() {
if ( ! aioseo()->helpers->isScreenBase( 'post' ) ) {
return;
}

aioseo()->core->assets->load(
'src/vue/standalone/writing-assistant/main.js',
[],
aioseo()->writingAssistant->helpers->getStandaloneVueData(),
'aioseoWritingAssistant'
);
}
}
34 changes: 29 additions & 5 deletions app/Common/Api/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ class Api {
'user/(?P<userId>[\d]+)/image' => [ 'callback' => [ 'User', 'getUserImage' ], 'access' => 'aioseo_page_social_settings' ],
'tags' => [ 'callback' => [ 'Tags', 'getTags' ], 'access' => 'everyone' ],
'search-statistics/url/auth' => [ 'callback' => [ 'SearchStatistics', 'getAuthUrl' ], 'access' => [ 'aioseo_search_statistics_settings', 'aioseo_general_settings', 'aioseo_setup_wizard' ] ], // phpcs:ignore Generic.Files.LineLength.MaxExceeded
'search-statistics/url/reauth' => [ 'callback' => [ 'SearchStatistics', 'getReauthUrl' ], 'access' => [ 'aioseo_search_statistics_settings', 'aioseo_general_settings' ] ]
'search-statistics/url/reauth' => [ 'callback' => [ 'SearchStatistics', 'getReauthUrl' ], 'access' => [ 'aioseo_search_statistics_settings', 'aioseo_general_settings' ] ],
'writing-assistant/keyword/(?P<postId>[\d]+)' => [ 'callback' => [ 'WritingAssistant', 'getPostKeyword' ], 'access' => 'aioseo_page_writing_assistant_settings' ],
'writing-assistant/user-info' => [ 'callback' => [ 'WritingAssistant', 'getUserInfo' ], 'access' => 'aioseo_page_writing_assistant_settings' ],
'writing-assistant/user-options' => [ 'callback' => [ 'WritingAssistant', 'getUserOptions' ], 'access' => 'aioseo_page_writing_assistant_settings' ],
'writing-assistant/report-history' => [ 'callback' => [ 'WritingAssistant', 'getReportHistory' ], 'access' => 'aioseo_page_writing_assistant_settings' ]
],
'POST' => [
'htaccess' => [ 'callback' => [ 'Tools', 'saveHtaccess' ], 'access' => 'aioseo_tools_settings' ],
Expand Down Expand Up @@ -130,24 +134,44 @@ class Api {
],
'crawl-cleanup' => [
'callback' => [ 'CrawlCleanup', 'fetchLogs', 'AIOSEO\\Plugin\\Common\\QueryArgs' ],
'access' => [ 'aioseo_search_appearance_settings' ]
'access' => 'aioseo_search_appearance_settings'
],
'crawl-cleanup/block' => [
'callback' => [ 'CrawlCleanup', 'blockArg', 'AIOSEO\\Plugin\\Common\\QueryArgs' ],
'access' => [ 'aioseo_search_appearance_settings' ]
'access' => 'aioseo_search_appearance_settings'
],
'crawl-cleanup/delete-blocked' => [
'callback' => [ 'CrawlCleanup', 'deleteBlocked', 'AIOSEO\\Plugin\\Common\\QueryArgs' ],
'access' => [ 'aioseo_search_appearance_settings' ]
'access' => 'aioseo_search_appearance_settings'
],
'crawl-cleanup/delete-unblocked' => [
'callback' => [ 'CrawlCleanup', 'deleteLog', 'AIOSEO\\Plugin\\Common\\QueryArgs' ],
'access' => [ 'aioseo_search_appearance_settings' ]
'access' => 'aioseo_search_appearance_settings'
],
'email-summary/send' => [
'callback' => [ 'EmailSummary', 'send' ],
'access' => 'aioseo_page_advanced_settings'
],
'writing-assistant/process' => [
'callback' => [ 'WritingAssistant', 'processKeyword' ],
'access' => 'aioseo_page_writing_assistant_settings'
],
'writing-assistant/content-analysis' => [
'callback' => [ 'WritingAssistant', 'getContentAnalysis' ],
'access' => 'aioseo_page_writing_assistant_settings'
],
'writing-assistant/disconnect' => [
'callback' => [ 'WritingAssistant', 'disconnect' ],
'access' => 'aioseo_page_writing_assistant_settings'
],
'writing-assistant/user-options' => [
'callback' => [ 'WritingAssistant', 'saveUserOptions' ],
'access' => 'aioseo_page_writing_assistant_settings'
],
'writing-assistant/set-report-progress' => [
'callback' => [ 'WritingAssistant', 'setReportProgress' ],
'access' => 'aioseo_page_writing_assistant_settings'
]
],
'DELETE' => [
'backup' => [ 'callback' => [ 'Tools', 'deleteBackup' ], 'access' => 'aioseo_tools_settings' ],
Expand Down
3 changes: 3 additions & 0 deletions app/Common/Api/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,9 @@ public static function doTask( $request ) {
aioseo()->internalOptions->internal->deprecatedOptions = array_values( $enabledDeprecated );
aioseo()->internalOptions->save( true );
break;
case 'aioseo-reset-seoboost-logins':
aioseo()->writingAssistant->seoBoost->resetLogins();
break;
default:
aioseo()->helpers->restoreCurrentBlog();

Expand Down
Loading

0 comments on commit 3c6b23f

Please sign in to comment.