PluginProbe ʕ •ᴥ•ʔ
FrontBlocks for Gutenberg/GeneratePress / 1.3.0
FrontBlocks for Gutenberg/GeneratePress v1.3.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 7 months ago Frontend 7 months ago Plugin_Main.php 7 months ago
Plugin_Main.php
148 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 // General enqueue scripts.
58 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 );
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 new Admin\Settings();
70 }
71
72 // Container Edge Alignment for GenerateBlocks.
73 new Frontend\ContainerEdgeAlignment();
74
75 // Carousel module.
76 new Frontend\Carousel();
77
78 // Animations module.
79 new Frontend\Animations();
80
81 // Sticky Column module.
82 new Frontend\StickyColumn();
83
84 // Gallery module.
85 new Frontend\Gallery();
86
87 // Insert Post Block module.
88 new Frontend\InsertPost();
89
90 // Testimonials module (includes settings).
91 new Frontend\Testimonials();
92
93 // Headline module (GenerateBlocks Headline enhancements).
94 new Frontend\Headline();
95
96 // Product Categories module (WooCommerce).
97 new Frontend\ProductCategories();
98
99 // Counter module (GenerateBlocks Headline counter effect).
100 new Frontend\Counter();
101
102 // Reading Time module.
103 new Frontend\ReadingTime();
104
105 // Reading Progress Bar module.
106 new Frontend\ReadingProgress();
107
108 // Back Button module.
109 new Frontend\BackButton();
110
111 // Shape Animations module (for GenerateBlocks Shape block).
112 new Frontend\ShapeAnimations();
113
114 // Gravity Forms Inline Layout module.
115 new Frontend\GravityFormsInline();
116 }
117
118 /**
119 * Enqueue scripts.
120 *
121 * @return void
122 */
123 public function enqueue_scripts() {
124 wp_enqueue_style(
125 'frontblocks-carousel',
126 FRBL_PLUGIN_URL . 'assets/carousel/frontblocks-carousel.css',
127 array(),
128 FRBL_VERSION
129 );
130
131 wp_enqueue_script(
132 'frontblocks-carousel-custom',
133 FRBL_PLUGIN_URL . 'assets/carousel/frontblocks-carousel.js',
134 array( 'frontblocks-carousel' ),
135 FRBL_VERSION,
136 true
137 );
138
139 wp_enqueue_script(
140 'frontblocks-carousel',
141 FRBL_PLUGIN_URL . 'assets/carousel/glide.min.js',
142 array(),
143 FRBL_VERSION,
144 true
145 );
146 }
147 }
148