Skip to content

Commit 01b31f7

Browse files
authored
Merge pull request #48 from mwarzybok-sumoheavy/feature/SP-664
SP-664 WooCommerce Plugin Error on v5.0.1
2 parents 9df997f + 43bedfb commit 01b31f7

File tree

4,476 files changed

+481475
-180437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,476 files changed

+481475
-180437
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
- uses: actions/checkout@v3
1515
- name: Run WordPress code standard
1616
run: |
17-
./vendor/bin/phpcs -v --ignore=vendor,wpcs --standard=./phpcs.xml ./
17+
./vendorPrefixed/vendor/bin/phpcs -v --ignore=vendor,vendorPrefixed,wpcs,scoper.inc.php --standard=./phpcs.xml ./

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
BitPayLib/.DS_Store
33
logs/*.*
44
/.idea/
5+
/vendor

BitPayLib/class-bitpaylogger.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class BitPayLogger {
1616

1717
public function execute( $msg, string $type, bool $is_array = false, $error = false ): void {
1818
$bitpay_checkout_options = get_option( 'woocommerce_bitpay_checkout_gateway_settings' );
19-
$log_directory = plugin_dir_path( __FILE__ ) . '..' . DIRECTORY_SEPARATOR . 'logs/';
19+
$log_directory = plugin_dir_path( __FILE__ ) . '..' . DIRECTORY_SEPARATOR . '..'
20+
. DIRECTORY_SEPARATOR . 'logs/';
2021
if ( ! file_exists( $log_directory ) && ! mkdir( $log_directory ) && ! is_dir( $log_directory ) ) {
2122
throw new \RuntimeException( sprintf( 'Directory "%s" was not created', $log_directory ) );
2223
}

BitPayLib/class-bitpaypluginsetup.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function check_requirements(): void {
116116
}
117117

118118
public function validate_wc_payment_gateway(): void {
119-
if ( class_exists( 'WC_Payment_Gateway' ) ) {
119+
if ( class_exists( '\WC_Payment_Gateway' ) ) {
120120
return;
121121
}
122122

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ If you *are* a developer wanting contribute an enhancement, bugfix or other patc
5858

5959
This open source project is released under the [MIT license](http://opensource.org/licenses/MIT) which means if you would like to use this project's code in your own project you are free to do so. Speaking of, if you have used our code in a cool new project we would like to hear about it! Please send us an [email](mailto:[email protected]).
6060

61+
Vendor is generated by php-scoper to avoid dependency conflicts between plugins. Remember to run 'composer install' and add 'vendorPrefixed' to the repository after making any changes
62+
6163
## License
6264

6365
Please refer to the [LICENSE](https://github.com/bitpay/bitpay-checkout-for-woocommerce/blob/master/LICENSE) file that came with this project.

composer.json

+16-2
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,31 @@
99
],
1010
"require": {
1111
"php": "^8",
12-
"bitpay/sdk": "^8.0.0"
12+
"bitpay/sdk": "^8.0.0",
13+
"humbug/php-scoper": "^0.18.3"
1314
},
1415
"require-dev": {
1516
"wp-coding-standards/wpcs": "dev-develop"
1617
},
1718
"autoload": {
1819
"classmap": ["BitPayLib"]
1920
},
21+
"scripts": {
22+
"add-prefix": [
23+
"php ./vendor/bin/php-scoper add-prefix --force --quiet",
24+
"composer dump-autoload --working-dir vendorPrefixed"
25+
],
26+
"dump-prefixed-vendor": "composer dump-autoload --working-dir vendorPrefixed --classmap-authoritative",
27+
"post-install-cmd": [
28+
"composer add-prefix"
29+
],
30+
"post-update-cmd": [
31+
"composer add-prefix"
32+
]
33+
},
2034
"config": {
2135
"allow-plugins": {
2236
"dealerdirect/phpcodesniffer-composer-installer": true
2337
}
2438
}
25-
}
39+
}

0 commit comments

Comments
 (0)