From 80df79aafe5421a3959ff57926fb7e30b1d4d811 Mon Sep 17 00:00:00 2001 From: Thomas Zwirner Date: Sat, 21 Oct 2023 16:18:41 +0200 Subject: [PATCH 1/2] compatibility with WordPress Coding Standards 3.0 --- composer.json | 11 ++++++++--- readme.txt | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 816dde1..32a1e1d 100644 --- a/composer.json +++ b/composer.json @@ -1,14 +1,19 @@ { "name": "threadi/auto-category-for-posts", "require-dev": { - "wp-coding-standards/wpcs": "^2.3" + "wp-coding-standards/wpcs": "^3.0.0" }, "scripts": { "post-install-cmd": [ - "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs" + "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs,vendor/phpcsstandards/phpcsutils,vendor/phpcsstandards/phpcsextra" ], "post-update-cmd": [ - "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs" + "\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs,vendor/phpcsstandards/phpcsutils,vendor/phpcsstandards/phpcsextra" ] + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/readme.txt b/readme.txt index 4ffde61..7b428a6 100644 --- a/readme.txt +++ b/readme.txt @@ -2,11 +2,11 @@ Contributors: threadi Tags: category, auto category, posts Requires at least: 5.8 -Tested up to: 6.3 +Tested up to: 6.4 Requires PHP: 7.4 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html -Stable tag: 1.0.6 +Stable tag: 1.0.7 == Description == @@ -41,4 +41,9 @@ This plugin adds the possibility to set a default category for posts within the = 1.0.6 = * Updated compatibility-flag for WordPress 6.3 -* Compatible with WordPress Coding Standards \ No newline at end of file +* Compatible with WordPress Coding Standards + += 1.0.7 = +* Updated compatibility-flag for WordPress 6.4 +* Compatible with WordPress Coding Standards 3.0 +* Removed language-files from plugin (except the json-files for Block Editor) From daf94a3919c4f957d7290f27515c1011bc49d2e5 Mon Sep 17 00:00:00 2001 From: Thomas Zwirner Date: Sat, 21 Oct 2023 16:26:08 +0200 Subject: [PATCH 2/2] remove local languaged embedding --- auto-category-for-posts.php | 11 ---- build/build.xml | 2 +- languages/auto-category-for-posts-de_DE.mo | Bin 1351 -> 1351 bytes languages/auto-category-for-posts-de_DE.po | 14 ++--- .../auto-category-for-posts-de_DE_formal.mo | Bin 0 -> 1351 bytes .../auto-category-for-posts-de_DE_formal.po | 58 ++++++++++++++++++ languages/auto-category-for-posts.pot | 18 +++--- readme.md | 2 +- 8 files changed, 76 insertions(+), 29 deletions(-) create mode 100644 languages/auto-category-for-posts-de_DE_formal.mo create mode 100644 languages/auto-category-for-posts-de_DE_formal.po diff --git a/auto-category-for-posts.php b/auto-category-for-posts.php index 9c84716..cfbd490 100644 --- a/auto-category-for-posts.php +++ b/auto-category-for-posts.php @@ -25,17 +25,6 @@ // set version of this plugin. const AUTOCATEGORY_VERSION = '@@VersionNumber@@'; -/** - * Initialize the plugin. - * - * @return void - * @noinspection PhpUnused - */ -function auto_category_init(): void { - load_plugin_textdomain( 'auto-category-for-posts', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); -} -add_action( 'init', 'auto_category_init' ); - /** * Check for necessary steps after plugin-updates. * diff --git a/build/build.xml b/build/build.xml index ca0f184..af0cd46 100644 --- a/build/build.xml +++ b/build/build.xml @@ -39,7 +39,7 @@ - + diff --git a/languages/auto-category-for-posts-de_DE.mo b/languages/auto-category-for-posts-de_DE.mo index a1b0a17f5953c9c2a0709276ce2ee0c91cea40bf..7b4aa6e620e4e6a5b1789d3018079ec7b9ec1a8d 100644 GIT binary patch delta 29 kcmX@kb)0L%8YTf_T|)z1BSQs4Gb~JpR4_EPGBDOQFx\n" "Language-Team: \n" "Language: de\n" @@ -37,22 +37,22 @@ msgstr "Thomas Zwirner" msgid "https://www.thomaszwirner.de" msgstr "https://www.thomaszwirner.de" -#: auto-category-for-posts.php:97 admin/js.js:24 +#: auto-category-for-posts.php:92 admin/js.js:24 msgid "Set as default" msgstr "Setze als Standard-Kategorie" -#: auto-category-for-posts.php:100 admin/js.js:26 +#: auto-category-for-posts.php:95 admin/js.js:26 msgid "Default category" msgstr "Standard-Kategorie" -#: auto-category-for-posts.php:153 +#: auto-category-for-posts.php:151 msgid "Error on saving new settings for default category." msgstr "Fehler beim Speichern der neuen Einstellungen zur Standard-Kategorie." -#: auto-category-for-posts.php:184 +#: auto-category-for-posts.php:183 msgid "Given category does not exists." msgstr "Die übergebene Kategorie existiert nicht." -#: auto-category-for-posts.php:188 +#: auto-category-for-posts.php:186 msgid "No new category-id given." msgstr "Keine Kategorie übergeben." diff --git a/languages/auto-category-for-posts-de_DE_formal.mo b/languages/auto-category-for-posts-de_DE_formal.mo new file mode 100644 index 0000000000000000000000000000000000000000..7b4aa6e620e4e6a5b1789d3018079ec7b9ec1a8d GIT binary patch literal 1351 zcmb7DyKWOf6dm5g5(uS1C`eoiBnX=IBN9Rzf_TJ1D1=yvK|p~t@m{Y7t!K>4Y)tYW zlyv+9O{nq@&{0rOLqUfSXYJS~1PVqvI(v8S``-C9ee|`!DFNq!3^)bs0LA$VoCUrC ztH9JDA;h?o$tDw88MeqyuSBZSC;O zt4&TKu{gA)k*%mZhhWwe3fiOtAD%+L*>ctV?>1y^pL*%RcWF%H>{`r`nVi zrZH}>L>FYyR$pqY$~E59MRd7{?#EQC)aGQhB5PHuUW;qhtCd=%QhK0#kWHtI&s4B3 zru~)D4Q<-?)}J-rgq=xqm9lKI>c%vdW3;Taa(|^hsU0H3BarAC%JmB}URx;`d@CP4HHwRswTE?hQr zae=B==1WiHJ;tntRW&Rp*s(dZyNa7dOjBbl|LWd&nSHCnv^?Bi&D7rAadd}uaJz3) zE|z3FP=br~piH7%A}6}aV7GFt-&o&Z+Z~KOc(d47&7KJ>61pgYQuaO82aVKL37rIO9djAE%%c literal 0 HcmV?d00001 diff --git a/languages/auto-category-for-posts-de_DE_formal.po b/languages/auto-category-for-posts-de_DE_formal.po new file mode 100644 index 0000000..c042e2f --- /dev/null +++ b/languages/auto-category-for-posts-de_DE_formal.po @@ -0,0 +1,58 @@ +# Copyright (C) 2022 Thomas Zwirner +# This file is distributed under the GPL-2.0-or-later. +msgid "" +msgstr "" +"Project-Id-Version: Auto Category for Posts 1.0.2\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/auto-category-for-" +"posts\n" +"POT-Creation-Date: 2023-10-21T16:20:48+02:00\n" +"PO-Revision-Date: 2023-10-21 16:21+0200\n" +"Last-Translator: Thomas Zwirner \n" +"Language-Team: \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" +"X-Domain: auto-category-for-posts\n" + +#. Plugin Name of the plugin +msgid "Auto Category for Posts" +msgstr "Automatische Kategorie für Beiträge" + +#. Description of the plugin +msgid "" +"Automatically add a default-category to each new post before it is first " +"saved." +msgstr "" +"Setzt die Standard-Kategorie an neuen Beiträgen bereits bevor diese erstmals " +"gespeichert werden." + +#. Author of the plugin +msgid "Thomas Zwirner" +msgstr "Thomas Zwirner" + +#. Author URI of the plugin +msgid "https://www.thomaszwirner.de" +msgstr "https://www.thomaszwirner.de" + +#: auto-category-for-posts.php:92 admin/js.js:24 +msgid "Set as default" +msgstr "Setze als Standard-Kategorie" + +#: auto-category-for-posts.php:95 admin/js.js:26 +msgid "Default category" +msgstr "Standard-Kategorie" + +#: auto-category-for-posts.php:151 +msgid "Error on saving new settings for default category." +msgstr "Fehler beim Speichern der neuen Einstellungen zur Standard-Kategorie." + +#: auto-category-for-posts.php:183 +msgid "Given category does not exists." +msgstr "Die übergebene Kategorie existiert nicht." + +#: auto-category-for-posts.php:186 +msgid "No new category-id given." +msgstr "Keine Kategorie übergeben." diff --git a/languages/auto-category-for-posts.pot b/languages/auto-category-for-posts.pot index 5866b9d..063308b 100644 --- a/languages/auto-category-for-posts.pot +++ b/languages/auto-category-for-posts.pot @@ -1,17 +1,17 @@ -# Copyright (C) 2022 Thomas Zwirner +# Copyright (C) 2023 Thomas Zwirner # This file is distributed under the GPL-2.0-or-later. msgid "" msgstr "" -"Project-Id-Version: Auto Category for Posts 1.0.2\n" +"Project-Id-Version: Auto Category for Posts @@VersionNumber@@\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/auto-category-for-posts\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2022-02-09T15:01:42+01:00\n" +"POT-Creation-Date: 2023-10-21T16:20:48+02:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.6.0\n" +"X-Generator: WP-CLI 2.8.1\n" "X-Domain: auto-category-for-posts\n" #. Plugin Name of the plugin @@ -30,24 +30,24 @@ msgstr "" msgid "https://www.thomaszwirner.de" msgstr "" -#: auto-category-for-posts.php:97 +#: auto-category-for-posts.php:92 #: admin/js.js:24 msgid "Set as default" msgstr "" -#: auto-category-for-posts.php:100 +#: auto-category-for-posts.php:95 #: admin/js.js:26 msgid "Default category" msgstr "" -#: auto-category-for-posts.php:153 +#: auto-category-for-posts.php:151 msgid "Error on saving new settings for default category." msgstr "" -#: auto-category-for-posts.php:184 +#: auto-category-for-posts.php:183 msgid "Given category does not exists." msgstr "" -#: auto-category-for-posts.php:188 +#: auto-category-for-posts.php:186 msgid "No new category-id given." msgstr "" diff --git a/readme.md b/readme.md index ffbeee7..2f476a0 100644 --- a/readme.md +++ b/readme.md @@ -20,7 +20,7 @@ I recommend to use [PoEdit](https://poedit.net/) to translate texts for this plu Run in main directory: -`wp i18n make-pot . languages/auto-category-for-posts.pot` +`wp i18n make-pot . languages/auto-category-for-posts.pot --exclude=svn` ### update translation-file