Skip to content

Commit 3f211a7

Browse files
authored
Merge pull request #280 from ProgressPlanner/develop
v1.1.1
2 parents 4b4e0a4 + 7a79386 commit 3f211a7

149 files changed

Lines changed: 8784 additions & 4300 deletions

File tree

Some content is hidden

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

.distignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/vendor
77
.distignore
88
.editorconfig
9+
.eslintrc.js
10+
.env.example
911
.gitignore
1012
.gitattributes
1113
composer.json

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# WordPress URL (without trailing slash)
2+
WP_URL=http://localhost:8080
3+
4+
# WordPress admin credentials
5+
WP_USER=admin
6+
WP_PASS=password
7+
WP_EMAIL=admin@wordpress.test

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
extends: [
3+
'plugin:@wordpress/eslint-plugin/recommended',
4+
'plugin:eslint-comments/recommended',
5+
],
6+
parserOptions: {
7+
ecmaVersion: "latest",
8+
},
9+
rules: {
10+
"no-console": "off",
11+
},
12+
};

.github/workflows/cs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
# @link https://github.com/staabm/annotate-pull-request-from-checkstyle/
6262
- name: Check PHP code style
6363
id: phpcs
64-
run: composer check-cs -- --no-cache --warning-severity=6 --report-full --report-checkstyle=./phpcs-report.xml
64+
run: composer check-cs -- --no-cache --report-full --report-checkstyle=./phpcs-report.xml
6565

6666
- name: Show PHPCS results in PR
6767
if: ${{ always() && steps.phpcs.outcome == 'failure' }}

