Skip to content

Commit

Permalink
Merge pull request #147 from mihdan/6.0.6
Browse files Browse the repository at this point in the history
6.0.6
  • Loading branch information
kagg-design authored Jan 14, 2024
2 parents c86853c + 2991325 commit 12f16e8
Show file tree
Hide file tree
Showing 12 changed files with 3,657 additions and 3,571 deletions.
40 changes: 17 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,56 @@ name: Cyr2Lat CI
on: [ push, pull_request ]

jobs:
run:
runs-on: ${{ matrix.os }}

cs_and_tests:
strategy:
matrix:
os: [ ubuntu-latest ]
php-version: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
php-version: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]

runs-on: ${{ matrix.os }}

name: PHP ${{ matrix.php-version }} on ${{ matrix.os }}

steps:
- name: Checkout
- name: Checkout code
uses: actions/checkout@v3

- name: Install PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
extensions: json, mysqli, mbstring, zip

- name: Setup Composer caching
- name: Install dependencies with caching
uses: ramsey/composer-install@v2

- name: Install dependencies and update PHPUnit
run: |
composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
composer install
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run code sniffer
run: vendor/bin/phpcs --colors
run: composer phpcs

- name: Run PHPUnit tests
if: ${{ matrix.php-version != '7.4' }}
if: ${{ matrix.php-version != '8.3' }}
run: vendor/bin/phpunit

- name: Run PHPUnit tests with coverage
if: ${{ matrix.php-version == '7.4' }}
if: ${{ matrix.php-version == '8.3' }}
run: vendor/bin/phpunit --coverage-clover coverage.xml

- name: Run Coveralls for PHPUnit tests
if: ${{ matrix.php-version == '7.4' }}
if: ${{ matrix.php-version == '8.3' }}
env:
COVERALLS_RUN_LOCALLY: true
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: vendor/bin/php-coveralls -v

- name: Run JEST with coverage and Coveralls
if: ${{ matrix.php-version == '8.2' }}
- name: Run ESLint, JEST with coverage and Coveralls
if: ${{ matrix.php-version == '8.3' }}
env:
COVERALLS_RUN_LOCALLY: true
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
corepack enable
yarn set version stable
yarn
yarn run dev
yarn dev
yarn lint
yarn run coveralls
13 changes: 6 additions & 7 deletions .github/workflows/deploy-to-wp-org.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Composer caching
- name: Install dependencies with caching
uses: ramsey/composer-install@v2
with:
composer-options: "--no-dev --optimize-autoloader --classmap-authoritative"

