| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: GSlider Blocks |
| 4 |
* Description: Enhance your site with dynamic, customizable, and multi-functional slider blocks to create a more engaging and functional experience. |
| 5 |
* Author: Noruzzaman |
| 6 |
* Author URI: https://github.com/noruzzamans/ |
| 7 |
* Version: 1.1.8 |
| 8 |
* Text Domain: gslider-blocks |
| 9 |
* Domain Path: /languages |
| 10 |
* License: GPLv2 or later |
| 11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 12 |
* |
| 13 |
* @package GSlider_Blocks |
| 14 |
* @since 1.0.0 |
| 15 |
*/ |
| 16 |
|
| 17 |
if ( ! defined( 'ABSPATH' ) ) { |
| 18 |
exit; |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Loads the Composer autoloader if available. |
| 23 |
* |
| 24 |
* @since 1.0.0 |
| 25 |
*/ |
| 26 |
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { |
| 27 |
require_once __DIR__ . '/vendor/autoload.php'; |
| 28 |
} |
| 29 |
|
| 30 |
if ( ! class_exists( 'GSliderBlocks' ) ) { |
| 31 |
|
| 32 |
/** |
| 33 |
* Main entry point class for the GSlider Blocks plugin. |
| 34 |
* |
| 35 |
* Defines plugin constants, loads dependencies, and |
| 36 |
* bootstraps the plugin via a singleton pattern. |
| 37 |
* |
| 38 |
* @since 1.0.0 |
| 39 |
*/ |
| 40 |
final class GSliderBlocks { |
| 41 |
|
| 42 |
/** |
| 43 |
* The single instance of the plugin class. |
| 44 |
* |
| 45 |
* @since 1.0.0 |
| 46 |
* |
| 47 |
* @var GSliderBlocks|null |
| 48 |
*/ |
| 49 |
private static $instance; |
| 50 |
|
| 51 |
/** |
| 52 |
* Returns the singleton instance of the plugin. |
| 53 |
* |
| 54 |
* Creates a new instance if one does not already exist. |
| 55 |
* |
| 56 |
* @since 1.0.0 |
| 57 |
* |
| 58 |
* @return GSliderBlocks The singleton instance. |
| 59 |
*/ |
| 60 |
public static function getInstance() { |
| 61 |
if ( ! isset( self::$instance ) ) { |
| 62 |
self::$instance = new self(); |
| 63 |
} |
| 64 |
return self::$instance; |
| 65 |
} |
| 66 |
|
| 67 |
/** |
| 68 |
* Initializes the plugin by defining constants and loading files. |
| 69 |
* |
| 70 |
* @since 1.0.0 |
| 71 |
*/ |
| 72 |
public function __construct() { |
| 73 |
$this->define_constants(); |
| 74 |
$this->includes(); |
| 75 |
} |
| 76 |
|
| 77 |
/** |
| 78 |
* Defines plugin-wide constants. |
| 79 |
* |
| 80 |
* Sets up file paths, URLs, version numbers, and |
| 81 |
* environment information used throughout the plugin. |
| 82 |
* |
| 83 |
* @since 1.0.0 |
| 84 |
* |
| 85 |
* @return void |
| 86 |
*/ |
| 87 |
public function define_constants() { |
| 88 |
define( 'GSLIDER_FILE', __FILE__ ); |
| 89 |
define( 'GSLIDER_SLUG', 'gslider-blocks' ); |
| 90 |
define( 'GSLIDER_VERSION', '1.1.8' ); |
| 91 |
define( 'GSLIDER_DIR_PATH', plugin_dir_path( __FILE__ ) ); |
| 92 |
define( 'GSLIDER_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 93 |
define( 'GSLIDER_WP_VERSION', (float) get_bloginfo( 'version' ) ); |
| 94 |
define( 'GSLIDER_PHP_VERSION', (float) phpversion() ); |
| 95 |
} |
| 96 |
|
| 97 |
/** |
| 98 |
* Includes required plugin files. |
| 99 |
* |
| 100 |
* @since 1.0.0 |
| 101 |
* |
| 102 |
* @return void |
| 103 |
*/ |
| 104 |
private function includes() { |
| 105 |
require_once trailingslashit( GSLIDER_DIR_PATH ) . 'includes/Plugin.php'; |
| 106 |
} |
| 107 |
} |
| 108 |
} |
| 109 |
|
| 110 |
/** |
| 111 |
* Returns the singleton instance of the GSliderBlocks plugin. |
| 112 |
* |
| 113 |
* Global helper function for convenient access to the |
| 114 |
* plugin instance from anywhere in the codebase. |
| 115 |
* |
| 116 |
* @since 1.0.0 |
| 117 |
* |
| 118 |
* @return GSliderBlocks The plugin instance. |
| 119 |
*/ |
| 120 |
function GSliderBlocks() { |
| 121 |
return GSliderBlocks::getInstance(); |
| 122 |
} |
| 123 |
|
| 124 |
/** |
| 125 |
* Initialize the plugin. |
| 126 |
* |
| 127 |
* @since 1.0.0 |
| 128 |
*/ |
| 129 |
GSliderBlocks::getInstance(); |
| 130 |
|
| 131 |
|