| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Gutenify - Visual Site Builder Blocks & Site Templates |
| 4 |
* Description: Gutenify - Visual Site Builder Blocks & Site Templates is a collection of Gutenberg Advance Fullsite Editing Blocks & site templates that is compatible with WordPress Full Site Editing to help you create the website you always wanted. |
| 5 |
* Author: Gutenify |
| 6 |
* Author URI: https://www.gutenify.com |
| 7 |
* Plugin URI: https://www.gutenify.com |
| 8 |
* Version: 1.6.3 |
| 9 |
* Text Domain: gutenify |
| 10 |
* Domain Path: /languages |
| 11 |
* Tested up to: 6.9 |
| 12 |
* Requires at least: 6.4 |
| 13 |
* Requires PHP: 5.5 |
| 14 |
* License: GPLv3 |
| 15 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html |
| 16 |
* |
| 17 |
* |
| 18 |
* @package Gutenify |
| 19 |
*/ |
| 20 |
|
| 21 |
// Exit if accessed directly. |
| 22 |
defined('ABSPATH') || exit; |
| 23 |
|
| 24 |
// Define constants. |
| 25 |
define('GUTENIFY_VERSION', '1.6.3'); |
| 26 |
define('GUTENIFY_BASE_DIR', plugin_dir_path(__FILE__)); |
| 27 |
define('GUTENIFY_BASE_URL', trailingslashit(plugin_dir_url(__FILE__))); |
| 28 |
define('GUTENIFY_BASE_FILE', __FILE__); |
| 29 |
define( |
| 30 |
'GUTENIFY_BRAND_LOGO', |
| 31 |
'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwODAgMTA4MCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTA4MCAxMDgwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KICAuc3QwIHsNCiAgICBmaWxsOiAjRkZGRkZGOw0KICB9DQoNCiAgLnN0MSB7DQogICAgZmlsbDogIzY3QkM0NTsNCiAgfQ0KDQo8L3N0eWxlPg0KPGc+DQogIDxnPg0KICAgIDxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04MjguNSw1NTIuOWMtNi44LDE1Mi45LTEzMy4zLDI3NS4xLTI4Ny45LDI3NS4xYy0xNTguOSwwLTI4OC4yLTEyOS4zLTI4OC4yLTI4OC4yDQoJCSAgICAgIGMwLTE1MC42LDExNi4yLTI3NC41LDI2My41LTI4Ny4xVjAuNEMyMjkuMSwxMy4yLDAuNSwyNDkuOSwwLjUsNTM5LjljMCwyOTguMiwyNDEuNyw1NDAuMSw1NDAuMSw1NDAuMQ0KCQkgICAgICBjMjkzLjksMCw1MzMtMjM0LjgsNTM5LjgtNTI3SDgyOC41VjU1Mi45eiIgLz4NCiAgICA8cmVjdCB4PSI1MTguOSIgeT0iMjU0LjYiIGNsYXNzPSJzdDEiIHdpZHRoPSIzMDkuOCIgaGVpZ2h0PSIyOTguMiIgLz4NCiAgPC9nPg0KPC9nPg0KPC9zdmc+DQo=' |
| 32 |
); |
| 33 |
|
| 34 |
if (!class_exists('Gutenify')) { |
| 35 |
|
| 36 |
final class Gutenify |
| 37 |
{ |
| 38 |
|
| 39 |
/** |
| 40 |
* Holds the class instance. |
| 41 |
* |
| 42 |
* @var Gutenify |
| 43 |
*/ |
| 44 |
private static $instance = null; |
| 45 |
|
| 46 |
/** |
| 47 |
* Plugin base URL. |
| 48 |
* |
| 49 |
* @var string |
| 50 |
*/ |
| 51 |
private static $base_url = ''; |
| 52 |
|
| 53 |
/** |
| 54 |
* Get the singleton instance. |
| 55 |
* |
| 56 |
* @return Gutenify |
| 57 |
*/ |
| 58 |
public static function instance() |
| 59 |
{ |
| 60 |
if (is_null(self::$instance)) { |
| 61 |
self::$instance = new self(); |
| 62 |
} |
| 63 |
return self::$instance; |
| 64 |
} |
| 65 |
|
| 66 |
/** |
| 67 |
* Gutenify constructor. |
| 68 |
*/ |
| 69 |
private function __construct() |
| 70 |
{ |
| 71 |
self::$base_url = GUTENIFY_BASE_URL; |
| 72 |
$this->define_hooks(); |
| 73 |
$this->bootstrap(); |
| 74 |
} |
| 75 |
|
| 76 |
/** |
| 77 |
* Define plugin hooks. |
| 78 |
*/ |
| 79 |
private function define_hooks() |
| 80 |
{ |
| 81 |
add_filter('gutenify_plugin_constants', array($this, 'add_plugin_constants')); |
| 82 |
// Uncomment if you want activation redirect. |
| 83 |
// add_action( 'activated_plugin', array( $this, 'activation_redirect' ) ); |
| 84 |
} |
| 85 |
|
| 86 |
/** |
| 87 |
* Provide plugin constants merged with args. |
| 88 |
* |
| 89 |
* @param array $args |
| 90 |
* @return array |
| 91 |
*/ |
| 92 |
public function add_plugin_constants($args) |
| 93 |
{ |
| 94 |
return wp_parse_args($args, $this->get_constants()); |
| 95 |
} |
| 96 |
|
| 97 |
/** |
| 98 |
* Get all plugin constants as array. |
| 99 |
* |
| 100 |
* @return array |
| 101 |
*/ |
| 102 |
public function get_constants() |
| 103 |
{ |
| 104 |
$title = 'Gutenify'; |
| 105 |
return array( |
| 106 |
'title' => $title, |
| 107 |
'prefix' => 'gutenify', |
| 108 |
'slug' => 'gutenify', |
| 109 |
'authorWebSite' => 'https://gutenify.com', |
| 110 |
'authorDemoWebSite' => 'https://demo.gutenify.com', |
| 111 |
'authorWebSiteProPage' => 'https://gutenify.com/pricing', |
| 112 |
'authorWebSiteSupport' => 'https://gutenify.com/product-support', |
| 113 |
'plugin_main_slug' => 'gutenify', |
| 114 |
'plugin_main_camel_case_name' => 'gutenify', |
| 115 |
'plugin_main_function_prefix' => 'gutenify', |
| 116 |
'plugin_main_base_url' => GUTENIFY_BASE_URL, |
| 117 |
'plugin_main_base_dir' => GUTENIFY_BASE_DIR, |
| 118 |
'plugin_main_version' => GUTENIFY_VERSION, |
| 119 |
'plugin_main_post_type_prefix' => 'gutenify', |
| 120 |
'plugin_main_site_domain' => 'gutenify.com', |
| 121 |
'core_base_dir' => GUTENIFY_BASE_DIR . 'core/', |
| 122 |
'core_base_url' => GUTENIFY_BASE_URL . 'core/', |
| 123 |
'brand_color' => '#2196f3', |
| 124 |
'pro_title' => $title . ' Pro', |
| 125 |
); |
| 126 |
} |
| 127 |
|
| 128 |
/** |
| 129 |
* Load bootstrap and pro if available. |
| 130 |
*/ |
| 131 |
private function bootstrap() |
| 132 |
{ |
| 133 |
require_once GUTENIFY_BASE_DIR . 'core/inc/bootstrap.php'; |
| 134 |
if ( |
| 135 |
function_exists('gutenify_pro') |
| 136 |
&& defined('GUTENIFY_PRO_VERSION') |
| 137 |
&& version_compare(GUTENIFY_PRO_VERSION, '1.1.5', '>') |
| 138 |
) { |
| 139 |
gutenify_pro(); |
| 140 |
} |
| 141 |
} |
| 142 |
|
| 143 |
/** |
| 144 |
* Optionally redirect to Gutenify page on plugin activation. |
| 145 |
* |
| 146 |
* @param string $plugin Plugin basename. |
| 147 |
*/ |
| 148 |
public function activation_redirect($plugin) |
| 149 |
{ |
| 150 |
if (function_exists('get_current_screen')) { |
| 151 |
$screen = get_current_screen(); |
| 152 |
if (!empty($screen->id) && 'appearance_page_tgmpa-install-plugins' === $screen->id) { |
| 153 |
return false; |
| 154 |
} |
| 155 |
} |
| 156 |
if ($plugin === plugin_basename(__FILE__)) { |
| 157 |
wp_safe_redirect(admin_url('admin.php?page=gutenify')); |
| 158 |
exit; |
| 159 |
} |
| 160 |
} |
| 161 |
} |
| 162 |
} |
| 163 |
|
| 164 |
/** |
| 165 |
* Initialize the Gutenify plugin. |
| 166 |
*/ |
| 167 |
function gutenify() |
| 168 |
{ |
| 169 |
return Gutenify::instance(); |
| 170 |
} |
| 171 |
|
| 172 |
// Initialize plugin immediately. |
| 173 |
gutenify(); |
| 174 |
|