Refactor to PSR-4: rename files and switch namespace

- Rename files to PascalCase: Product_Type → ProductType, Cart_Handler →
  CartHandler, Product_Selector → ProductSelector, Stock_Manager →
  StockManager, Admin/Product_Data → Admin/ProductData
- Switch namespace from WC_Composable_Product to Magdev\WcComposableProduct
- Update all cross-references in PHP, CSS, JS, translations, and docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 12:35:02 +01:00
parent dd5965ae4c
commit ea2261d8d7
21 changed files with 281 additions and 281 deletions

View File

@@ -2,10 +2,10 @@
/**
* Main Plugin Class
*
* @package WC_Composable_Product
* @package Magdev\WcComposableProduct
*/
namespace WC_Composable_Product;
namespace Magdev\WcComposableProduct;
defined('ABSPATH') || exit;
@@ -98,15 +98,15 @@ class Plugin {
private function includes() {
// Note: Settings.php is NOT included here because it extends WC_Settings_Page
// which isn't loaded until later. It's included in add_settings_page() instead.
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/Admin/Product_Data.php';
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/Product_Type.php';
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/Stock_Manager.php';
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/Cart_Handler.php';
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/Product_Selector.php';
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/Admin/ProductData.php';
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/ProductType.php';
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/StockManager.php';
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/CartHandler.php';
require_once WC_COMPOSABLE_PRODUCT_PATH . 'includes/ProductSelector.php';
// Initialize components
new Admin\Product_Data();
new Cart_Handler();
new Admin\ProductData();
new CartHandler();
}
/**
@@ -129,7 +129,7 @@ class Plugin {
*/
public function product_class($classname, $product_type) {
if ($product_type === 'composable') {
$classname = 'WC_Composable_Product\Product_Type';
$classname = 'Magdev\WcComposableProduct\ProductType';
}
return $classname;
}