.github/workflows/playwright.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Progress Planner Playwright 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 # So it can run locally (hopefully).
13+
PRPL_TEST_TOKEN: 0220a2de67fc29094281088395939f58
14+
15+
on:
16+
push:
17+
branches:
18+
- develop
19+
pull_request:
20+
21+
jobs:
22+
e2e-tests:
23+
runs-on: ubuntu-latest
24+
25+
services:
26+
mysql:
27+
image: mariadb:10.6
28+
env:
29+
MYSQL_ROOT_PASSWORD: root
30+
MYSQL_DATABASE: ${{ env.WORDPRESS_DB_NAME }}
31+
MYSQL_USER: ${{ env.WORDPRESS_DB_USER }}
32+
MYSQL_PASSWORD: ${{ env.WORDPRESS_DB_PASSWORD }}
33+
ports:
34+
- 3307:3306 # GitHub Actions doesn't support environment variables in the ports section.
35+
wordpress:
36+
image: wordpress:latest
37+
env:
38+
WORDPRESS_DB_HOST: mysql
39+
WORDPRESS_DB_USER: ${{ env.WORDPRESS_DB_USER }}
40+
WORDPRESS_DB_PASSWORD: ${{ env.WORDPRESS_DB_PASSWORD }}
41+
WORDPRESS_DB_NAME: ${{ env.WORDPRESS_DB_NAME }}
42+
WORDPRESS_DB_PORT: ${{ env.WORDPRESS_DB_PORT }}
43+
WORDPRESS_TABLE_PREFIX: ${{ env.WORDPRESS_TABLE_PREFIX }}
44+
WORDPRESS_DEBUG: 1
45+
WORDPRESS_URL: ${{ env.WORDPRESS_URL }}
46+
WORDPRESS_ADMIN_USER: ${{ env.WORDPRESS_ADMIN_USER }}
47+
WORDPRESS_ADMIN_PASSWORD: ${{ env.WORDPRESS_ADMIN_PASSWORD }}
48+
WORDPRESS_ADMIN_EMAIL: ${{ env.WORDPRESS_ADMIN_EMAIL }}
49+
PRPL_TEST_TOKEN: ${{ env.PRPL_TEST_TOKEN }}
50+
ports:
51+
- 8080:80
52+
options: >-
53+
--health-cmd="curl --silent --fail http://localhost:8080/wp-login.php || exit 0"
54+
--health-interval=10s
55+
--health-timeout=5s
56+
--health-retries=5
57+
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v3
61+
62+
- name: Install Node.js & Playwright
63+
uses: actions/setup-node@v3
64+
with:
65+
node-version: 18
66+
- run: npm install -D @playwright/test
67+
- run: npx playwright install --with-deps
68+
69+
- name: Complete WordPress installation
70+
run: |
71+
echo "Installing WordPress at: $WORDPRESS_URL"
72+
curl --silent -X POST "$WORDPRESS_URL/wp-admin/install.php?step=2" \
73+
-d "weblog_title=My%20WordPress%20Site" \
74+
-d "user_name=$WORDPRESS_ADMIN_USER" \
75+
-d "admin_password=$WORDPRESS_ADMIN_PASSWORD" \
76+
-d "admin_password2=$WORDPRESS_ADMIN_PASSWORD" \
77+
-d "admin_email=$WORDPRESS_ADMIN_EMAIL" \
78+
-d "public=1"r
79+
80+
# - name: Install necessary dependencies in WordPress container
81+
# run: |
82+
# docker exec $(docker ps -qf "name=wordpress") apt-get update
83+
# docker exec $(docker ps -qf "name=wordpress") apt-get install -y \
84+
# php php-cli php-mysql php-curl php-xml php-mbstring php-zip curl \
85+
# libnss3 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev libwoff1
86+
87+
- name: Install and activate plugin
88+
run: |
89+
# Install WP-CLI
90+
docker exec $(docker ps -qf "name=wordpress") curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
91+
docker exec $(docker ps -qf "name=wordpress") chmod +x wp-cli.phar
92+
docker exec $(docker ps -qf "name=wordpress") mv wp-cli.phar /usr/local/bin/wp
93+
94+
# Create the plugins directory in the WordPress container
95+
docker exec $(docker ps -qf "name=wordpress") mkdir -p /var/www/html/wp-content/plugins
96+
97+
# Copy plugin files to WordPress plugins directory
98+
docker cp . $(docker ps -qf "name=wordpress"):/var/www/html/wp-content/plugins/progress-planner
99+
100+
# Activate the plugin using WP-CLI
101+
docker exec $(docker ps -qf "name=wordpress") wp plugin activate progress-planner --allow-root
102+
103+
# Enable debug mode
104+
docker exec $(docker ps -qf "name=wordpress") wp option update prpl_debug true --allow-root
105+
106+
# Insert test token
107+
docker exec $(docker ps -qf "name=wordpress") wp option update progress_planner_test_token $PRPL_TEST_TOKEN --allow-root
108+
109+
# - name: Wait for WordPress to be ready
110+
# run: |
111+
# echo "Waiting for WordPress to be ready..."
112+
# sleep 30 # Adjust if necessary based on the container startup time
113+
114+
- name: Run Playwright Tests
115+
run: npx playwright test tests/e2e/
116+
117+
- name: Upload Playwright Report
118+
if: always()
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: playwright-report
122+
path: playwright-report/
123+
124+
- name: Upload Playwright screenshots as artifacts
125+
if: failure()
126+
uses: actions/upload-artifact@v4
127+
with:
128+
name: playwright-screenshots
129+
path: |
130+
onboarding-failed.png # Specify the path of the screenshot you want to upload

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,12 @@
33
.phpunit.result.cache
44
node_modules
55
.DS_Store
6+
7+
# Playwright
8+
test-results/
9+
playwright-report/
10+
playwright/.cache/
11+
auth.json
12+
13+
# Environment variables
14+
.env

CHANGELOG.md

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,60 @@
1-
= 1.0.5 =
1+
= 1.1.1 =
2+
3+
Bugs we fixed:
4+
5+
* Fixed unnecessary display of the upgrade popover.
6+
* Fixed saving license key from 'Subscribe to weekly' emails popover.
7+
* Reduced number of database queries when checking for user activity scores.
8+
* Fixed database queries when getting activities by type.
9+
10+
Enhancements:
11+
12+
* Simplified the Dashboard widget.
13+
* Styling improvements.
14+
* Improved some translation strings.
15+
* Improved suggestions for writing new posts.
16+
* UI improvements in the plugin settings page.
17+
* TODO tasks can now award 1 point per week, counting toward the monthly badges.
218

319
Under the hood:
420

