Skip to content

Commit 1ca7d0b

Browse files
committed
Merge branch 'develop' into filip/v15/extend-yoast-provider
2 parents dfbbc91 + eea366e commit 1ca7d0b

11 files changed

Lines changed: 191 additions & 64 deletions

.github/workflows/playwright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
-d "admin_password=$WORDPRESS_ADMIN_PASSWORD" \
7676
-d "admin_password2=$WORDPRESS_ADMIN_PASSWORD" \
7777
-d "admin_email=$WORDPRESS_ADMIN_EMAIL" \
78-
-d "public=1"r
78+
-d "public=1"
7979
8080
# - name: Install necessary dependencies in WordPress container
8181
# run: |
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Progress Planner Update & Compatibility Tests
2+
3+
env:
4+
WORDPRESS_URL: http://localhost:8080
5+
WORDPRESS_ADMIN_USER: admin
6+
WORDPRESS_ADMIN_PASSWORD: password
7+
WORDPRESS_ADMIN_EMAIL: admin@example.com
8+
WORDPRESS_TABLE_PREFIX: wp_
9+
WORDPRESS_DB_USER: wpuser
10+
WORDPRESS_DB_PASSWORD: wppass
11+
WORDPRESS_DB_NAME: wordpress
12+
WORDPRESS_DB_PORT: 3307
13+
PLUGIN_REPO: ProgressPlanner/progress-planner
14+
15+
on:
16+
push:
17+
branches:
18+
- develop
19+
pull_request:
20+
# Allow manually triggering the workflow.
21+
workflow_dispatch:
22+
23+
jobs:
24+
upgrade-compat:
25+
runs-on: ubuntu-latest
26+
27+
services:
28+
mysql:
29+
image: mariadb:10.6
30+
env:
31+
MYSQL_ROOT_PASSWORD: root
32+
MYSQL_DATABASE: ${{ env.WORDPRESS_DB_NAME }}
33+
MYSQL_USER: ${{ env.WORDPRESS_DB_USER }}
34+
MYSQL_PASSWORD: ${{ env.WORDPRESS_DB_PASSWORD }}
35+
ports:
36+
- 3307:3306
37+
38+
wordpress:
39+
image: wordpress:latest
40+
env:
41+
WORDPRESS_DB_HOST: mysql
42+
WORDPRESS_DB_USER: ${{ env.WORDPRESS_DB_USER }}
43+
WORDPRESS_DB_PASSWORD: ${{ env.WORDPRESS_DB_PASSWORD }}
44+
WORDPRESS_DB_NAME: ${{ env.WORDPRESS_DB_NAME }}
45+
WORDPRESS_DB_PORT: ${{ env.WORDPRESS_DB_PORT }}
46+
WORDPRESS_TABLE_PREFIX: ${{ env.WORDPRESS_TABLE_PREFIX }}
47+
WORDPRESS_DEBUG: 1
48+
WORDPRESS_URL: ${{ env.WORDPRESS_URL }}
49+
WORDPRESS_ADMIN_USER: ${{ env.WORDPRESS_ADMIN_USER }}
50+
WORDPRESS_ADMIN_PASSWORD: ${{ env.WORDPRESS_ADMIN_PASSWORD }}
51+
WORDPRESS_ADMIN_EMAIL: ${{ env.WORDPRESS_ADMIN_EMAIL }}
52+
PRPL_TEST_TOKEN: ${{ env.PRPL_TEST_TOKEN }}
53+
ports:
54+
- 8080:80
55+
options: >-
56+
--health-cmd="curl --silent --fail http://localhost:8080/wp-login.php || exit 0"
57+
--health-interval=10s
58+
--health-timeout=5s
59+
--health-retries=5
60+
61+
steps:
62+
- name: Checkout code
63+
uses: actions/checkout@v3
64+
65+
- name: Install system dependencies (host)
66+
run: |
67+
sudo apt-get update
68+
sudo apt-get install -y git curl unzip
69+
70+
- name: Complete WordPress installation
71+
run: |
72+
echo "Installing WordPress at: $WORDPRESS_URL"
73+
curl --silent -X POST "$WORDPRESS_URL/wp-admin/install.php?step=2" \
74+
-d "weblog_title=My%20WordPress%20Site" \
75+
-d "user_name=$WORDPRESS_ADMIN_USER" \
76+
-d "admin_password=$WORDPRESS_ADMIN_PASSWORD" \
77+
-d "admin_password2=$WORDPRESS_ADMIN_PASSWORD" \
78+
-d "admin_email=$WORDPRESS_ADMIN_EMAIL" \
79+
-d "public=1"
80+
81+
- name: Install and activate plugin
82+
run: |
83+
WP_CONTAINER=$(docker ps -qf "name=wordpress")
84+
PLUGIN_REPO=$PLUGIN_REPO
85+
PLUGIN_OLD_VERSION=$PLUGIN_OLD_VERSION
86+
87+
# Install git inside the WordPress container
88+
docker exec $WP_CONTAINER apt-get update
89+
docker exec $WP_CONTAINER apt-get install -y git
90+
91+
# Install WP-CLI
92+
docker exec $WP_CONTAINER curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
93+
docker exec $WP_CONTAINER chmod +x wp-cli.phar
94+
docker exec $WP_CONTAINER mv wp-cli.phar /usr/local/bin/wp
95+
96+
# Create the plugins directory
97+
docker exec $WP_CONTAINER mkdir -p /var/www/html/wp-content/plugins
98+
99+
# Clone plugin repository (v1.1.0)
100+
docker exec $WP_CONTAINER git clone --branch v1.1.0 https://github.com/$PLUGIN_REPO.git /var/www/html/wp-content/plugins/progress-planner
101+
102+
# Activate plugin using WP-CLI
103+
docker exec $WP_CONTAINER wp plugin activate progress-planner --allow-root
104+
105+
# Show plugin settings (before 1.1.1 there was no version set)
106+
docker exec $WP_CONTAINER wp option get progress_planner_settings --allow-root
107+
108+
# Overwrite plugin files with the latest version from this branch
109+
docker cp . $WP_CONTAINER:/var/www/html/wp-content/plugins/progress-planner
110+
111+
# Show updated plugin settings
112+
docker exec $WP_CONTAINER wp option get progress_planner_settings --allow-root
113+
114+
# Install Yoast SEO
115+
docker exec $WP_CONTAINER wp plugin install wordpress-seo --activate --allow-root
116+
117+
# Install Yoast Comment Experience
118+
docker exec $WP_CONTAINER wp plugin install yoast-comment-hacks --activate --allow-root
119+
120+
# Final plugin version check
121+
docker exec $WP_CONTAINER wp option get progress_planner_version --allow-root
122+
docker exec $WP_CONTAINER wp option get progress_planner_settings --allow-root
123+

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
= 1.4.2 =
2+
3+
Bugs we fixed:
4+
5+
* Fixed snoozing some of Yoast SEO Recommendations.
6+
17
= 1.4.1 =
28

