diff --git a/.github/workflows/deploy-svn.yml b/.github/workflows/deploy-svn.yml index 175fb1d..871eff9 100644 --- a/.github/workflows/deploy-svn.yml +++ b/.github/workflows/deploy-svn.yml @@ -1,56 +1,24 @@ -name: Deploy to WordPress.org SVN +name: Deploy to WordPress.org on: release: - types: [published] + types: + - published workflow_dispatch: - inputs: - version: - description: 'Version tag (e.g. 1.2.0)' - required: true jobs: deploy: name: Deploy to WordPress.org SVN runs-on: ubuntu-latest + steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v4 - with: - ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref_name }} - fetch-depth: 0 - - - name: Install SVN - run: sudo apt-get update && sudo apt-get install -y subversion - - name: Deploy to WordPress.org SVN + - name: Deploy plugin to WordPress.org + uses: 10up/action-wordpress-plugin-deploy@stable env: SVN_USERNAME: ${{ secrets.SVN_USERNAME }} SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} SLUG: ct-optimization - VERSION: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.version }} - run: | - set -euo pipefail - - SVN_URL="https://plugins.svn.wordpress.org/${SLUG}/" - - if svn ls "${SVN_URL}tags/${VERSION}" >/dev/null 2>&1; then - echo "Version ${VERSION} already exists in SVN; skipping deploy." - exit 0 - fi - - TMP_DIR="$(mktemp -d)" - echo "Preparing clean release tree in ${TMP_DIR}" - rsync -rc --delete --delete-excluded \ - --exclude '.git' \ - --exclude '.github' \ - --exclude '.gitignore' \ - --exclude '.editorconfig' \ - --exclude '.DS_Store' \ - "$GITHUB_WORKSPACE/" "$TMP_DIR/" - - echo "Importing release to SVN tag ${VERSION}" - svn import "$TMP_DIR" "${SVN_URL}tags/${VERSION}" \ - -m "Release version ${VERSION} from GitHub" \ - --no-auth-cache --non-interactive \ - --username "$SVN_USERNAME" --password "$SVN_PASSWORD" + ASSETS_DIR: .wordpress-org diff --git a/.gitignore b/.gitignore index dc38817..3eff346 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,17 @@ -languages/*.*~ \ No newline at end of file +# Composer dependencies +/vendor/ + +# Node.js dependencies +/node_modules/ + +# macOS metadata +.DS_Store + +# PHP logs and debug output +*.log + +# PHPUnit result cache +.phpunit.result.cache + +# Language backup files +languages/*.*~ diff --git a/.wordpress-org/banner-1544x500.png b/.wordpress-org/banner-1544x500.png new file mode 100644 index 0000000..931a3c7 Binary files /dev/null and b/.wordpress-org/banner-1544x500.png differ diff --git a/.wordpress-org/banner-772x250.png b/.wordpress-org/banner-772x250.png new file mode 100644 index 0000000..4d29ccc Binary files /dev/null and b/.wordpress-org/banner-772x250.png differ diff --git a/.wordpress-org/icon-128x128.png b/.wordpress-org/icon-128x128.png new file mode 100644 index 0000000..cb766fc Binary files /dev/null and b/.wordpress-org/icon-128x128.png differ diff --git a/.wordpress-org/icon-256x256.png b/.wordpress-org/icon-256x256.png new file mode 100644 index 0000000..29ae84d Binary files /dev/null and b/.wordpress-org/icon-256x256.png differ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..164b1ec --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,112 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 1.3.0 (2026-06-26) + +### Added + +- Official PHP 8.0–8.4 support, bumped `Requires PHP` to 8.0 +- `.wordpress-org/` directory for WordPress.org plugin assets (icons, banners) +- Standard WordPress.org SVN deploy workflow using `10up/action-wordpress-plugin-deploy` + +### Fixed + +- Undefined `$attributes` variable warning in admin options page under PHP 8.0 +- `Requires at least` bumped to WordPress 6.0 + +## 1.2.0 + +- PHP 8.2-8.4 compatibility: fix missing property declaration in Gravity Forms class +- Fix manifest option key mismatch (`disable_manifest` → `disable_wlw_manifest`) +- Bump minimum PHP requirement to 7.4 +- Tested up to WordPress 6.8 + +## 1.1.1 + +- Fix PHP 8.1+ deprecation warnings for null/false passed to `strip_tags()` and `strtotime()` +- Fix `parse_url()` return value not checked in `get_domain_from_url()` +- Fix widget existence check in `check_comment_style()` for PHP 8.x + +## 1.1.0 + +- Fix compatible with PHP 8 + +## 1.0.16 + +- Add option to remove duotone and extra CSS style in WP 5.9 + +## 1.0.15 + +- Fix save key for Gravity Forms settings +- Remove Compress HTML feature + +## 1.0.14 + +- Fix load Gravity form assets if disable option. + +## 1.0.13 + +- Disable more Gravity form assets. +- Remove HTML Compress feature. + +## 1.0.12 + +- Add option to disable Gutenberg widget admin UI. + +## 1.0.11 + +- Disable more Gutenberg feature. + +## 1.0.10 + +- Fix warning PHP when calling function inline + +## 1.0.9 + +- Add option to enable/disable lazysizes script. + +## 1.0.8 + +- Update plugin translation. + +## 1.0.7 + +- Add Gravity Form tweak settings, including disable default styles, hide some menus and load Gravity forms script in footer. + +## 1.0.6 + +- Update config key to match process. + +## 1.0.5 + +- Fix iconv convert character. +- Update Vietnamese translation. + +## 1.0.4 + +- Fix enable cdn domain option key. + +## 1.0.3 + +- Fix option keys to match +- Remove option in database if deactivate plugin. +- Add comment for html compress to easy debug. +- Translate update for Vietnamese +- Add more FAQ +- Add notice in case PHP version is lower 7.0 + +## 1.0.2 + +- Fix HTML compress class name. + +## 1.0.1 + +- Add HTML compress feature. + +## 1.0.0 + +- First release diff --git a/README.txt b/README.txt index 1593b2d..61da0f9 100644 --- a/README.txt +++ b/README.txt @@ -2,9 +2,10 @@ Contributors: khoipro, codetot Donate link: https://codetot.com Tags: optimization, compress, settings, codetot -Requires at least: 5.0 +Requires at least: 6.0 Tested up to: 6.8 -Stable tag: 1.2.0 +Stable tag: 1.3.0 +Requires PHP: 8.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -77,6 +78,13 @@ Yes, if you are using our themes. == Changelog == += 1.3.0 = +* Official PHP 8.0-8.4 support, bumped Requires PHP to 8.0 +* Fix undefined variable warning in admin options page under PHP 8.0 +* Bump Requires at least to WordPress 6.0 +* Integrate standard WordPress.org SVN deploy workflow +* Move WP.org assets to .wordpress-org/ directory + = 1.2.0 = * PHP 8.2-8.4 compatibility: fix missing property declaration in Gravity Forms class * Fix manifest option key mismatch (disable_manifest → disable_wlw_manifest) diff --git a/codetot-optimization.php b/codetot-optimization.php index e387c4c..baf654c 100644 --- a/codetot-optimization.php +++ b/codetot-optimization.php @@ -8,9 +8,9 @@ * Plugin Name: CT Optimization * Plugin URI: https://codetot.com * Description: Provides settings for enable/disable WordPress core features and some tweaks for ACF, Gravity Forms, such like Enable CDN, Lazyload assets. - * Version: 1.2.0 - * Requires at least: 5.0 - * Requires PHP: 7.4 + * Version: 1.3.0 + * Requires at least: 6.0 + * Requires PHP: 8.0 * Author: CODE TOT JSC * Author URI: https://codetot.com * License: GPL-2.0+ @@ -24,7 +24,7 @@ die; } -define( 'CODETOT_OPTIMIZATION_VERSION', '1.2.0' ); +define( 'CODETOT_OPTIMIZATION_VERSION', '1.3.0' ); define( 'CODETOT_OPTIMIZATION_PATH', plugin_dir_path(__FILE__) ); define( 'CODETOT_OPTIMIZATION_URL', plugin_dir_url(__FILE__) ); diff --git a/includes/class-codetot-admin-options-page.php b/includes/class-codetot-admin-options-page.php index 426d80d..2c2f3a3 100644 --- a/includes/class-codetot-admin-options-page.php +++ b/includes/class-codetot-admin-options-page.php @@ -384,8 +384,8 @@ protected function build_settings_field($page_key, $section_key, $field_key) } // Additional attributes + $attributes = array(); if (!empty($field['attributes'])) { - $attributes = array(); foreach ($field['attributes'] as $attribute => $value) { if (!empty($value)) { $attributes[] = "{$attribute}='{$value}'";