Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# .editorconfig
root = true

[*.php]
indent_style = tab
indent_size = 4
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
55 changes: 55 additions & 0 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "GitHub Release"
on:
# push:
# tags:
# - "*"
workflow_dispatch:
jobs:
release:
name: "Release"
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Verify tag is on main branch
run: |
# Fetch the latest main branch from origin
git fetch origin main

# Check if the current commit (${{ github.sha }}) is part of the origin/main history
if git merge-base --is-ancestor ${{ github.sha }} origin/main; then
echo "Success: Tag is on the main branch."
else
echo "Error: Tag was not pushed to the main branch. Skipping release."
exit 1
fi

- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Build the project
run: bun install && bun run build

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer
coverage: none

- name: Install production Composer dependencies
run: composer install --no-dev --optimize-autoloader --no-interaction --prefer-dist --no-progress

- name: Create plugin zip
run: bunx bestzip build/cooked.zip cooked.php LICENSE readme.txt wpml-config.xml assets/ includes/ languages/ templates/ vendor/

- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: build/cooked.zip
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PHP Lint

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.5, 8.4, 8.3, 8.2]

name: PHP ${{ matrix.php }}

steps:
- name: Check out code
uses: actions/checkout@v6

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer

- name: Lint PHP
run: php -l includes/ templates/ tests/
34 changes: 34 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PHPCS

on:
# push:
# branches: [ main, develop ]
# pull_request:
# branches: [ main, develop ]
workflow_dispatch:

jobs:
phpcs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.5, 8.4, 8.3, 8.2]

name: PHP ${{ matrix.php }}

steps:
- name: Check out code
uses: actions/checkout@v6

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer

- name: Install dependencies
run: composer install --no-interaction --no-progress

- name: Run PHPCS
run: vendor/bin/phpcs --standard=phpcs.xml .
34 changes: 34 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PHPUnit Tests

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:

jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.5, 8.4, 8.3]

name: PHP ${{ matrix.php }}

steps:
- name: Check out code
uses: actions/checkout@v6

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer

- name: Install dependencies
run: composer install --no-interaction --no-progress

- name: Run PHPUnit
run: ./vendor/bin/phpunit
54 changes: 54 additions & 0 deletions .github/workflows/wp-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "Wordpress.org Release"
on:
# push:
# tags:
# - "*"
workflow_dispatch:
jobs:
tag:
name: "build"
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Verify tag is on main branch
run: |
git fetch origin main
if git merge-base --is-ancestor ${{ github.sha }} origin/main; then
echo "Success: Tag is on the main branch."
else
echo "Error: Tag was not pushed to the main branch. Skipping release."
exit 1
fi

- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Build the project
run: bun install && bun run build

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer
coverage: none

- name: Install production Composer dependencies
run: composer install --no-dev --optimize-autoloader --no-interaction --prefer-dist --no-progress

- name: Install SVN
run: sudo apt-get update && sudo apt-get install -y subversion

- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: "cooked"
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@

# DDEV
.ddev/
.ddev/docker-compose.cooked.yaml

# Node.js
# Dev dependencies
node_modules/
vendor

# Tests
tests/test-results/
tests/playwright-report/
tests/blob-report/
tests/playwright/.cache/
tests/.auth/
tests/phpunit/.cache

# Build
build/*

# DDEV generated files
.ddev/docker-compose.cooked.yaml

# WordPress
wordpress/
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"core": null,
"phpVersion": "7.4",
"phpVersion": "8.2",
"themes": ["WordPress/twentytwentyfive"],
"plugins": ["."],
"port": 8888,
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cff-version: 1.2.0
message: "If you use cooked, please cite it using the following metadata"
message: "If you use Cooked, please cite it using the following metadata"
title: cooked
authors:
- family-names: Scheetz
Expand Down
Empty file removed build/.gitkeep
Empty file.
26 changes: 17 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@
"homepage": "https://wordpress.org/plugins/cooked/",
"version": "1.14.0",
"type": "wordpress-plugin",
"license": "GPL-3.0-or-later",
"prefer-stable": true,
"minimum-stability": "dev",
"config": {
"optimize-autoloader": true
},
"authors": [
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Gora Tech",
"email": "contact@goratech.dev",
Expand All @@ -33,12 +28,25 @@
"source": "https://github.com/XjSv/Cooked",
"security": "https://github.com/XjSv/Cooked?tab=security-ov-file"
},
"optimize-autoloader": true,
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.4.0",
"nxp/math-executor": "^2.3"
},
"require-dev": {
"php": "^7 || ^8"
"phpunit/phpunit": "^12.5",
"squizlabs/php_codesniffer": "^3.13",
"wp-coding-standards/wpcs": "^3.3",
"phpcompatibility/php-compatibility": "^10.0@alpha",
"phpcompatibility/phpcompatibility-wp": "^3.0@alpha"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
},
"platform": {
"php": "7.4"
}
}
}
Loading