39
Bugs we fixed:

classes/suggested-tasks/providers/class-remove-terms-without-posts.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,21 +245,27 @@ protected function is_specific_task_completed( $task_id ) {
245245
public function get_tasks_to_inject() {
246246

247247
if (
248+
true === $this->is_task_snoozed() ||
248249
! $this->should_add_task() // No need to add the task.
249250
) {
250251
return [];
251252
}
252253

253-
$data = $this->data_collector->collect();
254+
$data = $this->data_collector->collect();
255+
$task_id = $this->get_task_id(
256+
[
257+
'term_id' => $data['term_id'],
258+
'taxonomy' => $data['taxonomy'],
259+
]
260+
);
261+
262+
if ( true === \progress_planner()->get_suggested_tasks()->was_task_completed( $task_id ) ) {
263+
return [];
264+
}
254265

255266
return [
256267
[
257-
'task_id' => $this->get_task_id(
258-
[
259-
'term_id' => $data['term_id'],
260-
'taxonomy' => $data['taxonomy'],
261-
]
262-
),
268+
'task_id' => $task_id,
263269
'provider_id' => $this->get_provider_id(),
264270
'category' => $this->get_provider_category(),
265271
'term_id' => $data['term_id'],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public function get_tasks_to_inject() {
410410
if (
411411
true === $this->is_task_snoozed() ||
412412
! $this->should_add_task() || // No need to add the task.
413-
true === \progress_planner()->get_suggested_tasks()->was_task_completed( $this->get_task_id() )
413+
true === \progress_planner()->get_suggested_tasks()->was_task_completed( $task_id )
414414
) {
415415
return [];
416416
}

classes/suggested-tasks/providers/class-update-term-description.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,21 +238,27 @@ protected function is_specific_task_completed( $task_id ) {
238238
public function get_tasks_to_inject() {
239239

240240
if (
241+
true === $this->is_task_snoozed() ||
241242
! $this->should_add_task() // No need to add the task.
242243
) {
243244
return [];
244245
}
245246

246-
$data = $this->data_collector->collect();
247+
$data = $this->data_collector->collect();
248+
$task_id = $this->get_task_id(
249+
[
250+
'term_id' => $data['term_id'],
251+
'taxonomy' => $data['taxonomy'],
252+
]
253+
);
254+
255+
if ( true === \progress_planner()->get_suggested_tasks()->was_task_completed( $task_id ) ) {
256+
return [];
257+
}
247258

248259
return [
249260
[
250-
'task_id' => $this->get_task_id(
251-
[
252-
'term_id' => $data['term_id'],
253-
'taxonomy' => $data['taxonomy'],
254-
]
255-
),
261+
'task_id' => $task_id,
256262
'provider_id' => $this->get_provider_id(),
257263
'category' => $this->get_provider_category(),
258264
'term_id' => $data['term_id'],

classes/suggested-tasks/providers/integrations/yoast/class-cornerstone-workout.php

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ class Cornerstone_Workout extends Yoast_Provider {
4444
*/
4545
protected $is_dismissable = true;
4646

47+
/**
48+
* Whether the task is repetitive.
49+
*
50+
* @var bool
51+
*/
52+
protected $is_repetitive = true;
4753

4854
/**
4955
* The task points.
@@ -160,26 +166,6 @@ public function should_add_task() {
160166
return true;
161167
}
162168

163-
/**
164-
* Get an array of tasks to inject.
165-
*
166-
* @return array
167-
*/
168-
public function get_tasks_to_inject() {
169-
if ( ! $this->should_add_task() ) {
170-
return [];
171-
}
172-
173-
return [
174-
[
175-
'task_id' => $this->get_task_id(),
176-
'provider_id' => $this->get_provider_id(),
177-
'category' => $this->get_provider_category(),
178-
'date' => \gmdate( 'YW' ),
179-
],
180-
];
181-
}
182-
183169
/**
184170
* Get the task details.
185171
*

classes/suggested-tasks/providers/integrations/yoast/class-fix-orphaned-content.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,27 @@ protected function is_specific_task_completed( $task_id ) {
197197
public function get_tasks_to_inject() {
198198

199199
if (
200+
true === $this->is_task_snoozed() ||
200201
! $this->should_add_task() // No need to add the task.
201202
) {
202203
return [];
203204
}
204205

205-
$data = $this->data_collector->collect();
206+
$data = $this->data_collector->collect();
207+
$task_id = $this->get_task_id(
208+
[
209+
'post_id' => $data['post_id'],
210+
]
211+
);
212+
213+
// When we have data, check if task was completed.
214+
if ( true === \progress_planner()->get_suggested_tasks()->was_task_completed( $task_id ) ) {
215+
return [];
216+
}
206217

207218
return [
208219
[
209-
'task_id' => $this->get_task_id(
210-
[
211-
'post_id' => $data['post_id'],
212-
]
213-
),
220+
'task_id' => $task_id,
214221
'provider_id' => $this->get_provider_id(),
215222
'category' => $this->get_provider_category(),
216223
'post_id' => $data['post_id'],

classes/suggested-tasks/providers/integrations/yoast/class-orphaned-content-workout.php

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ class Orphaned_Content_Workout extends Yoast_Provider {
4444
*/
4545
protected $is_dismissable = true;
4646

47+
/**
48+
* Whether the task is repetitive.
49+
*
50+
* @var bool
51+
*/
52+
protected $is_repetitive = true;
53+
4754
/**
4855
* The task points.
4956
*
@@ -159,26 +166,6 @@ public function should_add_task() {
159166
return true;
160167
}
161168

162-
/**
163-
* Get an array of tasks to inject.
164-
*
165-
* @return array
166-
*/
167-
public function get_tasks_to_inject() {
168-
if ( ! $this->should_add_task() ) {
169-
return [];
170-
}
171-
172-
return [
173-
[
174-
'task_id' => $this->get_task_id(),
175-
'provider_id' => $this->get_provider_id(),
176-
'category' => $this->get_provider_category(),
177-
'date' => \gmdate( 'YW' ),
178-
],
179-
];
180-
}
181-
182169
/**
183170
* Get the task details.
184171
*

progress-planner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Description: A plugin to help you fight procrastination and get things done.
1010
* Requires at least: 6.3
1111
* Requires PHP: 7.4
12-
* Version: 1.4.1
12+
* Version: 1.4.2
1313
* Author: Team Emilia Projects
1414
* Author URI: https://prpl.fyi/about
1515
* License: GPL-3.0+

0 commit comments

Comments
 (0)