PluginProbe ʕ •ᴥ•ʔ
FrontBlocks for Gutenberg/GeneratePress / 1.5.2
FrontBlocks for Gutenberg/GeneratePress v1.5.2
1.5.2 1.5.1 1.4.0 1.5.0 trunk 0.2.0 0.2.1 0.2.2 0.2.3 0.2.4 0.2.5 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1.0 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 ci-artifacts
frontblocks / includes / Plugin_Main.php
frontblocks / includes Last commit date
Admin 2 days ago Frontend 2 days ago Plugin_Main.php 2 days ago
Plugin_Main.php
208 lines
1 <?php
2 /**
3 * Plugin Main
4 *
5 * @package FrontBlocks
6 * @author Closemarketing
7 * @copyright 2025 Closemarketing
8 * @version 1.0.3
9 */
10
11 namespace FrontBlocks;
12
13 defined( 'ABSPATH' ) || exit;
14
15 /**
16 * Main FrontBlocks class.
17 *
18 * @since 1.0.0
19 */
20 class Plugin_Main {
21 /**
22 * Plugin instance.
23 *
24 * @var FrontBlocks
25 */
26 private static $instance = null;
27
28 /**
29 * Get plugin instance.
30 *
31 * @return FrontBlocks
32 */
33 public static function get_instance() {
34 if ( null === self::$instance ) {
35 self::$instance = new self();
36 }
37
38 return self::$instance;
39 }
40
41 /**
42 * Constructor.
43 */
44 private function __construct() {
45 $this->init();
46 }
47
48 /**
49 * Initialize the plugin.
50 *
51 * @return void
52 */
53 private function init() {
54 // Load modules.
55 $this->load_modules();
56
57 // Register scripts for conditional enqueueing.
58 add_action( 'init', array( $this, 'register_scripts' ) );
59 }
60
61 /**
62 * Load plugin modules.
63 *
64 * @return void
65 */
66 private function load_modules() {
67 // Admin settings page.
68 if ( is_admin() ) {
69 // Load Admin classes if autoloader is not available.
70 if ( ! class_exists( 'FrontBlocks\Admin\UI' ) ) {
71 require_once FRBL_PLUGIN_PATH . 'includes/Admin/UI.php';
72 }
73 if ( ! class_exists( 'FrontBlocks\Admin\Settings' ) ) {
74 require_once FRBL_PLUGIN_PATH . 'includes/Admin/Settings.php';
75 }
76 new Admin\Settings();
77
78 if ( ! class_exists( 'FrontBlocks\Admin\ReviewNotice' ) ) {
79 require_once FRBL_PLUGIN_PATH . 'includes/Admin/ReviewNotice.php';
80 }
81 new Admin\ReviewNotice();
82
83 if ( ! class_exists( 'FrontBlocks\Admin\RedundantPlugins' ) ) {
84 require_once FRBL_PLUGIN_PATH . 'includes/Admin/RedundantPlugins.php';
85 }
86 new Admin\RedundantPlugins();
87 }
88
89 // Container Edge Alignment for GenerateBlocks.
90 new Frontend\ContainerEdgeAlignment();
91
92 // Carousel module.
93 new Frontend\Carousel();
94
95 // Animations module.
96 new Frontend\Animations();
97
98 // Sticky Column module.
99 new Frontend\StickyColumn();
100
101 // Gallery module.
102 new Frontend\Gallery();
103
104 // Insert Post Block module.
105 new Frontend\InsertPost();
106
107 // Testimonials module (includes settings).
108 new Frontend\Testimonials();
109
110 // Headline module (GenerateBlocks Headline enhancements).
111 new Frontend\Headline();
112
113 // Product Categories module (WooCommerce) — only when WooCommerce is active.
114 if ( class_exists( 'WooCommerce' ) ) {
115 new Frontend\ProductCategories();
116 }
117
118 // Counter module (GenerateBlocks Headline counter effect).
119 new Frontend\Counter();
120
121 // Reading Time module.
122 new Frontend\ReadingTime();
123
124 // Reading Progress Bar module.
125 new Frontend\ReadingProgress();
126
127 // Back Button module.
128 new Frontend\BackButton();
129
130 // Scroll to Top module.
131 new Frontend\ScrollTop();
132
133 // Events module.
134 new Frontend\Events();
135
136 // Shape Animations module (for GenerateBlocks Shape block).
137 new Frontend\ShapeAnimations();
138
139 // Gravity Forms Inline Layout module.
140 new Frontend\GravityFormsInline();
141
142 // Fluid Typography module (GeneratePress Pro integration).
143 new Frontend\FluidTypography();
144
145 // Stacked Images module.
146 new Frontend\StackedImages();
147
148 // Block Patterns module (WordPress block patterns registration).
149 new Frontend\BlockPatterns();
150
151 // FAQ Schema module (FAQPage JSON-LD for core/details and GB accordion).
152 new Frontend\FaqSchema();
153
154 // Text Animation block.
155 new Frontend\TextAnimation();
156
157 // Before After comparison block.
158 new Frontend\BeforeAfter();
159
160 // SVG Upload module (allows SVG files in the media library).
161 new Frontend\SvgUpload();
162
163 // Columns Same Height module (equal-height columns for native columns block).
164 new Frontend\ColumnsSameHeight();
165
166 // Download Button module (download option for the native button block).
167 new Frontend\DownloadButton();
168
169 // Maintenance Mode module.
170 new Frontend\Maintenance();
171
172 // Cookie Notice module.
173 new Frontend\CookieNotice();
174
175 // User Text block is provided by FrontBlocks Pro when license is active.
176 }
177
178 /**
179 * Register scripts for conditional enqueueing.
180 *
181 * @return void
182 */
183 public function register_scripts() {
184 wp_register_style(
185 'frontblocks-carousel',
186 FRBL_PLUGIN_URL . 'assets/carousel/frontblocks-carousel.css',
187 array(),
188 FRBL_VERSION
189 );
190
191 wp_register_script(
192 'frontblocks-carousel',
193 FRBL_PLUGIN_URL . 'assets/carousel/glide.min.js',
194 array(),
195 FRBL_VERSION,
196 true
197 );
198
199 wp_register_script(
200 'frontblocks-carousel-custom',
201 FRBL_PLUGIN_URL . 'assets/carousel/frontblocks-carousel.js',
202 array( 'frontblocks-carousel' ),
203 FRBL_VERSION,
204 true
205 );
206 }
207 }
208