From 37cc1a5bcc7e15a6c7611b6714fb46153b68e0e0 Mon Sep 17 00:00:00 2001 From: Samuel Onyijne Date: Tue, 11 Oct 2022 12:56:48 +0100 Subject: [PATCH 001/196] updated composer to make plugin installable via composer. Set namespace to CreativeCommons_TOT with src folder as the source folder to the plugin codebase susing autoload psr-4. --- composer.json | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 646346c..98f9e51 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,11 @@ { "name": "creativecommons/termination-of-transfer", - "require": { - "mpdf/mpdf": "^6.0", - "smarty/smarty": "^3.1" + "type": "wordpress-plugin", + "description": "Termination of Transfer tool", + "keywords": ["WordPress", "plugins", "termination", "contract", "creativecommons", "php"], + "support": { + "issues": "https://github.com/creativecommons/termination-of-transfer/issues?state=open", + "source": "https://github.com/creativecommons/termination-of-transfer" }, "license": "GNU AGPL v3+", "authors": [ @@ -10,5 +13,27 @@ "name": "Rob Myers", "email": "rob@robmyers.org" } + ], + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=5.4", + "mpdf/mpdf": "^6.0", + "smarty/smarty": "^3.1" + }, + "config": { + "process-timeout": 1800, + "fxp-asset": { + "enabled": false + } + }, + "autoload": { + "psr-4": {"CreativeCommons_TOT\\": "src"} + }, + "repositories": [ + { + "type": "composer", + "url": "https://asset-packagist.org" + } ] } From 618c9335fd9899e63a611b266677429aab7844e1 Mon Sep 17 00:00:00 2001 From: Samuel Onyijne Date: Tue, 11 Oct 2022 13:08:26 +0100 Subject: [PATCH 002/196] created the plugin entry script as per WordPress plugin standard --- termination-of-contract.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 termination-of-contract.php diff --git a/termination-of-contract.php b/termination-of-contract.php new file mode 100644 index 0000000..e69de29 From 61fbe74e05b1b32f2e7b220046ee2dd972b368b1 Mon Sep 17 00:00:00 2001 From: Samuel Onyijne Date: Tue, 11 Oct 2022 13:16:09 +0100 Subject: [PATCH 003/196] added license and header comments requirements to entry script as per WordPress plugin requirement --- composer.json | 2 +- termination-of-contract.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 98f9e51..4f42970 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=5.4", + "php": ">=7.4", "mpdf/mpdf": "^6.0", "smarty/smarty": "^3.1" }, diff --git a/termination-of-contract.php b/termination-of-contract.php index e69de29..4bf2421 100644 --- a/termination-of-contract.php +++ b/termination-of-contract.php @@ -0,0 +1,29 @@ +. +*/ + + +/* +Plugin Name: Termination of Tranfer Tool +Plugin URI: https://github.com/creativecommons/termination-of-transfer +Version: 1.0.0 +Author: Creative Commons Corporation +Author URI: https://github.com/creativecommons/ +Requires PHP: 7.4.0 +*/ +?> From 5e9314288faa137a02b537317b4368f7e0359635 Mon Sep 17 00:00:00 2001 From: Samuel Onyijne Date: Tue, 11 Oct 2022 13:17:50 +0100 Subject: [PATCH 004/196] changed minimum PHP Version to 5.4 in composer and header requirements --- composer.json | 2 +- termination-of-contract.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 4f42970..98f9e51 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=7.4", + "php": ">=5.4", "mpdf/mpdf": "^6.0", "smarty/smarty": "^3.1" }, diff --git a/termination-of-contract.php b/termination-of-contract.php index 4bf2421..2037fef 100644 --- a/termination-of-contract.php +++ b/termination-of-contract.php @@ -24,6 +24,6 @@ Version: 1.0.0 Author: Creative Commons Corporation Author URI: https://github.com/creativecommons/ -Requires PHP: 7.4.0 +Requires PHP: 5.4.0 */ ?> From 0a5bdecd1b70cb6073dee7c68ce815d6b03122ea Mon Sep 17 00:00:00 2001 From: Samuel Onyijne Date: Tue, 11 Oct 2022 13:24:12 +0100 Subject: [PATCH 005/196] created Tool.php class that will handle html generating and shortcode logics --- src/Tool.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/Tool.php diff --git a/src/Tool.php b/src/Tool.php new file mode 100644 index 0000000..d70466e --- /dev/null +++ b/src/Tool.php @@ -0,0 +1,7 @@ + Date: Tue, 11 Oct 2022 13:41:28 +0100 Subject: [PATCH 006/196] added generateHtml method to Tool class --- src/Tool.php | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/src/Tool.php b/src/Tool.php index d70466e..074cd73 100644 --- a/src/Tool.php +++ b/src/Tool.php @@ -1,7 +1,56 @@ +
+

Your answers

+
+
+ + + +
+
+ + + + +
+
+ + + + + EOD; + return $tot_tool_html; + } } From ca1103b8634e2ffe47ad3b4d42d5e1aaaf311f20 Mon Sep 17 00:00:00 2001 From: Samuel Onyijne Date: Tue, 11 Oct 2022 13:48:23 +0100 Subject: [PATCH 007/196] added handleShortcode method to Tool class --- src/Tool.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Tool.php b/src/Tool.php index 074cd73..afe6fc1 100644 --- a/src/Tool.php +++ b/src/Tool.php @@ -9,7 +9,7 @@ class Tool /** * This will only work in 5.3 or later and WP 3.8 allows 2.4.2+ ... */ - public function generateHtml() + protected function generateHtml() { $tot_tool_html = <<<'EOD'