PluginProbe
Gutenify – Visual Site Builder Blocks & Starter Templates / 1.8.0
Gutenify – Visual Site Builder Blocks & Starter Templates v1.8.0
1.9.0 1.8.0 1.7.0 1.6.6 1.6.5 1.6.4 trunk 0.0.1 0.0.2 0.0.3 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 All 74 releases
gutenify / core / inc / bootstrap.php

bootstrap.php in Gutenify – Visual Site Builder Blocks & Starter Templates 1.8.0, at core/inc/bootstrap.php

129 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Bootstrap file to initialize and load all required dependencies and core functionality.
4 *
5 * This file serves as the entry point to include necessary files and set up the environment for the LIGER Lite plugin/theme.
6 *
7 * @package gutenify
8 */
9
10 /**
11 * Prevent direct access to the file.
12 *
13 * Ensures this file is being loaded within the WordPress environment.
14 */
15 defined( 'ABSPATH' ) || exit;
16
17 /**
18 * Load the Helpers class file containing utility methods.
19 */
20 require_once __DIR__ . '/helpers/class-helpers.php';
21
22 /**
23 * List of PHP files to be required for initializing core functionality.
24 *
25 * @var string[] Array of relative file paths.
26 */
27 $required_files = array(
28
29 // Core helpers and utilities.
30 'inc/helpers/helpers.php',
31 'inc/helpers/class-style-helpers.php',
32 'inc/helpers/class-dynamic-styles.php',
33 'inc/helpers/class-typography-helpers.php',
34 'inc/depricated/styles.php', // [TODO: Depricated].
35 'inc/class-assets.php',
36 'inc/helpers/class-post-list.php',
37 'inc/depricated/helpers/typography-helpers.php', // [TODO: Depricated].
38
39 // WooCommerce support.
40 'inc/helpers/woocommerce-template-functions.php',
41
42 // Gutenberg block handling.
43 'inc/blocks/class-blocks-categories.php',
44 'inc/blocks/class-block-inline-styles.php',
45 'inc/blocks/class-block-assets.php',
46 'inc/blocks/class-block-editor-assets.php',
47 'inc/blocks/class-extend-attributes.php',
48 'inc/blocks/class-fix-third-party-block-issues.php',
49 'inc/blocks/class-dynamic-block-classname.php',
50 'inc/blocks/class-slider-blocks.php',
51 'inc/blocks/class-editor-control.php',
52
53 // Template and site structure management.
54 'inc/frontend/class-global-code.php',
55
56 // REST API endpoints.
57 'inc/rest-api/class-rest.php',
58 'inc/rest-api/class-rest-demo-importer-v2.php',
59 'inc/rest-api/class-image-sideload-queue.php',
60
61 // Demo importing tools.
62 // 'inc/depricated/demo-importer.php', // [TODO: Depricated].
63
64 // Admin interface and backend logic.
65 'inc/admin/class-menu.php',
66 'inc/admin/class-demo-importer-v2.php',
67 'inc/admin/class-register-templates-post-type.php',
68
69 // Interface definitions and wrappers.
70 'inc/depricated/interfaces/class-main-class-wrapper.php', // [TODO: depricated]
71
72 // React-based non-block components and admin pages.
73 'dist/non-blocks/components/index.php',
74
75
76 // Block editor extensions.
77 'dist/non-blocks/extend/toolbar-templates-button/index.php',
78 'dist/non-blocks/extend/custom-list/index.php',
79 'dist/non-blocks/extend/block-custom-css/index.php',
80 'dist/non-blocks/extend/sliders/index.php',
81 'dist/non-blocks/extend/aos/index.php',
82
83 // Admin page interfaces.
84 'dist/non-blocks/admin/pages/getting-started/index.php',
85 'dist/non-blocks/admin/pages/settings/index.php',
86 'dist/non-blocks/admin/rating-notice/index.php',
87
88 // Optionally excluded files for future use.
89 /**
90 * 'dist/non-blocks/extend/save-template/index.php',
91 * 'dist/non-blocks/extend/responsive-display-control/index.php',
92 * 'dist/non-blocks/extend/masonry/index.php',
93 */
94 );
95
96 // Import the Helpers class to simplify references.
97 use gutenify\Helpers;
98
99 // Get the base directory path where block files are located.
100 $base_dir = GUTENIFY_BASE_DIR . 'core/';
101
102 // Loop through the list of required file paths.
103 foreach ( $required_files as $file ) {
104 // Build the full path to the file by prepending the base directory.
105 $full_path = wp_normalize_path( $base_dir . $file );
106
107 // Check if the file exists and is a regular file before including it.
108 if ( is_file( $full_path ) ) {
109 // Include the file only once to prevent redeclaration errors.
110 require_once $full_path;
111 }
112 }
113
114 // Retrieve the list of active blocks that need to be loaded.
115 $active_blocks = Helpers::active_blocks();
116
117 if ( ! empty( $active_blocks ) ) {
118 // Loop through each active block and include its index.php file if it exists.
119 foreach ( $active_blocks as $block ) {
120 // Build the full path to the block's index.php file.
121 $file = wp_normalize_path( "{$base_dir}dist/blocks/{$block}/index.php" );
122
123 // Include the file only if it exists and is a regular file.
124 if ( is_file( $file ) ) {
125 require_once $file;
126 }
127 }
128 }
129