Skip to content

Commit 4cb50df

Browse files
committed
Merge branch 'master' into tweak/lint-security
2 parents 144398d + 1cded0e commit 4cb50df

13 files changed

Lines changed: 428 additions & 9 deletions

.build-rsync-exclude

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ package.json
2020
package-lock.json
2121
Gruntfile.js
2222
README.md
23+
scripts/
2324
aryo-activity-log/
2425
aryo-activity-log.*.zip

.github/workflows/php-coding-standards.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
push:
55
pull_request:
66
workflow_dispatch:
7+
workflow_call:
78

89
concurrency:
910
cancel-in-progress: true
10-
group: ${{ github.workflow }}-${{ github.ref }}
11+
group: phpcs-${{ github.ref }}
1112

1213
permissions:
1314
contents: read

.github/workflows/phpunit.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ name: PHPUnit Tests
33
on:
44
push:
55
pull_request:
6+
workflow_call:
67

78
concurrency:
89
cancel-in-progress: true
9-
group: ${{ github.workflow }}-${{ github.ref }}
10+
group: phpunit-${{ github.ref }}
1011

1112
permissions:
1213
contents: read
@@ -45,7 +46,7 @@ jobs:
4546
fail-fast: true
4647

4748
- name: Install Composer dependencies
48-
uses: ramsey/composer-install@v2
49+
uses: ramsey/composer-install@v3
4950
with:
5051
dependency-versions: locked
5152

