From f2bd7e19d653ab6ad5e1d06a9383b668f1ecd458 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 17 Nov 2022 11:51:30 +0100 Subject: [PATCH 1/6] Create .gitignore --- .gitignore | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f0602c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +### vscode ### +.vscode/ +### NetBeans ### +**/nbproject/ +### PhpStorm ### +.idea/ +### macOS ### +.DS_Store +### Node ### +node_modules/ +### Tmp ### +_tmp/ From 043ceefe99706e0e9a9e349bc20f7bebd213f821 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 17 Nov 2022 11:51:35 +0100 Subject: [PATCH 2/6] Update composer.json --- composer.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/composer.json b/composer.json index bc52db3..4f0b461 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "rrze/wp", "description": "A general purpose library for WordPress.", + "version": "1.0.0", "type": "library", "keywords": [ "wordpress" @@ -12,6 +13,11 @@ "name": "Rolf v. d. Forst", "email": "rolf.v.d.forst@fau.de", "homepage": "https://www.rrze.fau.de" + }, + { + "name": "Benjamin Klemencic", + "email": "benjamin.klemencic@fau.de", + "homepage": "https://www.rrze.fau.de" } ], "require": { From 557109cc0968b1851b9f48bcfd7df64b157180ec Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 17 Nov 2022 11:51:40 +0100 Subject: [PATCH 3/6] Delete Helper.php --- src/Helper.php | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 src/Helper.php diff --git a/src/Helper.php b/src/Helper.php deleted file mode 100644 index f1685ff..0000000 --- a/src/Helper.php +++ /dev/null @@ -1,50 +0,0 @@ - Date: Thu, 17 Nov 2022 11:51:45 +0100 Subject: [PATCH 4/6] Create rrze-wp.pot --- src/languages/rrze-wp.pot | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/languages/rrze-wp.pot diff --git a/src/languages/rrze-wp.pot b/src/languages/rrze-wp.pot new file mode 100644 index 0000000..dd077f5 --- /dev/null +++ b/src/languages/rrze-wp.pot @@ -0,0 +1,13 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \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-11-17T09:13:39+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.7.1\n" +"X-Domain: rrze-wp\n" From c3d3ef050c25f466fc7703414766c3fb2a37fac4 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 17 Nov 2022 11:51:49 +0100 Subject: [PATCH 5/6] Update Plugin.php --- src/Plugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index 80db0cb..7d760a4 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -116,7 +116,7 @@ public function setDirectory(): object */ public function getPath(string $path = ''): string { - return $this->directory . ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; + return $this->directory . ($path ? trim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : ''); } /** @@ -127,7 +127,7 @@ public function getPath(string $path = ''): string */ public function getUrl(string $path = ''): string { - return $this->url . ltrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; + return $this->url . ($path ? trim($path, '/') . '/' : ''); } /** @@ -137,7 +137,7 @@ public function getUrl(string $path = ''): string */ public function setUrl(): object { - $this->url = rtrim(plugin_dir_url($this->pluginFile), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; + $this->url = rtrim(plugin_dir_url($this->pluginFile), '/') . '/'; return $this; } From ffe5948258799c169114cb6f81ae9e527a905ed4 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 17 Nov 2022 11:51:56 +0100 Subject: [PATCH 6/6] Create Utils.php --- src/Utils.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/Utils.php diff --git a/src/Utils.php b/src/Utils.php new file mode 100644 index 0000000..5a5484e --- /dev/null +++ b/src/Utils.php @@ -0,0 +1,50 @@ +