- name: Install dependencies in prod version
- name: Install packages
run: |
composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
composer install --no-dev
corepack enable
yarn set version stable
yarn
yarn run prod
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
yarn prod
- name: WordPress Plugin Deploy
id: deploy
Expand Down
4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules
2 changes: 1 addition & 1 deletion bin/update-tests
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ elif [[ $PHP_VERSION == '7.1' ]]; then
PHP_UNIT='7.5'
elif [[ $PHP_VERSION == '7.2' ]]; then
PHP_UNIT='8.5'
elif [[ $PHP_VERSION == '7.3' || $PHP_VERSION == '7.4' || $PHP_VERSION == '8.0' || $PHP_VERSION == '8.1' || $PHP_VERSION == '8.2' ]]; then
elif [[ $PHP_VERSION == '7.3' || $PHP_VERSION == '7.4' || $PHP_VERSION == '8.0' || $PHP_VERSION == '8.1' || $PHP_VERSION == '8.2' || $PHP_VERSION == '8.3' ]]; then
PHP_UNIT='9.5'
fi

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
"10up/wp_mock": "0.3 - 0.5",
"lucatume/function-mocker": "dev-master",
"phpunit/phpunit": "6.5 - 9.6",
"squizlabs/php_codesniffer": "^3.7.2",
"squizlabs/php_codesniffer": "^3.8.1",
"phpcompatibility/php-compatibility": "^9.3.5",
"phpcompatibility/phpcompatibility-wp": "^2.1.4",
"wp-coding-standards/wpcs": "^3.0.1",
"php-coveralls/php-coveralls": "^v2.6.0"
"php-coveralls/php-coveralls": "^v2.7.0"
},
"autoload": {
"classmap": [
Expand Down
6 changes: 3 additions & 3 deletions cyr-to-lat.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Cyr-To-Lat
* Plugin URI: https://wordpress.org/plugins/cyr2lat/
* Description: Convert Non-Latin characters in post and term slugs to Latin characters. Useful for creating human-readable URLs. Based on the original plugin by Anton Skorobogatov.
* Version: 6.0.5
* Version: 6.0.6
* Requires at least: 5.1
* Requires PHP: 7.0.0
* Author: Sergey Biryukov, Mikhail Kobzarev, Igor Gergel
Expand All @@ -22,7 +22,7 @@
*
*
* WC requires at least: 3.0
* WC tested up to: 8.1
* WC tested up to: 8.4
*/

// phpcs:ignore Generic.Commenting.DocComment.MissingShort
Expand All @@ -43,7 +43,7 @@
/**
* Plugin version.
*/
define( 'CYR_TO_LAT_VERSION', '6.0.5' );
define( 'CYR_TO_LAT_VERSION', '6.0.6' );

/**
* Path to the plugin dir.
Expand Down
32 changes: 21 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dev": "webpack --mode development",
"prod": "webpack --env production --mode production",
"watch": "webpack --mode development --watch",
"lint": "npx eslint 'src/js/**/*.js' 'assets/js/*.js' 'tests/js/**/*.js'",
"lint": "npx eslint 'webpack.config.js' 'src/js/**/*.js' 'assets/js/*.js' 'tests/js/**/*.js'",
"test": "jest",
"coveralls": "jest --coverage && cat coverage/lcov.info | coveralls"
},
Expand Down Expand Up @@ -47,25 +47,35 @@
}
}
},
"engines": {
"node": ">=21.5.0",
"npm": ">=10.3.0"
},
"packageManager": "[email protected]",
"dependencies": {
"@wordpress/hooks": "^3.48.0"
},
"devDependencies": {
"@babel/core": "^7.23.0",
"@babel/preset-env": "^7.22.20",
"@wordpress/eslint-plugin": "^15.1.0",
"autoprefixer": "^10.4.16",
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@wordpress/eslint-plugin": "^17.5.0",
"babel-loader": "^9.1.3",
"coveralls": "^3.1.1",
"css-loader": "^6.8.1",
"css-loader": "^6.9.0",
"css-minimizer-webpack-plugin": "^5.0.1",
"eslint": "^8.51.0",
"eslint": "^8.56.0",
"glob": "^10.3.10",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"mini-css-extract-plugin": "^2.7.6",
"terser-webpack-plugin": "^5.3.9",
"webpack": "^5.88.2",
"mini-css-extract-plugin": "^2.7.7",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-remove-empty-scripts": "^1.0.4"
},
"packageManager": "[email protected]"
"overrides": {
"@cypress/request": "^3.0.1",
"tough-cookie": "^4.1.3"
}
}
31 changes: 19 additions & 12 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: SergeyBiryukov, mihdan, karevn, webvitaly, kaggdesign
Tags: cyrillic, belorussian, ukrainian, bulgarian, macedonian, georgian, kazakh, latin, l10n, russian, cyr-to-lat, cyr2lat, rustolat, slugs, translations, transliteration
Requires at least: 5.1
Tested up to: 6.3
Stable tag: 6.0.5
Tested up to: 6.4
Stable tag: 6.0.6
Requires PHP: 7.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -93,7 +93,7 @@ function my_ctl_locale( $locale ) {
add_filter( 'ctl_locale', 'my_ctl_locale' );
`

= How can I define own transliteration of titles? =
= How can I define my own transliteration of titles? =

Add similar code to your theme's `functions.php` file:

Expand All @@ -116,7 +116,7 @@ function my_ctl_pre_sanitize_title( $result, $title ) {
add_filter( 'ctl_pre_sanitize_title', 10, 2 );
`

= How can I define own transliteration of filenames? =
= How can I define my own transliteration of filenames? =

Add similar code to your theme's `functions.php` file:

Expand All @@ -141,7 +141,7 @@ add_filter( 'ctl_pre_sanitize_filename', 10, 2 );

= How can I allow the plugin to work on the frontend? =

Add similar code to your theme's `functions.php` file:
Add the following code to your plugin's (or mu-plugin's) main file. This code won't work being added to a theme's functions.php file.

