| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | * Plugin Name: aBlocks |
| 4 | 4 | * Description: The WordPress plugin for creating beautiful and functional websites using the Gutenberg editor, with a variety of customizable blocks to design website pages. |
| 5 | 5 | * Requires at least: 6.8 |
| 6 | 6 | * Requires PHP: 7.4 |
| 7 | - * Version: 2.11.0 | |
| 7 | + * Version: 2.13.1 | |
| 8 | 8 | * Author: Kodezen LLC |
| 9 | 9 | * Author URI: https://ablocks.pro/ |
| 10 | 10 | * License: GPL-3.0+ |
| 11 | 11 | * License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| @@ -44,9 +44,9 @@ | ||
| 44 | 44 | /** |
| 45 | 45 | * Define the plugin constants |
| 46 | 46 | */ |
| 47 | 47 | private function define_constants() { |
| 48 | - define( 'ABLOCKS_VERSION', '2.11.0' ); | |
| 48 | + define( 'ABLOCKS_VERSION', '2.13.1' ); | |
| 49 | 49 | define( 'ABLOCKS_PLUGIN_SLUG', 'ablocks' ); |
| 50 | 50 | define( 'ABLOCKS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
| 51 | 51 | define( 'ABLOCKS_ROOT_URL', plugin_dir_url( __FILE__ ) ); |
| 52 | 52 | define( 'ABLOCKS_ASSETS_URL', ABLOCKS_ROOT_URL . 'assets/' ); |
| @@ -94,9 +94,16 @@ | ||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | public function set_global_settings() { |
| 97 | 97 | $GLOBALS['ablocks_fonts'] = json_decode( get_option( ABLOCKS_FONTS_SETTINGS_NAME, '{}' ), true ); |
| 98 | - $GLOBALS['ablocks_blocks'] = json_decode( get_option( ABLOCKS_BLOCKS_VISIBILITY_SETTINGS_NAME, '{}' ) ); | |
| 98 | + // Merge the saved visibility over the default registry so blocks added in | |
| 99 | + // a new version default to enabled (the user's saved toggles still win). | |
| 100 | + $saved_blocks = json_decode( get_option( ABLOCKS_BLOCKS_VISIBILITY_SETTINGS_NAME, '{}' ), true ); | |
| 101 | + $default_blocks = \ABlocks\Admin\Settings\Blocks::get_default_data(); | |
| 102 | + $GLOBALS['ablocks_blocks'] = (object) array_merge( | |
| 103 | + is_array( $default_blocks ) ? $default_blocks : [], | |
| 104 | + is_array( $saved_blocks ) ? $saved_blocks : [] | |
| 105 | + ); | |
| 99 | 106 | $GLOBALS['ablocks_settings'] = json_decode( get_option( ABLOCKS_SETTINGS_NAME, '{}' ) ); |
| 100 | 107 | $GLOBALS['ablocks_addons'] = json_decode( get_option( ABLOCKS_ADDONS_SETTINGS_NAME, '{}' ) ); |
| 101 | 108 | } |
| 102 | 109 | |
| @@ -113,13 +120,25 @@ | ||
| 113 | 120 | } |
| 114 | 121 | |
| 115 | 122 | public function init_plugin() { |
| 116 | 123 | ABlocks\Migration::init(); |
| 124 | + // Before anything that registers a menu, an ajax action or a REST route, | |
| 125 | + // so the capabilities those gate on already answer correctly. | |
| 126 | + ABlocks\Permissions::init(); | |
| 117 | 127 | ABlocks\PermalinkRewrite::init(); |
| 118 | 128 | ABlocks\Addons::init(); |
| 129 | + // Ahead of every block registration on `init` — aBlocks' own and any | |
| 130 | + // other plugin's — so the attribute the editor adds to every block is | |
| 131 | + // on the server's copy of it too. | |
| 132 | + ABlocks\Classes\FlexItem::init(); | |
| 133 | + // Keeps the server-side previews of dynamic blocks rendering when another | |
| 134 | + // plugin adds attributes to every block in JavaScript only. | |
| 135 | + ABlocks\Classes\BlockRendererAttributes::init(); | |
| 119 | 136 | ABlocks\Blocks::init(); |
| 120 | 137 | ABlocks\Assets::init(); |
| 121 | 138 | ABlocks\Classes\CoreFontRegistry::init(); |
| 139 | + ABlocks\Classes\GlobalClasses::init(); | |
| 140 | + ABlocks\Classes\Breakpoints::init(); | |
| 122 | 141 | ABlocks\Performance\Optimizations::init(); |
| 123 | 142 | ABlocks\Performance\DelayJs::init(); |
| 124 | 143 | ABlocks\Performance\DeferJs::init(); |
| 125 | 144 | ABlocks\Performance\ImageOptimizer::init(); |