PluginProbe
Product Specifications for Woocommerce / 0.8.10
Product Specifications for Woocommerce v0.8.10
0.8.10 trunk 0.4.0 0.4.1 0.4.2 0.4.3 0.5.0 0.5.1 0.5.2 0.5.3 0.6.0 0.7.0 0.7.1 0.7.2 0.7.3 0.7.4 0.8.0 0.8.1 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.8.9
product-specifications / product-specifications.php

product-specifications.php in Product Specifications for Woocommerce 0.8.10, at product-specifications.php

56 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: Product Specifications for WooCommerce
5 * Plugin URI: https://github.com/dornaweb/product-specifications/
6 * Description: This plugin adds a product specifications table to your woocommerce products.
7 * Version: 0.8.10
8 * Author: Amin Abdolrezapoor
9 * Author URI: https://amin.nz
10 * License: GPL-2.0+
11 * Requires Plugins: woocommerce
12 * Requires PHP: 7.4
13 * Requires at least: 5.9
14 * WC tested up to: 10.8.1
15 * WC requires at least: 8.0.0
16 */
17 declare (strict_types=1);
18 namespace Amiut\ProductSpecs;
19
20 // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols
21 use ProductSpecifications\Vendor\Inpsyde\Modularity\Package;
22 use ProductSpecifications\Vendor\Inpsyde\Modularity\Properties\PluginProperties;
23 use Throwable;
24 defined('ABSPATH') || exit;
25 if (!defined('DWSPECS_PLUGIN_FILE')) {
26 define('DWSPECS_PLUGIN_FILE', __FILE__);
27 }
28 function handleFailure(Throwable $throwable): void
29 {
30 add_action('all_admin_notices', static function () use ($throwable) {
31 $class = 'notice notice-error';
32 printf('<div class="%s"><p>%s</p></div>', esc_attr($class), wp_kses_post(sprintf('<strong>Error:</strong> %s <br><pre>%s</pre>', $throwable->getMessage(), $throwable->getTraceAsString())));
33 });
34 }
35 function setupAutoLoader(): void
36 {
37 if (class_exists(\Amiut\ProductSpecs\Content\Module::class)) {
38 return;
39 }
40 if (is_readable(__DIR__ . '/vendor/autoload.php')) {
41 require_once __DIR__ . '/vendor/autoload.php';
42 }
43 }
44 function bootstrap(): void
45 {
46 try {
47 setupAutoLoader();
48 $plugin = Package::new(PluginProperties::new(__FILE__));
49 \Amiut\ProductSpecs\App::instance();
50 $plugin->addModule(new \Amiut\ProductSpecs\Assets\Module())->addModule(new \Amiut\ProductSpecs\Template\Module())->addModule(new \Amiut\ProductSpecs\Repository\Module())->addModule(new \Amiut\ProductSpecs\Content\Module())->addModule(new \Amiut\ProductSpecs\Admin\Module())->addModule(new \Amiut\ProductSpecs\AttributesListUi\Module())->addModule(new \Amiut\ProductSpecs\AttributeGroupsListUi\Module())->addModule(new \Amiut\ProductSpecs\ImportExport\Module())->addModule(new \Amiut\ProductSpecs\Settings\Module())->addModule(new \Amiut\ProductSpecs\Integration\Module())->addModule(new \Amiut\ProductSpecs\Attribute\Module())->addModule(new \Amiut\ProductSpecs\Shortcode\Module())->addModule(new \Amiut\ProductSpecs\Metabox\Module())->addModule(new \Amiut\ProductSpecs\EntityUpdater\Module())->addModule(new \Amiut\ProductSpecs\EntityUpdaterUi\Module())->addModule(new \Amiut\ProductSpecs\ProductSpecifications\Module())->addModule(new \Amiut\ProductSpecs\SpecificationsTable\Module())->boot();
51 } catch (Throwable $throwable) {
52 handleFailure($throwable);
53 }
54 }
55 add_action('plugins_loaded', __NAMESPACE__ . '\bootstrap');
56