Skip to content

Commit

Permalink
Merge pull request #48 from mwarzybok-sumoheavy/feature/SP-664
Browse files Browse the repository at this point in the history
SP-664 WooCommerce Plugin Error on v5.0.1
  • Loading branch information
bobbrodie authored Aug 27, 2023
2 parents 9df997f + 43bedfb commit 01b31f7
Show file tree
Hide file tree
Showing 4,476 changed files with 481,475 additions and 180,437 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- uses: actions/checkout@v3
- name: Run WordPress code standard
run: |
./vendor/bin/phpcs -v --ignore=vendor,wpcs --standard=./phpcs.xml ./
./vendorPrefixed/vendor/bin/phpcs -v --ignore=vendor,vendorPrefixed,wpcs,scoper.inc.php --standard=./phpcs.xml ./
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
BitPayLib/.DS_Store
logs/*.*
/.idea/
/vendor
3 changes: 2 additions & 1 deletion BitPayLib/class-bitpaylogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class BitPayLogger {

public function execute( $msg, string $type, bool $is_array = false, $error = false ): void {
$bitpay_checkout_options = get_option( 'woocommerce_bitpay_checkout_gateway_settings' );
$log_directory = plugin_dir_path( __FILE__ ) . '..' . DIRECTORY_SEPARATOR . 'logs/';
$log_directory = plugin_dir_path( __FILE__ ) . '..' . DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . 'logs/';
if ( ! file_exists( $log_directory ) && ! mkdir( $log_directory ) && ! is_dir( $log_directory ) ) {
throw new \RuntimeException( sprintf( 'Directory "%s" was not created', $log_directory ) );
}
Expand Down
2 changes: 1 addition & 1 deletion BitPayLib/class-bitpaypluginsetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function check_requirements(): void {
}

public function validate_wc_payment_gateway(): void {
if ( class_exists( 'WC_Payment_Gateway' ) ) {
if ( class_exists( '\WC_Payment_Gateway' ) ) {
return;
}

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ If you *are* a developer wanting contribute an enhancement, bugfix or other patc

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]).

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

## License

Please refer to the [LICENSE](https://github.com/bitpay/bitpay-checkout-for-woocommerce/blob/master/LICENSE) file that came with this project.
18 changes: 16 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,31 @@
],
"require": {
"php": "^8",
"bitpay/sdk": "^8.0.0"
"bitpay/sdk": "^8.0.0",
"humbug/php-scoper": "^0.18.3"
},
"require-dev": {
"wp-coding-standards/wpcs": "dev-develop"
},
"autoload": {
"classmap": ["BitPayLib"]
},
"scripts": {
"add-prefix": [
"php ./vendor/bin/php-scoper add-prefix --force --quiet",
"composer dump-autoload --working-dir vendorPrefixed"
],
"dump-prefixed-vendor": "composer dump-autoload --working-dir vendorPrefixed --classmap-authoritative",
"post-install-cmd": [
"composer add-prefix"
],
"post-update-cmd": [
"composer add-prefix"
]
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
}
Loading

0 comments on commit 01b31f7

Please sign in to comment.