| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Ultimate Blocks |
| 4 |
* Plugin URI: https://ultimateblocks.com/ |
| 5 |
* Description: Custom Blocks for Bloggers and Marketers. Create Better Content With Gutenberg. |
| 6 |
* Author: Ultimate Blocks |
| 7 |
* Author URI: https://ultimateblocks.com/ |
| 8 |
* Version: 2.4.2 |
| 9 |
* License: GPL3+ |
| 10 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt |
| 11 |
* Text Domain: ultimate-blocks |
| 12 |
* Domain Path: /languages |
| 13 |
* |
| 14 |
* @package UB |
| 15 |
*/ |
| 16 |
|
| 17 |
// Exit if accessed directly. |
| 18 |
if ( ! defined( 'ABSPATH' ) ) { |
| 19 |
exit; |
| 20 |
} |
| 21 |
|
| 22 |
if ( ! function_exists( 'ub_fs' ) ) { |
| 23 |
// Create a helper function for easy SDK access. |
| 24 |
function ub_fs() { |
| 25 |
global $ub_fs; |
| 26 |
|
| 27 |
if ( ! isset( $ub_fs ) ) { |
| 28 |
// Include Freemius SDK. |
| 29 |
require_once dirname(__FILE__) . '/includes/freemius/start.php'; |
| 30 |
|
| 31 |
$ub_fs = fs_dynamic_init( array( |
| 32 |
'id' => '1798', |
| 33 |
'slug' => 'ultimate-blocks', |
| 34 |
'type' => 'plugin', |
| 35 |
'public_key' => 'pk_bd3d3c8e255543256632fd4bb9842', |
| 36 |
'is_premium' => false, |
| 37 |
'has_addons' => false, |
| 38 |
'has_paid_plans' => false, |
| 39 |
'menu' => array( |
| 40 |
'slug' => 'ultimate-blocks-settings', |
| 41 |
'first-path' => 'admin.php?page=ultimate-blocks-help', |
| 42 |
'account' => false, |
| 43 |
'support' => false, |
| 44 |
), |
| 45 |
) ); |
| 46 |
} |
| 47 |
|
| 48 |
return $ub_fs; |
| 49 |
} |
| 50 |
|
| 51 |
// Init Freemius. |
| 52 |
ub_fs(); |
| 53 |
// Signal that SDK was initiated. |
| 54 |
do_action( 'ub_fs_loaded' ); |
| 55 |
} |
| 56 |
|
| 57 |
require_once 'includes/class-ultimate-blocks-constants.php'; |
| 58 |
|
| 59 |
/** |
| 60 |
* Currently plugin version. |
| 61 |
* Start at version 1.0.0 and use SemVer - https://semver.org |
| 62 |
*/ |
| 63 |
define( 'ULTIMATE_BLOCKS_VERSION', Ultimate_Blocks_Constants::plugin_version() ); |
| 64 |
/** |
| 65 |
* Plugin Name |
| 66 |
*/ |
| 67 |
define( 'ULTIMATE_BLOCKS_NAME', Ultimate_Blocks_Constants::plugin_name() ); |
| 68 |
/** |
| 69 |
* Plugin Path |
| 70 |
*/ |
| 71 |
define( 'ULTIMATE_BLOCKS_PATH', Ultimate_Blocks_Constants::plugin_path() ); |
| 72 |
/** |
| 73 |
* Plugin URL |
| 74 |
*/ |
| 75 |
define( 'ULTIMATE_BLOCKS_URL', Ultimate_Blocks_Constants::plugin_url() ); |
| 76 |
/** |
| 77 |
* Plugin TextDomain |
| 78 |
*/ |
| 79 |
define( 'ULTIMATE_BLOCKS_TEXT_DOMAIN', Ultimate_Blocks_Constants::text_domain() ); |
| 80 |
|
| 81 |
/** |
| 82 |
* Block Initializer. |
| 83 |
*/ |
| 84 |
require_once plugin_dir_path( __FILE__ ) . 'src/init.php'; |
| 85 |
|
| 86 |
|
| 87 |
/** |
| 88 |
* The code that runs during plugin activation. |
| 89 |
* This action is documented in includes/class-ultimate-blocks-activator.php |
| 90 |
*/ |
| 91 |
function activate_ultimate_blocks() { |
| 92 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-ultimate-blocks-activator.php'; |
| 93 |
Ultimate_Blocks_Activator::activate(); |
| 94 |
} |
| 95 |
|
| 96 |
/** |
| 97 |
* The code that runs during plugin deactivation. |
| 98 |
* This action is documented in includes/class-ultimate-blocks-deactivator.php |
| 99 |
*/ |
| 100 |
function deactivate_ultimate_blocks() { |
| 101 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-ultimate-blocks-deactivator.php'; |
| 102 |
Ultimate_Blocks_Deactivator::deactivate(); |
| 103 |
} |
| 104 |
|
| 105 |
register_activation_hook( __FILE__, 'activate_ultimate_blocks' ); |
| 106 |
register_deactivation_hook( __FILE__, 'deactivate_ultimate_blocks' ); |
| 107 |
|
| 108 |
if ( ! function_exists( 'ub_safe_welcome_redirect' ) ) { |
| 109 |
|
| 110 |
add_action( 'admin_init', 'ub_safe_welcome_redirect' ); |
| 111 |
|
| 112 |
function ub_safe_welcome_redirect() { |
| 113 |
|
| 114 |
if ( ! get_transient( '_welcome_redirect_ub' ) ) { |
| 115 |
return; |
| 116 |
} |
| 117 |
|
| 118 |
delete_transient( '_welcome_redirect_ub' ); |
| 119 |
|
| 120 |
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
| 121 |
return; |
| 122 |
} |
| 123 |
|
| 124 |
wp_safe_redirect( add_query_arg( |
| 125 |
array( |
| 126 |
'page' => 'ultimate-blocks-help' |
| 127 |
), |
| 128 |
admin_url( 'admin.php' ) |
| 129 |
) ); |
| 130 |
|
| 131 |
} |
| 132 |
|
| 133 |
} |
| 134 |
|
| 135 |
/** |
| 136 |
* The core plugin class that is used to define internationalization, |
| 137 |
* admin-specific hooks, and public-facing site hooks. |
| 138 |
*/ |
| 139 |
require plugin_dir_path( __FILE__ ) . 'includes/class-ultimate-blocks.php'; |
| 140 |
|
| 141 |
/** |
| 142 |
* Begins execution of the plugin. |
| 143 |
* |
| 144 |
* Since everything within the plugin is registered via hooks, |
| 145 |
* then kicking off the plugin from this point in the file does |
| 146 |
* not affect the page life cycle. |
| 147 |
* |
| 148 |
* @since 1.0.2 |
| 149 |
*/ |
| 150 |
function run_ultimate_blocks() { |
| 151 |
|
| 152 |
$plugin = new Ultimate_Blocks(); |
| 153 |
$plugin->run(); |
| 154 |
|
| 155 |
} |
| 156 |
run_ultimate_blocks(); |