5-
* Improved suggested tasks completion conditions.
6-
* Improved checks for suggested 'review post' tasks.
21+
* Completely refactored the TODOs system.
22+
* Refactored the suggested-tasks system.
23+
* Refactored our AJAX calls.
24+
* Performance & caching improvements.
25+
* Refactored popovers implementation.
26+
* Added implementation to migrate plugin data on updates.
27+
* Improved debugging suite.
28+
* Added new hooks for integration with 3rd-party plugins.
29+
* Added a data collector system for tasks providers.
30+
* Refactored the way tasks are saved in the database for consistency.
31+
* Improved `one_time` and `repetitive` task type abstractions.
32+
* Refactored the celebrations system.
733

8-
We've added the following Recommendations from Ravi:
34+
= 1.1.0 =
35+
36+
In this release, we've added more recommendations from Ravi on how to improve your site. We've also made these recommendations more visible on your WordPress
37+
settings pages, by showing on settings pages exactly which things we think you should change. Also, if you're just now starting to use Progress Planner,
38+
we've made the onboarding experience a lot more fun: we show you immediately which of Ravi's recommended tasks you've already completed and we give
39+
you points for those!
40+
41+
Added these recommendations from Ravi:
42+
43+
* Properly set your [permalink structure](https://progressplanner.com/recommendations/change-default-permalink-structure/).
44+
* Fix it if your site is [set to not be shown in search engines](https://progressplanner.com/recommendations/blog-indexing-settings/).
45+
* Rename and change the slug of your [Uncategorized category](https://progressplanner.com/recommendations/rename-uncategorized-category/).
46+
* Remove [inactive plugins](https://progressplanner.com/recommendations/remove-inactive-plugins/).
47+
* [Upgrade your PHP version](https://progressplanner.com/recommendations/update-php-version/) if needed.
48+
* [Fully disable comments](https://progressplanner.com/recommendations/disable-comments/) if they're not needed on your site.
49+
50+
Bugs we fixed:
51+
52+
* If you had `WP_DEBUG` set to false, the plugin would still tell you to disable `WP_DEBUG_DISPLAY`. We think Ravi was a bit overzealous in his recommendation, so we've fixed that.
53+
54+
Under the hood:
955

10-
* [Setting the permalink structure](TBD).
11-
* [Update PHP version](TBD).
12-
* [Disable comments on your site](TBD).
13-
* [Remove inactive plugins](TBD).
14-
* [Search engine visibility](TBD).
56+
* We've added our set of debug tools straight into the plugin. If you define `PRPL_DEBUG` as `true` in your `wp-config.php` file, you'll get a PRPL Debug admin bar menu item.
57+
* Improved suggested tasks completion conditions so they don't trigger at the wrong moment.
1558

1659
= 1.0.4 =
1760

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
[![PHPStan](https://github.com/ProgressPlanner/progress-planner/actions/workflows/phpstan.yml/badge.svg)](https://github.com/ProgressPlanner/progress-planner/actions/workflows/phpstan.yml)
44
[![Lint](https://github.com/ProgressPlanner/progress-planner/actions/workflows/lint.yml/badge.svg)](https://github.com/ProgressPlanner/progress-planner/actions/workflows/lint.yml)
55

6+
[![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/progress-planner.svg)](https://wordpress.org/plugins/progress-planner/)
7+
![WordPress Plugin: Tested WP Version](https://img.shields.io/wordpress/plugin/tested/progress-planner.svg)
8+
[![WordPress Plugin Active Installs](https://img.shields.io/wordpress/plugin/installs/progress-planner.svg)](https://wordpress.org/plugins/progress-planner/advanced/)
9+
[![WordPress Plugin Downloads](https://img.shields.io/wordpress/plugin/dt/progress-planner.svg)](https://wordpress.org/plugins/progress-planner/advanced/)
10+
[![WordPress Plugin Rating](https://img.shields.io/wordpress/plugin/stars/progress-planner.svg)](https://wordpress.org/support/plugin/progress-planner/reviews/)
11+
[![GitHub](https://img.shields.io/github/license/ProgressPlanner/progress-planner.svg)](https://github.com/ProgressPlanner/progress-planner/blob/main/LICENSE)
12+
613
[![Try Progress Planner on the WordPress playground](https://img.shields.io/badge/Try%20Progress%20Planner%20on%20the%20WordPress%20Playground-%23117AC9.svg?style=for-the-badge&logo=WordPress&logoColor=ddd)](https://playground.wordpress.net/#{"landingPage":"/wp-admin/admin.php?page=progress-planner","features":{"networking":true},"login":true,"plugins":["https://github-proxy.com/proxy/?repo=ProgressPlanner/progress-planner"],"steps":[{"step":"defineWpConfigConsts","consts":{"IS_PLAYGROUND_PREVIEW":true}}]})
714

815
# Progress Planner

assets/css/admin.css

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979
}
8080

8181
.prpl-wrap h2 + p {
82-
margin-top: 0.5em;
82+
margin-top: 0.75rem;
83+
margin-bottom: 0.75rem;
8384
}
8485

8586
.prpl-wrap h1,
@@ -144,6 +145,11 @@
144145
display: none !important;
145146
}
146147

148+
.prpl-disabled {
149+
opacity: 0.5;
150+
pointer-events: none;
151+
}
152+
147153
/*------------------------------------*\
148154
Info buttons.
149155
\*------------------------------------*/
@@ -285,7 +291,8 @@ button.prpl-info-icon {
285291
.prpl-wrap button.prpl-button-primary,
286292
.prpl-wrap button.prpl-button-secondary,
287293
.prpl-wrap a.prpl-button-primary,
288-
.prpl-wrap a.prpl-button-secondary {
294+
.prpl-wrap a.prpl-button-secondary,
295+
#progress_planner_dashboard_widget_score a.prpl-button-primary { /* To be used in WP Dashboard widget */
289296
display: block;
290297
margin: 1rem 0;
291298
padding: 0.75rem 1.25rem;
@@ -460,63 +467,3 @@ button.prpl-info-icon {
460467
}
461468
}
462469

463-
464-
/*------------------------------------*\
465-
Tooltip.
466-
\*------------------------------------*/
467-
.tooltip-actions {
468-
justify-content: flex-end;
469-
gap: 0.5em;
470-
display: flex;
471-
position: relative;
472-
}
473-
474-
.prpl-tooltip {
475-
position: absolute;
476-
bottom: 0;
477-
left: 100%;
478-
transform: translate(-100%, calc(100% + 10px));
479-
480-
padding: 0.75rem 1.5rem 0.75rem 0.75rem;
481-
width: 150px;
482-
background: var(--prpl-background-green);
483-
border-radius: var(--prpl-border-radius);
484-
z-index: 2; /* above the gauges */
485-
visibility: hidden; /* hidden by default */
486-
487-
font-size: 1rem;
488-
font-weight: 400;
489-
color: var(--prpl-color-text);
490-
491-
&[data-tooltip-visible] {
492-
visibility: visible;
493-
}
494-
495-
.close,
496-
.prpl-tooltip-close {
497-
position: absolute;
498-
top: 0.75rem;
499-
right: 0;
500-
padding: 0.1rem;
501-
line-height: 0;
502-
margin: 0;
503-
background: none;
504-
border: none;
505-
cursor: pointer;
506-
}
507-
508-
/* Arrow */
509-
&::after {
510-
content: "";
511-
position: absolute;
512-
top: 0;
513-
right: 0;
514-
transform: translate(-10px, -10px) rotate(90deg);
515-
516-
width: 0;
517-
height: 0;
518-
border-style: solid;
519-
border-width: 7.5px 10px 7.5px 0;
520-
border-color: transparent var(--prpl-background-green) transparent transparent;
521-
}
522-
}

assets/css/dashboard-widgets/score.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/* stylelint-disable max-line-length */
2+
3+
/**
4+
* Admin widget.
5+
*
6+
* Dependencies: progress-planner/web-components/prpl-suggested-task, progress-planner/web-components/prpl-badge
7+
*/
18
#progress_planner_dashboard_widget_score {
29

310
.prpl-dashboard-widget {
@@ -42,7 +49,12 @@
4249
border-top: 1px solid #c3c4c7; /* same color as the one WP-Core uses */
4350
font-size: var(--prpl-font-size-base);
4451
display: flex;
45-
gap: 0.5rem;
52+
gap: 1rem;
4653
align-items: center;
54+
55+
.prpl-button-primary {
56+
display: inline-block;
57+
margin: 0.5rem 0 0 0;
58+
}
4759
}
4860
}

0 commit comments

Comments
 (0)