Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v5.14.0 #705

Merged
merged 69 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
f994c77
Bump 5.13.1 dev version
nmolham-godaddy Aug 22, 2024
7cf0efe
Update namespace version
nmolham-godaddy Aug 22, 2024
604225c
Add IsSingletonTrait (#700)
nmolham-godaddy Aug 23, 2024
e5888a9
Add can get new instance trait
agibson-godaddy Aug 23, 2024
66df5ff
Add CanConvertToArrayTrait and ArrayHelper
agibson-godaddy Aug 23, 2024
3bbc15a
Add tests
agibson-godaddy Aug 23, 2024
cb070f7
Update changelog
agibson-godaddy Aug 23, 2024
798179a
More tests
agibson-godaddy Aug 23, 2024
0bf9d77
Update changelog
agibson-godaddy Aug 23, 2024
0193463
Use spread operator instead of class reflections for better performance
nmolham-godaddy Aug 26, 2024
fce9ec7
Use spread operator instead of func_get_args
nmolham-godaddy Aug 26, 2024
6f266df
Update unit tests
nmolham-godaddy Aug 26, 2024
7145b7e
Merge pull request #702 from godaddy-wordpress/chore/add-new-traits
nmolham-godaddy Aug 26, 2024
d3c2259
Merge branch 'release/5.13.1' into chore/add-convert-to-array-trait
nmolham-godaddy Aug 26, 2024
86eb78c
Tests nested objects infinite recursion prevention
nmolham-godaddy Aug 26, 2024
332b89a
Unit test ArrayHelper::remove method
nmolham-godaddy Aug 26, 2024
021bdb8
Merge pull request #703 from godaddy-wordpress/chore/add-convert-to-a…
nmolham-godaddy Aug 26, 2024
150c93f
Define PSR4 autoloading
nmolham-godaddy Aug 26, 2024
54f199a
Autoloading Country_Helper
nmolham-godaddy Aug 26, 2024
187db85
Autoloading traits
nmolham-godaddy Aug 26, 2024
fb7cf27
Autoloading enums
nmolham-godaddy Aug 26, 2024
7abe302
Map Payment_Gateway namespace
nmolham-godaddy Aug 26, 2024
822e47a
Place PaymentFormContextChecker under the correct namespace
nmolham-godaddy Aug 26, 2024
2deb25c
Autoload Handlers namespace
nmolham-godaddy Aug 26, 2024
7350d97
Autoload Payment_Gateway\External_Checkout namespace
nmolham-godaddy Aug 26, 2024
5e6f978
Autoload Payment_Gateway\External_Checkout\Google_Pay namespace
nmolham-godaddy Aug 26, 2024
854ccc8
Autoload Payment_Gateway\Blocks namespace
nmolham-godaddy Aug 26, 2024
ba85ecf
Autoload Settings_API namespace
nmolham-godaddy Aug 26, 2024
5c48eb1
Autoload Helpers namespace
nmolham-godaddy Aug 26, 2024
6779677
Autoload API namespace
nmolham-godaddy Aug 26, 2024
0fa7993
Autoload Admin namespace
nmolham-godaddy Aug 26, 2024
95fd07b
Autoload Addresses namespace
nmolham-godaddy Aug 26, 2024
fb5efbb
Temp api/traits dir rename
nmolham-godaddy Aug 26, 2024
d7ee9d8
Revert temp renaming
nmolham-godaddy Aug 26, 2024
3ffed13
Move Country_Helper under Helpers namespace
nmolham-godaddy Aug 26, 2024
3fb89fa
Setup class aliases
nmolham-godaddy Aug 28, 2024
9817b0a
Setup class mapping via composer
nmolham-godaddy Aug 28, 2024
7ddac72
Remove all unnecessary class files inclusion
nmolham-godaddy Aug 28, 2024
b35d742
Test for samples of non-PSR4 classes
nmolham-godaddy Aug 28, 2024
7ee0cd6
restore load_class method
nmolham-godaddy Aug 28, 2024
5728a3d
Version number formatting.
agibson-godaddy Aug 28, 2024
67e69bc
Autoload testing with class_exists and/or interface_exists
nmolham-godaddy Aug 29, 2024
146dc3b
Bump version to 5.14.0
nmolham-godaddy Aug 29, 2024
0abbe06
Merge branch 'release/5.14.0' into chore/setup-autoloading
nmolham-godaddy Aug 29, 2024
7337b61
Merge branch 'release/5.14.0' into chore/setup-autoloading
nmolham-godaddy Aug 29, 2024
2d51e6d
Move Lifcycle class under corresponding namespace
nmolham-godaddy Aug 29, 2024
d2725d9
Update plugin loader example
nmolham-godaddy Aug 29, 2024
e9cbdf5
Remove redundant woothemes_queue_update
nmolham-godaddy Aug 29, 2024
4689185
Add assert helper method with logging
nmolham-godaddy Aug 29, 2024
329227f
Replace native assert with plugin's assert method
nmolham-godaddy Aug 29, 2024
55c5334
Merge branch 'chore/setup-autoloading' into mwc-11044/uncaught-assert…
nmolham-godaddy Aug 29, 2024
5caffd5
Unit test SV_WC_Plugin::logger method
nmolham-godaddy Aug 29, 2024
4ed4e05
Unit test SV_WC_Plugin::assert method
nmolham-godaddy Aug 29, 2024
637dd23
Enable assert ini setting
nmolham-godaddy Aug 29, 2024
499ba4f
Revert "Enable assert ini setting"
nmolham-godaddy Aug 29, 2024
7acd1fb
Dump CI php ini info
nmolham-godaddy Aug 29, 2024
c0a5413
Dump CI php ini info
nmolham-godaddy Aug 29, 2024
d7799cf
Configure CI php ini
nmolham-godaddy Aug 29, 2024
50433ec
Configure CI php ini
nmolham-godaddy Aug 29, 2024
2680e56
Configure CI php ini
nmolham-godaddy Aug 29, 2024
9f13eab
Configure CI php ini
nmolham-godaddy Aug 29, 2024
6a666bc
Configure CI php ini
nmolham-godaddy Aug 29, 2024
d652bc9
Configure CI php ini
nmolham-godaddy Aug 29, 2024
3f4bef7
Set up php.ini
agibson-godaddy Aug 29, 2024
5168c9b
Output and append
agibson-godaddy Aug 29, 2024
68da0a5
Only set up alias if it doesn't already exist
agibson-godaddy Aug 29, 2024
e826a4a
Update changelog
agibson-godaddy Aug 29, 2024
42da0a9
Merge pull request #704 from godaddy-wordpress/chore/setup-autoloading
nmolham-godaddy Aug 30, 2024
0c24c03
Merge pull request #706 from godaddy-wordpress/mwc-11044/uncaught-ass…
nmolham-godaddy Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove all unnecessary class files inclusion
  • Loading branch information
nmolham-godaddy committed Aug 28, 2024
commit 7ddac72ba5a70313dc1a4ac9a7b5cbc273fc07b1
5 changes: 0 additions & 5 deletions woocommerce/Blocks/Blocks_Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ public function __construct( SV_WC_Plugin $plugin ) {

$this->plugin = $plugin;

$framework_path = $this->plugin->get_framework_path();

require_once( $framework_path . '/Blocks/Traits/Block_Integration_Trait.php' );
require_once( $framework_path . '/Blocks/Block_Integration.php' );

// blocks-related notices and call-to-actions
add_action( 'admin_notices', [ $this, 'add_admin_notices' ] );

Expand Down
56 changes: 9 additions & 47 deletions woocommerce/class-sv-wc-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ public function __construct( string $id, string $version, array $args = [] ) {
// build the blocks handler instance
$this->init_blocks_handler();

// build the setup handler instance
$this->init_setup_wizard_handler();

// add the action & filter hooks
$this->add_hooks();
}
Expand Down Expand Up @@ -282,8 +279,6 @@ protected function init_rest_api_handler() {
*/
protected function init_blocks_handler() : void {

require_once( $this->get_framework_path() . '/Blocks/Blocks_Handler.php' );

// individual plugins should initialize their block integrations handler by overriding this method
$this->blocks_handler = new Blocks\Blocks_Handler( $this );
}
Expand All @@ -295,10 +290,12 @@ protected function init_blocks_handler() : void {
* Plugins can override and extend this method to add their own setup wizard.
*
* @since 5.3.0
*
* @deprecated
*/
protected function init_setup_wizard_handler() {

require_once( $this->get_framework_path() . '/admin/abstract-sv-wc-plugin-admin-setup-wizard.php' );
// np-op
}


Expand Down Expand Up @@ -446,49 +443,12 @@ public function init_admin() {
* Include any critical files which must be available as early as possible,
*
* @since 2.0.0
*
* @deprecated class files are loaded via composer
*/
private function includes() {

$framework_path = $this->get_framework_path();

$this->setupClassAliases();

// common exception class
require_once( $framework_path . '/class-sv-wc-plugin-exception.php' );

// common utility methods
require_once( $framework_path . '/class-sv-wc-helper.php' );

// backwards compatibility for older WC versions
require_once( $framework_path . '/class-sv-wc-plugin-compatibility.php' );
require_once( $framework_path . '/compatibility/abstract-sv-wc-data-compatibility.php' );
require_once( $framework_path . '/compatibility/class-sv-wc-order-compatibility.php' );
require_once( $framework_path . '/compatibility/class-sv-wc-subscription-compatibility.php' );

// generic API base
require_once( $framework_path . '/api/class-sv-wc-api-exception.php' );
require_once( $framework_path . '/api/class-sv-wc-api-base.php' );
require_once( $framework_path . '/api/interface-sv-wc-api-request.php' );
require_once( $framework_path . '/api/interface-sv-wc-api-response.php' );

// XML API base
require_once( $framework_path . '/api/abstract-sv-wc-api-xml-request.php' );
require_once( $framework_path . '/api/abstract-sv-wc-api-xml-response.php' );

// JSON API base
require_once( $framework_path . '/api/abstract-sv-wc-api-json-request.php' );
require_once( $framework_path . '/api/abstract-sv-wc-api-json-response.php' );

// REST API Controllers
require_once( $framework_path . '/rest-api/Controllers/Settings.php' );

// Handlers
require_once( $framework_path . '/class-sv-wc-plugin-dependencies.php' );
require_once( $framework_path . '/class-sv-wc-hook-deprecator.php' );
require_once( $framework_path . '/class-sv-wp-admin-message-handler.php' );
require_once( $framework_path . '/class-sv-wc-admin-notice-handler.php' );
require_once( $framework_path . '/Lifecycle.php' );
require_once( $framework_path . '/rest-api/class-sv-wc-plugin-rest-api.php' );
}

/**
Expand Down Expand Up @@ -833,14 +793,16 @@ public function log( $message, $log_id = null ) {
* Require and instantiate a class
*
* @since 4.2.0
*
* @deprecated
*
* @param string $local_path path to class file in plugin, e.g. '/includes/class-wc-foo.php'
* @param string $class_name class to instantiate
*
* @return object instantiated class instance
*/
public function load_class( $local_path, $class_name ) {

require_once( $this->get_plugin_path() . $local_path );

return new $class_name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,11 +754,6 @@ public function add_order_data( $order ) {
public function get_api() {

if ( ! $this->api instanceof SV_WC_Payment_Gateway_Apple_Pay_API ) {

require_once( $this->get_plugin()->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php');
require_once( $this->get_plugin()->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php');
require_once( $this->get_plugin()->get_payment_gateway_framework_path() . '/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php');

$this->api = new SV_WC_Payment_Gateway_Apple_Pay_API( $this->get_processing_gateway() );
}

Expand Down
62 changes: 0 additions & 62 deletions woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ public function __construct( $id, $version, $args ) {
*/
protected function init_rest_api_handler() {

require_once( $this->get_payment_gateway_framework_path() . '/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php' );

$this->rest_api_handler = new Payment_Gateway\REST_API( $this );
}

Expand Down Expand Up @@ -287,68 +285,8 @@ public function adjust_available_gateways( $available_gateways ) {
*/
private function includes() {

$payment_gateway_framework_path = $this->get_payment_gateway_framework_path();

// interfaces
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-request.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-response.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-authorization-response.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-create-payment-token-response.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-response.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-payment-notification-response.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-response.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-response.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php' );
require_once( $payment_gateway_framework_path . '/api/interface-sv-wc-payment-gateway-api-customer-response.php' );

// exceptions
require_once( $payment_gateway_framework_path . '/exceptions/class-sv-wc-payment-gateway-exception.php' );

// gateway
require_once( $payment_gateway_framework_path . '/class-sv-wc-payment-gateway.php' );
require_once( $payment_gateway_framework_path . '/class-sv-wc-payment-gateway-direct.php' );
require_once( $payment_gateway_framework_path . '/class-sv-wc-payment-gateway-hosted.php' );
require_once( $payment_gateway_framework_path . '/class-sv-wc-payment-gateway-payment-form.php' );
require_once( $payment_gateway_framework_path . '/class-sv-wc-payment-gateway-my-payment-methods.php' );

// Apple Pay
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php" );
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php" );
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php" );
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-ajax.php" );
require_once( "{$payment_gateway_framework_path}/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php" );

// payment tokens
require_once( $payment_gateway_framework_path . '/payment-tokens/class-sv-wc-payment-gateway-payment-token.php' );
require_once( $payment_gateway_framework_path . '/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php' );

// helpers
require_once( $payment_gateway_framework_path . '/api/class-sv-wc-payment-gateway-api-response-message-helper.php' );
require_once( $payment_gateway_framework_path . '/class-sv-wc-payment-gateway-helper.php' );
require_once $payment_gateway_framework_path . '/PaymentFormContextChecker.php';

// admin
require_once( $payment_gateway_framework_path . '/admin/class-sv-wc-payment-gateway-admin-order.php' );
require_once( $payment_gateway_framework_path . '/admin/class-sv-wc-payment-gateway-admin-user-handler.php' );
require_once( $payment_gateway_framework_path . '/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php' );

// integrations
require_once( $payment_gateway_framework_path . '/integrations/abstract-sv-wc-payment-gateway-integration.php' );

// subscriptions
if ( $this->is_subscriptions_active() ) {
require_once( $payment_gateway_framework_path . '/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php' );
}

// pre-orders
if ( $this->is_pre_orders_active() ) {
require_once( $payment_gateway_framework_path . '/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php' );
}

// privacy
if ( SV_WC_Plugin_Compatibility::is_wc_version_gte( '3.4' ) ) {
require_once( "{$payment_gateway_framework_path}/class-sv-wc-payment-gateway-privacy.php" );
$this->privacy_handler = new SV_WC_Payment_Gateway_Privacy( $this );
}
}
Expand Down