is_plugin_installed( 'cm-blocks/cm-blocks.php' ); } private function is_cm_blocks_active(): bool { return defined( 'CM_BLOCK_VERSION' ); } protected function __construct() { add_action( 'admin_notices', [ $this, 'printNotice' ] ); add_action( 'wp_ajax_cm_theme_dismiss_notice', [ $this, 'handle_dismiss' ] ); add_action( 'wp_ajax_cm_theme_install_cm_blocks', [ $this, 'handle_install_cm_blocks' ] ); } public function handle_dismiss() { $nonce = sanitize_text_field( filter_input( INPUT_POST, 'nonce' ) ); if ( ! wp_verify_nonce( $nonce, 'cm-theme-dismiss-notice' ) ) { wp_send_json_error( [ 'Invalid nonce', $nonce ] ); } $user = get_current_user_id(); update_user_meta( $user, 'cm_theme_user_dismissed_notice', true ); wp_send_json_success( 'Success' ); } public function handle_install_cm_blocks() { $nonce = sanitize_text_field( filter_input( INPUT_POST, 'nonce' ) ); if ( ! wp_verify_nonce( $nonce, 'cm-theme-install-cm-blocks' ) ) { wp_send_json_error( [ 'Invalid nonce', $nonce ] ); } $installer = new PluginInstaller( 'cm-blocks', 'cm-blocks' ); $result = $installer->installAndActivate(); if ( $result instanceof WP_Error ) { if ( is_wp_error( $result ) ) { wp_send_json_error( array( 'message' => $result->get_error_message() ) ); } } wp_send_json_success( array( 'message' => $result ) ); } public function printNotice() { if ( ! current_user_can( 'install_plugins' ) ) { return; } global $pagenow; $user_id = get_current_user_id(); $notice_dismissed = get_user_meta( $user_id, 'cm_theme_user_dismissed_notice', true ); $page = filter_input( INPUT_GET, 'page', FILTER_UNSAFE_RAW ); if ( defined( 'CM_BLOCK_VERSION' ) ) { return; } elseif ( ! empty( $notice_dismissed ) ) { return; } elseif ( isset( $pagenow ) && $pagenow == 'admin.php' && $page == 'canvas-info' ) { return; } ?> get_notice_translations(); ?>

get('Name') ) ) ?>

We strongly recommend you to use the CM Blocks plugin.
Simple to use and designed for impact, CM Blocks makes creating stunning, user-friendly sites a breeze.
Unlock powerful features like starter sites, a design library, and versatile blocks for endless creativity!