`
/**
Expand Down Expand Up @@ -199,8 +199,8 @@ wp cyr2lat regenerate [--post_type=<post_type>] [--post_status=<post_status>]
`

Where
`-post_type` is list of post types,
`-post_status` is list of post statuses.
`-post_type` is a list of post types,
`-post_status` is a list of post statuses.

= How can I regenerate thumbnails safely? =

Expand All @@ -214,20 +214,27 @@ wp media regenerate --skip-plugins=cyr2lat

= Can I contribute? =

Yes you can!
Yes, you can!

* Join in on our [GitHub repository](https://github.com/mihdan/cyr2lat)
* Join in on our [Telegram Group](https://t.me/cyr2lat)

== Changelog ==

= 6.0.6 (14.01.2024) =
* Tested with WordPress 6.4.
* Tested with WooCommerce 8.4.
* Tested with PHP 8.3.
* Fixed documentation on ctl_allow filter.
* Fixed improper display of the "rate plugin" message on options.php.

= 6.0.5 (09.10.2023) =
* Fixed displaying file descriptions in the Theme Editor; now in the current locale.

= 6.0.4 (23.09.2023) =
* Fixed disappeared file descriptions on the Theme File Editor page.

* = 6.0.3 (29.07.2023) =
= 6.0.3 (29.07.2023) =
* Fixed fatal error with Jetpack sync.

= 6.0.2 (26.07.2023) =
Expand All @@ -237,7 +244,7 @@ Yes you can!
* Fixed fatal error on System Info page with empty options.

= 6.0.0 (26.07.2023) =
* Dropped support of PHP 5.6. Minimum required PHP version is 7.0 now.
* Dropped support of PHP 5.6. The Minimum required PHP version is 7.0 now.
* Tested with WordPress 6.3.
* Tested with WooCommerce 7.9.
* Added System Info tab.
Expand Down Expand Up @@ -280,7 +287,7 @@ Yes you can!
= 5.2.5 (19.12.2021) =
* Tested up to WordPress 5.9 and WooCommerce 6.0.
* Fix issue with Polylang - do not modify admin language when editing a post.
* Fix issue with JetPack - fatal error on synchronisation.
* Fix issue with JetPack - fatal error on synchronization.
* Fix 404 on archives created with WPML before activation of cyr2lat.

= 5.2.4 (07.09.2021) =
Expand Down Expand Up @@ -383,7 +390,7 @@ Yes you can!

= 4.3.3 (20.02.2020) =
* Reworked main plugin filter
* Improved performance by minimizing number of calls
* Improved performance by minimizing the number of calls
* Updated Georgian table
* Fixed slug duplication in taxonomies
* Fixed warnings with WooCommerce when mbstring is not loaded
Expand Down
8 changes: 6 additions & 2 deletions src/php/Settings/Abstracts/SettingsBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1205,9 +1205,13 @@ public function load_plugin_textdomain() {
/**
* Is current admin screen the plugin options screen.
*
* @param string|array $ids Additional screen id or ids to check.
*
* @return bool
*/
protected function is_options_screen(): bool {
protected function is_options_screen( $ids = 'options' ): bool {
$ids = (array) $ids;

if ( ! function_exists( 'get_current_screen' ) ) {
return false;
}
Expand All @@ -1224,7 +1228,7 @@ protected function is_options_screen(): bool {
$screen_id = str_replace( 'settings_page', 'toplevel_page', $screen_id );
}

return 'options' === $current_screen->id || $screen_id === $current_screen->id;
return $screen_id === $current_screen->id || in_array( $current_screen->id, $ids, true );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/php/Settings/PluginSettingsBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class="ctl-<?php echo esc_attr( $this->section_title() ); ?>"
* @return string|mixed
*/
public function admin_footer_text( $text ) {
if ( ! $this->is_options_screen() ) {
if ( ! $this->is_options_screen( [] ) ) {
return $text;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* Plugin version.
*/
const CYR_TO_LAT_TEST_VERSION = '6.0.5';
const CYR_TO_LAT_TEST_VERSION = '6.0.6';

/**
* Path to the plugin dir.
Expand Down
Loading

0 comments on commit 12f16e8

Please sign in to comment.