Skip to content

Commit f39369e

Browse files
authored
Merge pull request #644 from ProgressPlanner/jdv/aioseo-integration
AIOSEO integration
2 parents 707f951 + f9aa22a commit f39369e

17 files changed

Lines changed: 1219 additions & 1 deletion

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
= 1.9.0 =
22

3+
In this release we've added an integration with the **All In One Seo** plugin so you’ll now see personalized suggestions based on your current SEO configuration.
4+
5+
Added these recommendations from Ravi:
6+
7+
* All In One SEO: [noindex the author archive](https://prpl.fyi/aioseo-author-archive)
8+
* All In One SEO: [noindex the date archive](https://prpl.fyi/aioseo-date-archive)
9+
* All In One SEO: [Remove post authors feeds](https://prpl.fyi/aioseo-crawl-optimization-feed-authors)
10+
* All In One SEO: [Remove comment feeds](https://prpl.fyi/aioseo-crawl-optimization-feed-comments)
11+
* All In One SEO: [disable the media pages](https://prpl.fyi/aioseo-media-pages)
12+
* All In One SEO: set your [organization](https://prpl.fyi/aioseo-organization-logo) or [person](https://prpl.fyi/aioseo-person-logo) logo
13+
314
Enhancements:
415

516
* Add "Show all Recommendations" button to the "Ravi's Recommendations" widget
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* global prplInteractiveTaskFormListener, progressPlanner */
2+
3+
/*
4+
* All in One SEO: noindex the author archive.
5+
*
6+
* Dependencies: progress-planner/recommendations/interactive-task
7+
*/
8+
9+
prplInteractiveTaskFormListener.customSubmit( {
10+
taskId: 'aioseo-author-archive',
11+
popoverId: 'prpl-popover-aioseo-author-archive',
12+
callback: () => {
13+
fetch( progressPlanner.ajaxUrl, {
14+
method: 'POST',
15+
headers: {
16+
'Content-Type': 'application/x-www-form-urlencoded',
17+
},
18+
body: new URLSearchParams( {
19+
action: 'prpl_interactive_task_submit_aioseo-author-archive',
20+
nonce: progressPlanner.nonce,
21+
} ),
22+
} );
23+
},
24+
} );
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* global prplInteractiveTaskFormListener, progressPlanner */
2+
3+
/*
4+
* All in One SEO: disable author RSS feeds.
5+
*
6+
* Dependencies: progress-planner/recommendations/interactive-task
7+
*/
8+
9+
prplInteractiveTaskFormListener.customSubmit( {
10+
taskId: 'aioseo-crawl-settings-feed-authors',
11+
popoverId: 'prpl-popover-aioseo-crawl-settings-feed-authors',
12+
callback: () => {
13+
fetch( progressPlanner.ajaxUrl, {
14+
method: 'POST',
15+
headers: {
16+
'Content-Type': 'application/x-www-form-urlencoded',
17+
},
18+
body: new URLSearchParams( {
19+
action: 'prpl_interactive_task_submit_aioseo-crawl-settings-feed-authors',
20+
nonce: progressPlanner.nonce,
21+
} ),
22+
} );
23+
},
24+
} );
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* global prplInteractiveTaskFormListener, progressPlanner */
2+
3+
/*
4+
* All in One SEO: disable global comment RSS feeds.
5+
*
6+
* Dependencies: progress-planner/recommendations/interactive-task
7+
*/
8+
9+
prplInteractiveTaskFormListener.customSubmit( {
10+
taskId: 'aioseo-crawl-settings-feed-comments',
11+
popoverId: 'prpl-popover-aioseo-crawl-settings-feed-comments',
12+
callback: () => {
13+
fetch( progressPlanner.ajaxUrl, {
14+
method: 'POST',
15+
headers: {
16+
'Content-Type': 'application/x-www-form-urlencoded',
17+
},
18+
body: new URLSearchParams( {
19+
action: 'prpl_interactive_task_submit_aioseo-crawl-settings-feed-comments',
20+
nonce: progressPlanner.nonce,
21+
} ),
22+
} );
23+
},
24+
} );
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* global prplInteractiveTaskFormListener, progressPlanner */
2+
3+
/*
4+
* All in One SEO: noindex the date archive.
5+
*
6+
* Dependencies: progress-planner/recommendations/interactive-task
7+
*/
8+
9+
prplInteractiveTaskFormListener.customSubmit( {
10+
taskId: 'aioseo-date-archive',
11+
popoverId: 'prpl-popover-aioseo-date-archive',
12+
callback: () => {
13+
fetch( progressPlanner.ajaxUrl, {
14+
method: 'POST',
15+
headers: {
16+
'Content-Type': 'application/x-www-form-urlencoded',
17+
},
18+
body: new URLSearchParams( {
19+
action: 'prpl_interactive_task_submit_aioseo-date-archive',
20+
nonce: progressPlanner.nonce,
21+
} ),
22+
} );
23+
},
24+
} );
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* global prplInteractiveTaskFormListener, progressPlanner */
2+
3+
/*
4+
* All in One SEO: redirect media pages.
5+
*
6+
* Dependencies: progress-planner/recommendations/interactive-task
7+
*/
8+
9+
prplInteractiveTaskFormListener.customSubmit( {
10+
taskId: 'aioseo-media-pages',
11+
popoverId: 'prpl-popover-aioseo-media-pages',
12+
callback: () => {
13+
fetch( progressPlanner.ajaxUrl, {
14+
method: 'POST',
15+
headers: {
16+
'Content-Type': 'application/x-www-form-urlencoded',
17+
},
18+
body: new URLSearchParams( {
19+
action: 'prpl_interactive_task_submit_aioseo-media-pages',
20+
nonce: progressPlanner.nonce,
21+
} ),
22+
} );
23+
},
24+
} );

classes/suggested-tasks/class-tasks-manager.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Progress_Planner\Suggested_Tasks\Providers\Search_Engine_Visibility;
2626
use Progress_Planner\Suggested_Tasks\Tasks_Interface;
2727
use Progress_Planner\Suggested_Tasks\Providers\Integrations\Yoast\Add_Yoast_Providers;
28+
use Progress_Planner\Suggested_Tasks\Providers\Integrations\AIOSEO\Add_AIOSEO_Providers;
2829
use Progress_Planner\Suggested_Tasks\Providers\User as User_Tasks;
2930
use Progress_Planner\Suggested_Tasks\Providers\Email_Sending;
3031
use Progress_Planner\Suggested_Tasks\Providers\Set_Valuable_Post_Types;
@@ -100,13 +101,16 @@ public function __construct() {
100101
}
101102

102103
/**
103-
* Add the Yoast task if the plugin is active.
104+
* Add the plugin integrations if the plugins are active.
104105
*
105106
* @return void
106107
*/
107108
public function add_plugin_integration() {
108109
// Yoast SEO integration.
109110
new Add_Yoast_Providers();
111+
112+
// All in One SEO integration.
113+
new Add_AIOSEO_Providers();
110114
}
111115

112116
/**
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Class to add the AIOSEO providers.
4+
*
5+
* @package Progress_Planner
6+
*/
7+
8+
namespace Progress_Planner\Suggested_Tasks\Providers\Integrations\AIOSEO;
9+
10+
/**
11+
* Add tasks for All in One SEO configuration.
12+
*/
13+
class Add_AIOSEO_Providers {
14+
15+
/**
16+
* Providers.
17+
*
18+
* @var (\Progress_Planner\Suggested_Tasks\Providers\Integrations\AIOSEO\AIOSEO_Provider|\Progress_Planner\Suggested_Tasks\Providers\Tasks)[]
19+
*/
20+
protected $providers = [];
21+
22+
/**
23+
* Constructor.
24+
*/
25+
public function __construct() {
26+
if ( \function_exists( 'aioseo' ) ) {
27+
\add_filter( 'progress_planner_suggested_tasks_providers', [ $this, 'add_providers' ], 11, 1 );
28+
}
29+
}
30+
31+
/**
32+
* Add the providers.
33+
*
34+
* @param array $providers The providers.
35+
* @return array
36+
*/
37+
public function add_providers( $providers ) {
38+
$this->providers = [
39+
new Archive_Author(),
40+
new Archive_Date(),
41+
new Media_Pages(),
42+
new Crawl_Settings_Feed_Authors(),
43+
new Crawl_Settings_Feed_Comments(),
44+
new Organization_Logo(),
45+
];
46+
47+
return \array_merge(
48+
$providers,
49+
$this->providers
50+
);
51+
}
52+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
* Abstract class for a task provider.
4+
*
5+
* @package Progress_Planner
6+
*/
7+
8+
namespace Progress_Planner\Suggested_Tasks\Providers\Integrations\AIOSEO;
9+
10+
use Progress_Planner\Suggested_Tasks\Providers\Tasks_Interactive;
11+
12+
/**
13+
* Add tasks for All in One SEO configuration.
14+
*/
15+
abstract class AIOSEO_Interactive_Provider extends Tasks_Interactive {
16+
17+
/**
18+
* Whether the task is an onboarding task.
19+
*
20+
* @var bool
21+
*/
22+
protected const IS_ONBOARDING_TASK = false;
23+
24+
/**
25+
* The task priority.
26+
*
27+
* @var int
28+
*/
29+
protected $priority = self::PRIORITY_NORMAL;
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
* Abstract class for a task provider.
4+
*
5+
* @package Progress_Planner
6+
*/
7+
8+
namespace Progress_Planner\Suggested_Tasks\Providers\Integrations\AIOSEO;
9+
10+
use Progress_Planner\Suggested_Tasks\Providers\Tasks;
11+
12+
/**
13+
* Add tasks for All in One SEO configuration.
14+
*/
15+
abstract class AIOSEO_Provider extends Tasks {
16+
17+
/**
18+
* Whether the task is an onboarding task.
19+
*
20+
* @var bool
21+
*/
22+
protected const IS_ONBOARDING_TASK = false;
23+
24+
/**
25+
* The task priority.
26+
*
27+
* @var int
28+
*/
29+
protected $priority = self::PRIORITY_NORMAL;
30+
}

0 commit comments

Comments
 (0)