.github/workflows/release.yml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump:
7+
description: Version bump
8+
required: true
9+
type: choice
10+
options: [patch, minor, major]
11+
dry_run:
12+
description: Dry run (no git push, no WP.org commit)
13+
required: false
14+
type: boolean
15+
default: false
16+
17+
concurrency:
18+
group: wordpress-org-release
19+
cancel-in-progress: false
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
phpcs:
26+
if: >-
27+
github.ref == 'refs/heads/master'
28+
&& ( github.actor == 'KingYes' || github.actor == 'bainternet' || github.actor == 'arielk' )
29+
&& startsWith( github.repository, 'elementor/' )
30+
uses: ./.github/workflows/php-coding-standards.yml
31+
32+
phpunit:
33+
if: >-
34+
github.ref == 'refs/heads/master'
35+
&& ( github.actor == 'KingYes' || github.actor == 'bainternet' || github.actor == 'arielk' )
36+
&& startsWith( github.repository, 'elementor/' )
37+
uses: ./.github/workflows/phpunit.yml
38+
39+
release:
40+
needs: [phpcs, phpunit]
41+
runs-on: ubuntu-latest
42+
permissions:
43+
contents: write
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
52+
with:
53+
php-version: '7.4'
54+
tools: composer:v2
55+
56+
- uses: actions/cache@v4
57+
with:
58+
path: vendor
59+
key: composer-${{ hashFiles('composer.json') }}
60+
restore-keys: |
61+
composer-
62+
63+
- name: Install Composer dependencies
64+
run: composer install --prefer-dist --no-progress
65+
66+
- name: Lint
67+
run: composer lint
68+
69+
- uses: actions/setup-node@v4
70+
with:
71+
node-version: '20'
72+
73+
- name: Install npm dependencies
74+
run: npm install
75+
76+
- name: Compute next version
77+
run: |
78+
VERSION=$(node scripts/next-version.js ${{ inputs.bump }})
79+
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
80+
echo "TAG=v$VERSION" >> "$GITHUB_ENV"
81+
echo "Next version: $VERSION"
82+
83+
- name: Validate readme changelog
84+
run: node scripts/validate-readme-changelog.js "${{ env.VERSION }}"
85+
86+
- name: Configure git
87+
run: |
88+
git config user.name "github-actions[bot]"
89+
git config user.email "github-actions[bot]@users.noreply.github.com"
90+
91+
- name: Bump version
92+
run: npm version ${{ inputs.bump }} --no-git-tag-version
93+
94+
- name: Sync version to plugin files
95+
run: npm run version:sync
96+
97+
- name: Build plugin directory
98+
run: npm run package
99+
100+
- name: Validate build
101+
env:
102+
PLUGIN_SLUG: aryo-activity-log
103+
PLUGIN_VERSION: ${{ env.VERSION }}
104+
run: bash scripts/validate-build-files.sh
105+
106+
- name: Create zip
107+
run: |
108+
zip -r aryo-activity-log.${{ env.VERSION }}.zip ./aryo-activity-log/*
109+
110+
- name: Commit version bump
111+
if: ${{ inputs.dry_run != true }}
112+
run: |
113+
git add package.json package-lock.json aryo-activity-log.php readme.txt
114+
git commit -m "Internal: Release ${{ env.VERSION }}"
115+
116+
- name: Create tag
117+
if: ${{ inputs.dry_run != true }}
118+
run: git tag "${{ env.TAG }}"
119+
120+
- name: Extract changelog from readme
121+
id: changelog
122+
run: |
123+
node scripts/extract-changelog-section.js "${{ env.VERSION }}" > /tmp/changelog_section.txt
124+
125+
{
126+
echo "body<<EOF"
127+
echo "## Changelog"
128+
echo ""
129+
cat /tmp/changelog_section.txt
130+
echo ""
131+
echo "EOF"
132+
} >> "$GITHUB_OUTPUT"
133+
134+
- name: Push commit and tag
135+
if: ${{ inputs.dry_run != true }}
136+
run: |
137+
git push origin master
138+
git push origin "${{ env.TAG }}"
139+
140+
- name: Create GitHub Release
141+
if: ${{ inputs.dry_run != true }}
142+
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
143+
with:
144+
tag_name: ${{ env.TAG }}
145+
name: ${{ env.TAG }}
146+
body: ${{ steps.changelog.outputs.body }}
147+
files: aryo-activity-log.${{ env.VERSION }}.zip
148+
149+
- name: Deploy to WordPress.org
150+
if: ${{ inputs.dry_run != true }}
151+
uses: 10up/action-wordpress-plugin-deploy@54bd289b8525fd23a5c365ec369185f2966529c2 # stable
152+
env:
153+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
154+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
155+
SLUG: aryo-activity-log
156+
VERSION: ${{ env.VERSION }}
157+
BUILD_DIR: aryo-activity-log
158+
159+
- name: Deploy to WordPress.org (dry run)
160+
if: ${{ inputs.dry_run == true }}
161+
uses: 10up/action-wordpress-plugin-deploy@54bd289b8525fd23a5c365ec369185f2966529c2 # stable
162+
with:
163+
dry-run: true
164+
env:
165+
SLUG: aryo-activity-log
166+
VERSION: ${{ env.VERSION }}
167+
BUILD_DIR: aryo-activity-log
168+
169+
- name: Summary
170+
run: |
171+
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
172+
echo "::notice::Dry run complete for v${{ env.VERSION }}. No commits, tags, or WP.org deploys were made."
173+
else
174+
echo "::notice::Released v${{ env.VERSION }} to GitHub and WordPress.org."
175+
fi

aryo-activity-log.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Description: This top rated Activity Log plugin helps you monitor & log all changes and actions on your WordPress site, so you can remain secure and organized.
66
Author: Activity Log Team
77
Author URI: https://activitylog.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
8-
Version: 2.12.0
8+
Version: 2.12.1
99
Text Domain: aryo-activity-log
1010
License: GPLv2 or later
1111

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
"slug": "aryo-activity-log",
44
"homepage": "http://pojo.me/",
55
"description": "Activity Log",
6-
"version": "2.12.0",
6+
"version": "2.12.1",
77
"scripts": {
88
"clean": "rimraf $npm_package_name $npm_package_name.*.zip",
99
"package": "npm run clean && rsync -av --exclude-from=.build-rsync-exclude . $npm_package_name",
10-
"package:zip": "npm run package && zip -r $npm_package_name.$npm_package_version.zip ./$npm_package_name/*"
10+
"package:zip": "npm run package && zip -r $npm_package_name.$npm_package_version.zip ./$npm_package_name/*",
11+
"version:next": "node scripts/next-version.js",
12+
"version:sync": "node scripts/sync-version.js",
13+
"version:validate-changelog": "node scripts/validate-readme-changelog.js"
1114
},
1215
"devDependencies": {
1316
"rimraf": "^6.0.0"

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: Activity Log, User Log, Audit Log, Security, Email Log,
44
Requires at least: 6.0
55
Requires PHP: 7.4
66
Tested up to: 7.1
7-
Stable tag: 2.12.0
7+
Stable tag: 2.12.1
88
License: GPLv2 or later
99

1010
Monitor every change on your WordPress site — who did what, when, and where it came from — for a complete audit trail and stronger security.
@@ -143,6 +143,10 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
143143

144144
== Changelog ==
145145

146+
= 2.12.1 - 2026-08-20 =
147+
* Tweak: Removed text domain loading method in favor of WordPress standard loading
148+
* Fix: Re-release for WordPress.org after a failed deploy
149+
146150
= 2.12.0 - 2026-08-19 =
147151
* New: Request Source Tracking - See where each change came from (REST API, WP-CLI, WP-Cron, XML-RPC, WP Abilities, Application Passwords)
148152
* New: Added metadata storage for extensible log context
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
'use strict';
2+
3+
const fs = require( 'fs' );
4+
const path = require( 'path' );
5+
6+
const root = path.resolve( __dirname, '..' );
7+
const version = process.argv[ 2 ] || require( path.join( root, 'package.json' ) ).version;
8+
const readme = fs.readFileSync( path.join( root, 'readme.txt' ), 'utf8' );
9+
10+
const changelogMarker = '== Changelog ==';
11+
const changelogIndex = readme.indexOf( changelogMarker );
12+
13+
if ( changelogIndex === -1 ) {
14+
console.error( 'readme.txt is missing "== Changelog ==" section.' );
15+
process.exit( 1 );
16+
}
17+
18+
const changelogBody = readme.slice( changelogIndex + changelogMarker.length );
19+
20+
const sectionRegex = new RegExp(
21+
`= ${ version.replace( /\./g, '\\.' ) }(\\s+-\\s+\\d{4}-\\d{2}-\\d{2})?\\s*=`
22+
);
23+
24+
const headerMatch = changelogBody.match( sectionRegex );
25+
26+
if ( ! headerMatch ) {
27+
console.error( `Changelog section for version ${ version } not found.` );
28+
process.exit( 1 );
29+
}
30+
31+
const headerIndex = changelogBody.indexOf( headerMatch[ 0 ] );
32+
const afterHeader = changelogBody.slice( headerIndex + headerMatch[ 0 ].length );
33+
const nextSectionMatch = afterHeader.match( /\n= \d+\.\d+\.\d+/ );
34+
const sectionContent = nextSectionMatch
35+
? afterHeader.slice( 0, nextSectionMatch.index )
36+
: afterHeader;
37+
38+
const lines = sectionContent
39+
.trim()
40+
.split( '\n' )
41+
.map( ( l ) => l.trim() )
42+
.filter( Boolean );
43+
44+
console.log( lines.join( '\n' ) );

scripts/next-version.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
3+
const path = require( 'path' );
4+
5+
const bump = process.argv[ 2 ];
6+
7+
if ( ! [ 'patch', 'minor', 'major' ].includes( bump ) ) {
8+
console.error( 'Usage: node next-version.js <patch|minor|major>' );
9+
process.exit( 1 );
10+
}
11+
12+
const { version } = require( path.resolve( __dirname, '..', 'package.json' ) );
13+
const parts = version.split( '.' ).map( Number );
14+
15+
switch ( bump ) {
16+
case 'major':
17+
parts[ 0 ]++;
18+
parts[ 1 ] = 0;
19+
parts[ 2 ] = 0;
20+
break;
21+
case 'minor':
22+
parts[ 1 ]++;
23+
parts[ 2 ] = 0;
24+
break;
25+
case 'patch':
26+
parts[ 2 ]++;
27+
break;
28+
}
29+
30+
console.log( parts.join( '.' ) );

0 commit comments

Comments
 (0)