PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / 2.1.2
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites v2.1.2
4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 2.6.1 All 38 releases
blockspare / src / welcome.php

welcome.php in BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites 2.1.2, at src/welcome.php

108 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: Blockspare - Gutenberg Blocks
5 * Plugin URI: https://wpblockspare.com
6 * Description: An Amazing Block Library That Lets You Reimagine the Way You Use the WordPress Block Editor (Gutenberg).
7 * Author: Gambit Technologies, Inc
8 * Author URI: http://gambit.ph
9 * Text Domain: blockspare
10 * Version: 2.3.2
11 *
12 * @package Blockspare
13 */
14 // Exit if accessed directly.
15 if ( !defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 // Plugin slug.
20 defined( 'BLOCKSPARE_CLOUDFRONT_URL' ) || define( 'BLOCKSPARE_CLOUDFRONT_URL', 'https://d3gt1urn7320t9.cloudfront.net' );
21 // CloudFront CDN URL
22 /********************************************************************************************
23 * Activation & PHP version checks.
24 ********************************************************************************************/
25
26 if ( !function_exists( 'blockspare_php_requirement_activation_check' ) ) {
27 /**
28 * Upon activation, check if we have the proper PHP version.
29 * Show an error if needed and don't continue with the plugin.
30 *
31 * @since 1.9
32 */
33 function blockspare_php_requirement_activation_check()
34 {
35
36 if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) {
37 deactivate_plugins( basename( __FILE__ ) );
38 wp_die( sprintf(
39 __( '%s"Blockspare" can not be activated. %s It requires PHP version 5.3.0 or higher, but PHP version %s is used on the site. Please upgrade your PHP version first ✌️ %s Back %s', 'blockspare' ),
40 '<strong>',
41 '</strong><br><br>',
42 PHP_VERSION,
43 '<br /><br /><a href="' . esc_url( get_dashboard_url( get_current_user_id(), 'plugins.php' ) ) . '" class="button button-primary">',
44 '</a>'
45 ) );
46 }
47
48 }
49
50 register_activation_hook( __FILE__, 'blockspare_php_requirement_activation_check' );
51 }
52
53 /**
54 * Always check the PHP version at the start.
55 * If the PHP version isn't sufficient, don't continue to prevent any unwanted errors.
56 *
57 * @since 1.9
58 */
59
60 if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) {
61 if ( !function_exists( 'blockspare_php_requirement_notice' ) ) {
62 function blockspare_php_requirement_notice()
63 {
64 printf( '<div class="notice notice-error"><p>%s</p></div>', sprintf( __( '"Blockspare" requires PHP version 5.3.0 or higher, but PHP version %s is used on the site.', 'blockspare' ), PHP_VERSION ) );
65 }
66
67 }
68 add_action( 'admin_notices', 'blockspare_php_requirement_notice' );
69 return;
70 }
71
72 /**
73 * Always keep note of the Blockspare version.
74 *
75 * @since 2.0
76 */
77
78 if ( !function_exists( 'blockspare_version_upgrade_check' ) ) {
79 function blockspare_version_upgrade_check()
80 {
81 // This is triggered only when V1 was previously activated, and this is the first time V2 is activated.
82 // Will not trigger after successive V2 activations.
83 if ( get_option( 'blockspare_activation_date' ) && !get_option( 'blockspare_current_version_installed' ) ) {
84 update_option( 'blockspare_current_version_installed', '1' );
85 }
86 // Always check the current version installed. Trigger if it changes.
87
88 if ( get_option( 'blockspare_current_version_installed' ) !== BLOCKSPARE_VERSION ) {
89 do_action( 'blockspare_version_upgraded', get_option( 'blockspare_current_version_installed' ), BLOCKSPARE_VERSION );
90 update_option( 'blockspare_current_version_installed', BLOCKSPARE_VERSION );
91 }
92
93 }
94
95 add_action( 'admin_menu', 'blockspare_version_upgrade_check', 1 );
96 }
97
98 /********************************************************************************************
99 * END Activation & PHP version checks.
100 ********************************************************************************************/
101
102 /**
103 * Ready for Welcome screen.
104 */
105
106 include(BLOCKSPARE_PLUGIN_DIR . '/src/admin/admin-init.php');
107 include(BLOCKSPARE_PLUGIN_DIR . '/src/admin/admin-block-list.php');
108