<?php 
/**
 * TPGB Gutenberg Settings Options
 * @since 1.0.0
 *
 */
if (!defined('ABSPATH')) {
    exit;
}

class Tpgb_Gutenberg_Settings_Options {
	
	/**
     * Setting Name/Title
     * @var string
     */
    protected $setting_name = '';
    protected $setting_logo = '';
	
	/**
     * Options Page hook
     * @var string
     */
    protected $block_lists = [];
	protected $block_extra = [];
	
	/**
     * Constructor
     * @since 1.0.0
     */
    public function __construct() {
		if( is_admin() ){

            add_action('init', [$this, 'nexter_block_init']);
		
			add_action( 'wp_ajax_tpgb_blocks_opts_save', array( $this,'tpgb_blocks_opts_save_action') );
			add_action( 'wp_ajax_tpgb_connection_data_save', array( $this,'tpgb_connection_data_save_action') );
			add_action( 'wp_ajax_tpgb_custom_css_js_save', array( $this,'tpgb_custom_css_js_save_action') );
			add_action( 'wp_ajax_tpgb_is_block_used_not', array( $this, 'tpgb_is_block_used_not_fun' ) );
			add_action( 'wp_ajax_tpgb_unused_disable_block', array( $this, 'tpgb_disable_unsed_block_fun' ) );
			add_action( 'wp_ajax_tpgb_performance_opt_cache', array( $this,'tpgb_performance_opt_cache_save_action') );
			
            if(!defined('NEXTER_EXT_VER')){
			    add_action( 'admin_enqueue_scripts', array( $this, 'tpgb_dash_admin_scripts' ), 10, 1 );
            }
			// Install WdesignKit
			add_action( 'wp_ajax_nexter_ext_plugin_install', [ $this, 'nexter_ext_plugin_install_ajax']);

			// Remove All Notice From Dashboard Screnn
			add_action( 'admin_head', array( $this,'nxt_remove_admin_notices_page') );


			// Install Nexter Theme
			add_action( 'wp_ajax_nexter_ext_theme_install', array( $this,'nexter_ext_theme_install_ajax') );

			// add Filter to Enable All Block 
			add_filter( 'tpgb_blocks_enable_all', array( $this, 'tpgb_blocks_enable_all_filter' ) );

			// Scan Unused Block & Disabled it filter function
			add_filter( 'tpgb_disable_unsed_block_filter', array( $this, 'tpgb_disable_unsed_block_filter_fun' ) );

            // Wdesignkit Block Enable Ajax
            add_action( 'wp_ajax_nxt_wdk_widget_ajax_call', array( $this,'nxt_wdk_widget_ajax_callback') );

            // WDesignKit Template Block List Merge hook
            add_filter( 'nexter_block_list_merge', [$this, 'nexter_block_list_merge_action'] , 10, 1 );

            // Store User Data in Database From Onborading
            add_action('wp_ajax_nxt_boarding_store', array($this, 'nxt_block_boarding_store'));

            add_filter( 'nxt_dashboard_localize_data', array( $this, 'localize_data' ),10,1 );

            add_filter( 'admin_body_class', function( $classes ) {
                if ( isset($_GET['page']) && $_GET['page'] === 'nxt_builder' ) {
                    $classes .= ' post-type-nxt_builder nxt-page-nexter-builder ';
                }
                return $classes;
            }, 11);

            add_action( 'wp_ajax_nexter_temp_api_call', [ $this, 'nexter_temp_api_call' ] );
		}
		
    }

    /**
     * Initiate Nexter Block
     * @since 4.2.0
     */

     public function nexter_block_init(){
        if(defined('TPGBP_VERSION')){
            $options = get_option( 'tpgb_white_label' );
            $this->setting_name = ( isset($options['brand_name']) && !empty($options['brand_name']) ) ? $options['brand_name'] : ( !empty($options['tpgb_plugin_name'])  ? $options['tpgb_plugin_name'] : __('Nexter','the-plus-addons-for-block-editor') ) ;
			$this->setting_logo = ( isset($options['theme_logo']) && !empty($options['theme_logo']) ) ? $options['theme_logo'] : ( isset($options['tpgb_plus_logo']) && !empty($options['tpgb_plus_logo'])  ? $options['tpgb_plus_logo'] : esc_url(TPGB_URL . 'dashboard/assets/svg/nexter-logo.svg') );
        }else{
            $this->setting_name = esc_html__('Nexter', 'the-plus-addons-for-block-editor');
			$this->setting_logo = esc_url(TPGB_URL . 'dashboard/assets/svg/nexter-logo.svg');
        }

        $this->block_listout();
    }

	/**
     * Initiate our hooks
     * @since 1.0.0
     */
	public function hooks() {
		if( is_admin() ){
            add_action( 'nxt_new_update_notice' , array( $this, 'nxt_new_update_notice_callback' ) );
            if( !defined('NEXTER_EXT_VER') ){
			    add_action('admin_menu', array( $this, 'add_options_page' ));
            }
		}
    }

    /**
     * Replace Textdomain Recursive
     * @since 4.6.0
     */
    public function nxt_replace_blockcate_domain( $array ) {

        foreach ( $array as $key => $item ) {
            if ( isset( $item['block_cate'] ) ) {
    
                // Replace ONLY the text-domain inside esc_html__()
                $array[$key]['block_cate'] = str_replace(
                    "the-plus-addons-for-block-editor",
                    "nexter-extension",
                    $item['block_cate']
                );
            }
        }
    
        return $array;
    }

    /**
     * Localize Data
     * @since 4.6.0
     */
    public function localize_data( $data ) {
		$default_load=get_option( 'tpgb_normal_blocks_opts' );
		//Apply Filters
        $nxt_format_widget = [];
        if ( has_filter( 'nxt_wdk_widget_ajax_call' ) ) {
            $wdk_widget_data = apply_filters('nxt_wdk_widget_ajax_call', 'nxt_wdk_get_widget_ajax');
            foreach ($wdk_widget_data as $block) {
                $uniqueKey = isset($block['title']) ? $block['title'] : 'block_' . $block['id'];
            
                $nxt_format_widget[$uniqueKey] = [
                    'label'      => esc_html($block['title']),
                    'demoUrl'    => esc_url($block['live_demo']),
                    'docUrl'     => '',
                    'videoUrl'   => '',
                    'tag'        => $block['free_pro'] === 'pro' ? 'pro' : 'free',
                    'block_cate' => esc_html__('WDesignKit', 'nexter-extension'),
                    'keyword'    => [],
                    'w_unique'   => $block['id'],
                    'uniqueId'   => $block['w_unique'],
                ];
                if (isset($block['w_type']) && !empty($block['w_type'])) {
                    if( $block['w_type'] === 'Publish' ){
                        $nxt_format_widget[$uniqueKey]['w_type'] = 'Publish';
                    }else if( $block['w_type'] === 'Draft' ){
                        $nxt_format_widget[$uniqueKey]['w_type'] = 'Draft';
                    }
                    
                }
            }
        }
		
		//Merge WDesignKit Block List
		$data['tpgb_nonce'] = wp_create_nonce( 'nexter_admin_nonce' );
		$data['tpgb_url'] = TPGB_URL.'dashboard/';
		$data['tpgb_pro'] = defined('TPGBP_VERSION');
		$data['dashData']['blockList'] = array_merge($this->nxt_replace_blockcate_domain($this->block_lists),$this->nxt_replace_blockcate_domain($this->block_extra),(array) $nxt_format_widget);
		$data['dashData']['avtiveBlock'] = ( isset( $default_load['enable_normal_blocks'] )  && is_array( $default_load['enable_normal_blocks'] ) ) ? count( array_filter( $default_load['enable_normal_blocks'], function( $block ) { return strpos( $block, 'tp-' ) === 0; }) ) : 0;
		$data['dashData']['enableBlock'] = array_merge( is_array($default_load['enable_normal_blocks']) ? $default_load['enable_normal_blocks'] : [], isset($default_load['tp_extra_option']) && is_array($default_load['tp_extra_option']) ? $default_load['tp_extra_option'] : [] );
		$data['dashData']['extOption'] = get_option('tpgb_connection_data');
		$data['dashData']['rollbacVer'] = Tpgb_Rollback::get_rollback_versions();
		$data['dashData']['tpgb_keyActmsg'] = class_exists('Tpgb_Pro_Library') ? Tpgb_Pro_Library::tpgb_pro_activate_msg() : '';
		//$data['dashData']['nxtactivateKey'] = get_option('tpgb_activate');
		$data['dashData']['tpgb_activePlan'] = ( class_exists('Tpgb_Pro_Library') && method_exists('Tpgb_Pro_Library', 'tpgb_get_activate_plan') ) ? Tpgb_Pro_Library::tpgb_get_activate_plan() : '';
		$data['dashData']['cacheData'] = [ get_option('tpgb_performance_cache') , get_option('tpgb_delay_css_js') , get_option('tpgb_defer_css_js') ];
		$data['dashData']['customCode'] = get_option('tpgb_custom_css_js');
        $data['dashData']['nxt_onboarding'] = get_option('nxt_onboarding_done');
        $data['dashData']['nxt_wdkit_url'] = 'https://wdesignkit.com/';
        $data['dashData']['extensionPro'] = defined('NXT_PRO_EXT_VER');
		return $data;
	}

    public function nxt_new_update_notice_callback(){
        $data = get_option( 'nxt_ext_menu_notice_count', [] );
        if ( ! is_array( $data ) ) {
            $data = [];
        }
        $flag = isset( $data['notice_flag'] ) ? intval( $data['notice_flag'] ) : 1;
        $data['menu_notice_count'] = $flag;
        update_option( 'nxt_ext_menu_notice_count', $data );

    }

    public function nxt_notice_should_show(){
        $data = get_option( 'nxt_ext_menu_notice_count', [] );
        if ( ! is_array( $data ) ) {
            return false;
        }
        $menu_count = isset( $data['menu_notice_count'] ) ? intval( $data['menu_notice_count'] ) : 0;
        $flag       = isset( $data['notice_flag'] ) ? intval( $data['notice_flag'] ) : 1;
        return $menu_count < $flag;
    }

	/**
     * Add menu options page
     * @since 1.0.0
     */
	public function add_options_page(){
		global $submenu;
		unset($submenu['themes.php'][20]);
		unset($submenu['themes.php'][15]);

        $options = get_option( 'tpgb_white_label' );
        
        // Set default or dynamic icon
        $menu_icon = 'dashicons-nxt-builder-groups';
        if ( isset( $options['theme_logo'] ) && !empty( $options['theme_logo'] ) ) {
            $menu_icon = esc_url( $options['theme_logo'] );
        }else if( isset( $options['tpgb_plus_logo'] ) && !empty( $options['tpgb_plus_logo'] ) ) {
            $menu_icon = esc_url( $options['tpgb_plus_logo'] );
        }

		add_menu_page( 
			esc_html( $this->setting_name ),
			esc_html( $this->setting_name ),
			'manage_options',
			'nexter_welcome',
			array( $this, 'nexter_ext_dashboard' ),
			$menu_icon,
			58
		);

		add_submenu_page(
			'nexter_welcome',
			__( 'Dashboard', 'the-plus-addons-for-block-editor' ),
			__( 'Dashboard', 'the-plus-addons-for-block-editor' ),
			'manage_options',
			'nexter_welcome',
		);

        if( !isset($options['nxt_template_tab']) || ( isset($options['nxt_template_tab']) && $options['nxt_template_tab'] !== 'on' )  ) {
            add_submenu_page(
                'nexter_welcome',
                __( 'Templates', 'the-plus-addons-for-block-editor' ),
                __( 'Templates', 'the-plus-addons-for-block-editor' ),
                'manage_options',
                'nexter_welcome#/templates',
                array( $this, 'nexter_ext_dashboard' ),
            );
        }
		add_submenu_page(
			'nexter_welcome',
			__( 'Blocks', 'the-plus-addons-for-block-editor' ),
			__( 'Blocks', 'the-plus-addons-for-block-editor' ),
			'manage_options',
			'nexter_welcome#/blocks',
			array( $this, 'nexter_ext_dashboard' ),
		);
        add_submenu_page(
            'nexter_welcome',
            __( 'Theme Builder', 'the-plus-addons-for-block-editor' ),
            __( 'Theme Builder', 'the-plus-addons-for-block-editor' ),
            'manage_options',
            'nxt_builder',
            array($this, 'nexter_blocks_builder_display')
        );
		add_submenu_page(
			'nexter_welcome',
			__( 'Code Snippets', 'the-plus-addons-for-block-editor' ),
			__( 'Code Snippets', 'the-plus-addons-for-block-editor' ),
			'manage_options',
			'nxt_code_snippets',
			array($this, 'nexter_code_snippet_display'),
		);
		add_submenu_page(
			'nexter_welcome',
			__( 'Extensions', 'the-plus-addons-for-block-editor' ),
			__( 'Extensions', 'the-plus-addons-for-block-editor' ),
			'manage_options',
			'nexter_welcome#/utilities',
			array( $this, 'nexter_ext_dashboard' ),
		);
		add_submenu_page(
			'nexter_welcome',
			__( 'Theme Customizer', 'the-plus-addons-for-block-editor' ),
			__( 'Theme Customizer', 'the-plus-addons-for-block-editor' ),
			'manage_options',
			'nexter_welcome#/theme_customizer',
			array( $this, 'nexter_ext_dashboard' ),
		);
        
        add_submenu_page( 'nexter_welcome', esc_html__( 'Patterns', 'the-plus-addons-for-block-editor' ), esc_html__( 'Patterns', 'the-plus-addons-for-block-editor' ), 'manage_options', esc_url( admin_url('edit.php?post_type=wp_block') ));

		if( !defined('TPGBP_VERSION') ){
			add_submenu_page( 
				'nexter_welcome', 
				esc_html__( 'Get Pro Nexter', 'the-plus-addons-for-block-editor' ), 
				esc_html__( 'Get Pro Nexter', 'the-plus-addons-for-block-editor' ), 
				'manage_options', 
				esc_url('https://nexterwp.com/pricing/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings')
			);
		}
        
		add_action('admin_footer', array($this, 'nxt_link_in_new_tab'));

		// Hook to modify the submenu head title
		//add_action('admin_menu', array($this, 'nxt_submenu_head_title') , 101);
	}

	/**
     * Parent Page Rename in Sub menu
     * @since 2.0.0
     */
	public function nxt_submenu_head_title() {
		global $submenu;
		if ( isset($submenu['nexter_welcome'] )) {
			$submenu['nexter_welcome'][0][0] = esc_html__( 'Dashboard', 'the-plus-addons-for-block-editor' );
		}
	}

	/**
     * Open Link in New Tab Wordpress Menu
     * @since 2.0.0
     */
	public function nxt_link_in_new_tab(){
		?>
		<script type="text/javascript">
			document.addEventListener('DOMContentLoaded', function() {
				var upgradeLink = document.querySelector('a[href*="https://nexterwp.com/pricing/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings"]');
				if (upgradeLink) {
					upgradeLink.setAttribute('target', '_blank');
					upgradeLink.setAttribute('rel', 'noopener noreferrer');
				}
                <?php if( $this->nxt_notice_should_show() ) { ?> 
                    var menuItem = document.querySelector('.toplevel_page_nexter_welcome.menu-top');
                    if (menuItem) {
                        menuItem.classList.add('nxt-admin-notice-active');
                    } 
                <?php } ?>

                // const menuLinks = document.querySelectorAll( "#toplevel_page_nexter_welcome_page .wp-submenu a" );

                // menuLinks.forEach((link) => {
                //     if (link.href.includes("nexter_welcome_page#")) {
                //     link.addEventListener("click", (e) => {
                //         e.preventDefault();
                //         const url = new URL(link.href);
                //         window.location.hash = url.hash; // update hash only
                //     });
                //     }
                // });
			});
		</script>
		<?php
	}

	/*
	 * Enqueue DashBoard Scripts admin area.
	 * @since 2.0.0
	 */
	/*
	 * Enqueue DashBoard Scripts admin area.
	 * @since 2.0.0
	 */
	public function tpgb_dash_admin_scripts( $page ) {
        
        $wdadded = false;
		$nxtextension = false;

        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
		$pluginslist = get_plugins();
		if ( isset( $pluginslist[ 'wdesignkit/wdesignkit.php' ] ) && !empty( $pluginslist[ 'wdesignkit/wdesignkit.php' ] ) ) {
			if( is_plugin_active('wdesignkit/wdesignkit.php') ){
				$wdadded = true;
			}
		}

        $extensionactivate = false;
		if ( isset( $pluginslist[ 'nexter-extension/nexter-extension.php' ] ) && !empty( $pluginslist[ 'nexter-extension/nexter-extension.php' ] ) ) {
			if( is_plugin_active('nexter-extension/nexter-extension.php') ){
				$nxtextension = true;
			}else{
                $extensionactivate = true;
            }
		}

		if ( isset($_GET['page']) && $_GET['page'] === 'nexter_welcome') {
			$this->tpgb_dash_enqueue_style();
		    $this->tpgb_dash_enqueue_scripts();
		}else if( isset($_GET['page']) && $_GET['page'] === 'nxt_builder' ){
            // Theme Builder JS Enqueue
            wp_enqueue_style( 'nexter-theme-builder', TPGB_URL . 'dashboard/theme-builder/build/index.css', array(), TPGB_VERSION, 'all' );

            wp_enqueue_script( 'nexter-theme-builder', TPGB_URL . 'dashboard/theme-builder/build/index.js', array('react', 'react-dom', 'wp-dom-ready', 'wp-i18n'), TPGB_VERSION, true );

            $nexter_theme_builder_config = array(
                'adminUrl' => admin_url(),
                'ajaxurl' => admin_url('admin-ajax.php'),
                'ajax_nonce' => wp_create_nonce('nexter_admin_nonce'),
                'assets' => TPGB_URL . 'dashboard/theme-builder/assets/',
                'is_pro' => (defined('NXT_PRO_EXT')) ? true : false,
                'dashboard_url' => admin_url( 'admin.php?page=nexter_welcome' ),
                'version' => TPGB_VERSION,
                'import_temp_nonce' => wp_create_nonce('nxt_ajax'),
                'wdkPlugin' => $wdadded,
                'extensioninstall' => $nxtextension,
                'extensionactivate' => $extensionactivate,
            );

            wp_localize_script( 'nexter-theme-builder', 'nexter_theme_builder_config', $nexter_theme_builder_config );

            wp_set_script_translations( 'nexter-theme-builder', 'the-plus-addons-for-block-editor', TPGB_PATH . '/languages/');
            
        }else if( isset($_GET['page']) && $_GET['page'] === 'nxt_code_snippets' ){
           
            wp_enqueue_style( 'nxt-code-snippet-style', TPGB_URL . 'dashboard/code-snippets/index.css', array(), TPGB_VERSION, 'all' );

            wp_enqueue_script( 'nxt-code-snippet', TPGB_URL . 'dashboard/code-snippets/index.js', array(), TPGB_VERSION, true );
            
            // Attach JavaScript translations
            wp_set_script_translations(
                'nxt-code-snippet',
                'the-plus-addons-for-block-editor',
            );
            wp_localize_script(
                'nxt-code-snippet',
                'nxt_code_snippet_data',
                array(
                    'ajax_url'    => admin_url( 'admin-ajax.php' ),
                    'ajax_nonce' => wp_create_nonce('nexter_admin_nonce'),
                    'extensioninstall' => $nxtextension,
                    'extensionactivate' => $extensionactivate,
                )
            );
        }
		
	}

	/*
	 * Enqueue Styles admin area.
	 * @since 2.0.0
	 */
	public function tpgb_dash_enqueue_style() {
		wp_enqueue_style( 'tpgb-dash-style', TPGB_URL . 'dashboard/build/index.css', array(), TPGB_VERSION, 'all' );
	}

	/**
	 * Enqueue script admin area.
	 *
	 * @since 2.0.0
	 */
	public function tpgb_dash_enqueue_scripts() {
		$user = wp_get_current_user();
		$default_load=get_option( 'tpgb_normal_blocks_opts' );
		$rollback_url = wp_nonce_url(admin_url('admin-post.php?action=tpgb_rollback&version=TPGB_VERSION'), 'tpgb_rollback');
		$dashData = [];
		$wdadded = false;
		$nxtextension = false;
		$uichemy = false;
		$nxtheme = false;
        $plusAddons = false ;

		include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

		$pluginslist = get_plugins();

        $wdkactive = false;
		if ( isset( $pluginslist[ 'wdesignkit/wdesignkit.php' ] ) && !empty( $pluginslist[ 'wdesignkit/wdesignkit.php' ] ) ) {
			if( is_plugin_active('wdesignkit/wdesignkit.php') ){
				$wdadded = true;
			}else{
                $wdkactive = true;
            }
		}

        $extensionactivate = false;
		if ( isset( $pluginslist[ 'nexter-extension/nexter-extension.php' ] ) && !empty( $pluginslist[ 'nexter-extension/nexter-extension.php' ] ) ) {
			if( is_plugin_active('nexter-extension/nexter-extension.php') ){
				$nxtextension = true;
			}else{
                $extensionactivate = true;
            }
		}

        $nxtPlugin = false;
        $tpgbactivate = false;
        if ( isset( $pluginslist[ 'the-plus-addons-for-block-editor/the-plus-addons-for-block-editor.php' ] ) && !empty( $pluginslist[ 'the-plus-addons-for-block-editor/the-plus-addons-for-block-editor.php' ] ) ) {
            if( is_plugin_active('the-plus-addons-for-block-editor/the-plus-addons-for-block-editor.php') ){
                $nxtPlugin = true;
            }else{
                $tpgbactivate = true;
            }
        }

        $uichemyactive = false;
		if ( isset( $pluginslist[ 'uichemy/uichemy.php' ] ) && !empty( $pluginslist[ 'uichemy/uichemy.php' ] ) ) {
			if( is_plugin_active('uichemy/uichemy.php') ){
				$uichemy = true;
			}else{
                $uichemyactive = true;
			}
		}

		$active_theme = wp_get_theme();
		$theme_name = $active_theme->get('Name');
		if( isset($theme_name) && !empty($theme_name) && $theme_name == 'Nexter' ){
			$nxtheme = true;
		}else if ( file_exists( WP_CONTENT_DIR.'/themes/'.'nexter') && $theme_name != 'Nexter' ) {
			$nxtheme = 'available';
		}

        $tpaeactive = false;
        if ( isset( $pluginslist[ 'the-plus-addons-for-elementor-page-builder/theplus_elementor_addon.php' ] ) && !empty( $pluginslist[ 'the-plus-addons-for-elementor-page-builder/theplus_elementor_addon.php' ] ) ) {
            if( is_plugin_active('the-plus-addons-for-elementor-page-builder/theplus_elementor_addon.php') ){
                $plusAddons = true;
            }else{
                $tpaeactive = true;
            }
        }

        //Apply Filters
        $nxt_format_widget = [];
        if ( has_filter( 'nxt_wdk_widget_ajax_call' ) ) {
            $wdk_widget_data = apply_filters('nxt_wdk_widget_ajax_call', 'nxt_wdk_get_widget_ajax');
            foreach ($wdk_widget_data as $block) {
                $uniqueKey = isset($block['title']) ? $block['title'] : 'block_' . $block['id'];
            
                $nxt_format_widget[$uniqueKey] = [
                    'label'      => esc_html($block['title']),
                    'demoUrl'    => esc_url($block['live_demo']),
                    'docUrl'     => '',
                    'videoUrl'   => '',
                    'tag'        => $block['free_pro'] === 'pro' ? 'pro' : 'free',
                    'block_cate' => esc_html__('WDesignKit', 'the-plus-addons-for-block-editor'),
                    'keyword'    => [],
                    'w_unique'   => $block['id'],
                    'uniqueId'   => $block['w_unique'],
                ];

                if (isset($block['w_type']) && !empty($block['w_type'])) {
                    if( $block['w_type'] === 'Publish' ){
                        $nxt_format_widget[$uniqueKey]['w_type'] = 'Publish';
                    }else if( $block['w_type'] === 'Draft' ){
                        $nxt_format_widget[$uniqueKey]['w_type'] = 'Draft';
                    }
                    
                }
            }
        }
        
        if ( is_multisite() ) {
            $main_site_id = get_main_site_id();
            $licence_key = get_blog_option( $main_site_id, 'tpgb_activate', [] );
            if(empty($licence_key)){
                    $licence_key = get_option('tpgb_activate');
            }
        }else{
                $licence_key = get_option('tpgb_activate');
        }

		if ( $user ){
			$dashData = [
				'userData' => [
					'userName' => esc_html($user->display_name),
					'profileLink' => esc_url( get_avatar_url( $user->ID ) ),
                    'userEmail' => get_option('admin_email'),
                    'siteUrl' => get_option('siteurl'),
				],
                'whiteLabelData' => [
                        'brandname' => $this->setting_name,
                        'brandlogo' => $this->setting_logo
                    ],
				'blockList'   => array_merge( $this->block_extra, $this->block_lists,(array) $nxt_format_widget),
				'avtiveBlock' => ( isset( $default_load['enable_normal_blocks'] )  && is_array( $default_load['enable_normal_blocks'] ) ) ? count( array_filter( $default_load['enable_normal_blocks'], function( $block ) { return strpos( $block, 'tp-' ) === 0; }) ) : 0,
				'enableBlock' => array_merge( is_array($default_load['enable_normal_blocks']) ? $default_load['enable_normal_blocks'] : [], isset($default_load['tp_extra_option']) && is_array($default_load['tp_extra_option']) ? $default_load['tp_extra_option'] : [] ),
				'extOption' => get_option('tpgb_connection_data'),
				'cacheData' => [ get_option('tpgb_performance_cache') , get_option('tpgb_delay_css_js') , get_option('tpgb_defer_css_js') ],
				'customCode' => get_option('tpgb_custom_css_js'),
				'rollbacVer' => Tpgb_Rollback::get_rollback_versions(),
				'rollbackUrl' => $rollback_url,
				'wdadded' => $wdadded,
                'nexterBlock' => $nxtPlugin,
                'tpgbinstall' => $nxtPlugin,
                'nexterThemeActive' => (defined('NXT_VERSION')) ? true : false,
				'wdTemplates' => [],
				'nexterext' => $nxtextension,
                'extensioninstall'=>$nxtextension,
                'extensionPro' =>  defined('NXT_PRO_EXT_VER'),
				'wpVersion' => get_bloginfo('version'),
				'pluginVer' => TPGB_VERSION,
				'uichemy' => $uichemy,
				'nextheme' => $nxtheme,
                'nexterThemeIntall' =>  $nxtheme,
                'nexterCustLink' => admin_url('customize.php'),
				'whiteLabel' => get_option('tpgb_white_label'),
				'keyActmsg' => class_exists('Tpgb_Pro_Library') ? Tpgb_Pro_Library::tpgb_pro_activate_msg() : '',
				'nxtactivateKey' => $licence_key,
				'activePlan' => ( class_exists('Tpgb_Pro_Library') && method_exists('Tpgb_Pro_Library', 'tpgb_get_activate_plan') ) ? Tpgb_Pro_Library::tpgb_get_activate_plan() : '',
                'showSidebar' => $this->nxt_notice_should_show(),
                'nxt_onboarding' => get_option('nxt_onboarding_done'),
                'tpaeAddon'=>$plusAddons,
                'nxtThemeSetting' => (array) get_option( 'nexter_settings_opts', [] ),
                'nxt_wdkit_url'=> 'https://wdesignkit.com/',
                'extensionactivate' => $extensionactivate,
                'tpgbactivate' => $tpgbactivate,
                'tpaeactive' => $tpaeactive,
                'wdkactive' => $wdkactive,
                'uichemyactive' => $uichemyactive,
                'nexterThemeDet' => admin_url('themes.php').'?theme=nexter'
			];
		}

		wp_enqueue_script( 'nexter-dashscript', TPGB_URL . 'dashboard/build/index.js', array( 'react', 'react-dom','wp-i18n', 'wp-dom-ready', 'wp-element','wp-components', 'wp-block-editor', 'wp-editor' ), TPGB_VERSION, true );
        
		wp_localize_script(
			'nexter-dashscript',
			'nxtext_ajax_object',
			array(
				'adminUrl' => admin_url(),
				'ajax_url'    => admin_url( 'admin-ajax.php' ),
				'ajax_nonce'       => wp_create_nonce( 'nexter_admin_nonce' ),
                'nxtex_url' => TPGB_URL . 'dashboard/',
				'tpgb_url' => TPGB_URL.'dashboard/',
				'pro' => defined('TPGBP_VERSION'),
				'dashData' => $dashData
			)
		);

        wp_set_script_translations( 'nexter-dashscript', 'the-plus-addons-for-block-editor' , TPGB_PATH . '/languages/' );
	}

	/*
	 * Install Wdesignkit Plugin
	 * @since 1.4.0
	 */
    public function nexter_ext_plugin_install_ajax(){

        check_ajax_referer( 'nexter_admin_nonce', 'nexter_nonce' );

        if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
            wp_send_json_error( array( 'content' => __( 'Insufficient permissions.', 'the-plus-addons-for-block-editor' ) ) );
        }

        $plu_slug = ( isset( $_POST['slug'] ) && !empty( $_POST['slug'] ) ) ? sanitize_text_field( wp_unslash($_POST['slug']) ) : '';


        $phpFileName = $plu_slug;
        if(!empty($plu_slug) && $plu_slug == 'the-plus-addons-for-elementor-page-builder'){
            $phpFileName = 'theplus_elementor_addon';
        }

        $installed_plugins = get_plugins();

        include_once ABSPATH . 'wp-admin/includes/file.php';
        include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
        include_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';
        include_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php';

        $result   = array();
        $response = wp_remote_post(
            'http://api.wordpress.org/plugins/info/1.0/',
            array(
                'body' => array(
                    'action'  => 'plugin_information',
                    'request' => serialize(
                        (object) array(
                            'slug'   => $plu_slug,
                            'fields' => array(
                                'version' => false,
                            ),
                        )
                    ),
                ),
            )
        );

        $plugin_info = unserialize( wp_remote_retrieve_body( $response ) );

        if ( ! $plugin_info ) {
            wp_send_json_error( array( 'content' => __( 'Failed to retrieve plugin information.', 'nexter-extension' ) ) );
        }

        $skin     = new \Automatic_Upgrader_Skin();
        $upgrader = new \Plugin_Upgrader( $skin );

        $plugin_basename = ''.$plu_slug.'/'.$phpFileName.'.php';

        if ( ! isset( $installed_plugins[ $plugin_basename ] ) && empty( $installed_plugins[ $plugin_basename ] ) ) {
            $installed = $upgrader->install( $plugin_info->download_link );
            $activation_result = activate_plugin( $plugin_basename );
            if(!empty($plu_slug) && $plu_slug == 'wdesignkit'){
                $this->wdk_installed_settings_enable();
            }
            $success = null === $activation_result;
            wp_send_json(['Sucees' => true]);
        } elseif ( isset( $installed_plugins[ $plugin_basename ] ) ) {
            $activation_result = activate_plugin( $plugin_basename );
            if(!empty($plu_slug) && $plu_slug == 'wdesignkit'){
                $this->wdk_installed_settings_enable();
            }
            $success = null === $activation_result;
            wp_send_json(['Sucees' => true]);
        }

    }

    public function wdk_installed_settings_enable(){

        if( defined( 'TPGB_VERSION' ) ){
            $settings = array('gutenberg_builder' => true,'gutenberg_template' => true);
            $builder = array( 'elementor' );
            do_action( 'wdkit_active_settings', $settings, $builder );
        }else if( defined('ELEMENTOR_VERSION') ){
            $settings = array('elementor_builder' => true,'elementor_template' => true);
            $builder = array( 'nexter-blocks');
            do_action( 'wdkit_active_settings', $settings, $builder );
        }

    }

	/*
	 * Install Nexter Theme
	 * @since 2.0.0
	 */
    public function nexter_ext_theme_install_ajax(){
        check_ajax_referer( 'nexter_admin_nonce', 'nexter_nonce' ); 

        if ( !current_user_can( 'manage_options' ) ) {
            wp_send_json_error( __( 'You are not allowed to do this action', 'nexter-extension' ) );
        }
        
        $theme_slug = (!empty($_POST['slug'])) ? sanitize_key( wp_unslash( $_POST['slug'] ) ) : 'nexter';
        $theme_api_url = 'https://api.wordpress.org/themes/info/1.0/';

        // Parameters for the request

        $args = array(
            'body' => array(
                'action' => 'theme_information',
                'request' => serialize((object) array(
                    'slug' => 'nexter',
                    'fields' => [
                        'description' => false,
                        'sections' => false,
                        'rating' => true,
                        'ratings' => false,
                        'downloaded' => true,
                        'download_link' => true,
                        'last_updated' => true,
                        'homepage' => true,
                        'tags' => true,
                        'template' => true,
                        'active_installs' => false,
                        'parent' => false,
                        'versions' => false,
                        'screenshot_url' => true,
                        'active_installs' => false
                    ],

                ))),
        );

        // Make the request
        $response = wp_remote_post($theme_api_url, $args);

        // Check for errors
        if (is_wp_error($response)) {
            $error_message = $response->get_error_message();
             wp_send_json(['Sucees' => false]);
        } else {
            $theme_info = unserialize( $response['body'] );
            $theme_name = $theme_info->name;
            $theme_zip_url = $theme_info->download_link;
            global $wp_filesystem;

            // Install the theme
            $theme = wp_remote_get( $theme_zip_url );
            if ( ! function_exists( 'WP_Filesystem' ) ) {
                require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' );
            }

            WP_Filesystem();
            $active_theme = wp_get_theme();
            $theme_name = $active_theme->get('Name');

            $wp_filesystem->put_contents( WP_CONTENT_DIR.'/themes/'.$theme_slug . '.zip', $theme['body'] );

            $zip = new ZipArchive();
            if ( $zip->open( WP_CONTENT_DIR . '/themes/' . $theme_slug . '.zip' ) === true ) {
                $zip->extractTo( WP_CONTENT_DIR . '/themes/' );
                $zip->close();
            }
            $wp_filesystem->delete( WP_CONTENT_DIR . '/themes/' . $theme_slug . '.zip' );
            wp_send_json(['Sucees' => true]);
        }

        exit;

    }

	/*
	 * Remove All Notice From Dash Board
	 * @since 2.0.0
	 */
	public function nxt_remove_admin_notices_page(){
		$current_screen = get_current_screen();
    
		if ($current_screen->base == 'toplevel_page_nexter_welcome_page') {
			$this->nxt_remove_all_actions('admin_notices');
			$this->nxt_remove_all_actions('all_admin_notices');
		}
	}

	/*
	 * Helper function to remove all actions for a specific hook
	 * @since 2.0.0
	 */
	public function nxt_remove_all_actions($hook_name){
		global $wp_filter;

		if (isset($wp_filter[$hook_name])) {
			unset($wp_filter[$hook_name]);
		}
	}


	/*
	 * Save Performance Cache Option 
	 * @since 1.4.0
	 */
	public function tpgb_performance_opt_cache_save_action(){
		check_ajax_referer('nexter_admin_nonce', 'security');
		
		if((isset($_POST['perf_caching']) && !empty($_POST['perf_caching'])) || isset($_POST['delay_js']) || isset($_POST['defer_js'])){
			$action_page = 'tpgb_performance_cache';
			$perf_caching = wp_unslash( sanitize_text_field( $_POST['perf_caching'] ) );
			if ( FALSE === get_option($action_page) ){
				add_option( $action_page, $perf_caching );
			}else{
				update_option( $action_page, $perf_caching );
			}

			$action_page = 'tpgb_delay_css_js';
			$delay_js = wp_unslash( sanitize_text_field( $_POST['delay_js'] ) );
			if ( FALSE === get_option($action_page) ){
				add_option( $action_page, $delay_js );
			}else{
				update_option( $action_page, $delay_js );
			}
			$action_page = 'tpgb_defer_css_js';
			$defer_js = wp_unslash( sanitize_text_field( $_POST['defer_js'] ) );
			if ( FALSE === get_option($action_page) ){
				add_option( $action_page, $defer_js );
			}else{
				update_option( $action_page, $defer_js );
			}
			wp_send_json_success();
		}
		wp_send_json_error();
	}

	public function tpgb_blocks_opts_save_action() {
		$action_page = 'tpgb_normal_blocks_opts';
		if ( ! current_user_can( 'manage_options' ) ) {
			wp_redirect( esc_url( admin_url('admin.php?page='.$action_page) ) );
		}
		if(isset($_POST["submit-key"]) && !empty($_POST["submit-key"]) && $_POST["submit-key"]=='Save'){
			
			if ( ! isset( $_POST['nonce_tpgb_normal_blocks_opts'] ) || ! wp_verify_nonce( sanitize_key($_POST['nonce_tpgb_normal_blocks_opts']), 'nexter_admin_nonce' ) ) { //nonce_tpgb_normal_blocks_action
			   wp_redirect( esc_url(admin_url('admin.php?page='.$action_page)) );
			} else {
				Tpgb_Library()->remove_backend_dir_files();
				if ( FALSE === get_option($action_page) ){
					$default_value = array('enable_normal_blocks' => '' , 'tp_extra_option' => '');
					add_option($action_page,$default_value);
					wp_redirect( esc_url(admin_url('admin.php?page=tpgb_normal_blocks_opts')) );
				}
				else{
					$update_value = array('enable_normal_blocks' => '');
					if(isset($_POST['enable_normal_blocks']) && !empty($_POST['enable_normal_blocks'])){
						$blockList = map_deep(wp_unslash(json_decode(stripslashes($_POST['enable_normal_blocks']), true)), 'sanitize_text_field');

						if(is_array($blockList)){
							$update_value = array('enable_normal_blocks' => $blockList );
						}else{
							$update_value = array('enable_normal_blocks' => sanitize_text_field($blockList) );
						}
					}
					
					$update_extra_val = array('tp_extra_option' => '');
					if(isset($_POST['tp_extra_option']) && !empty($_POST['tp_extra_option'])){
						$extraList = map_deep(wp_unslash(json_decode(stripslashes($_POST['tp_extra_option']), true)), 'sanitize_text_field');
    
						if(is_array($extraList)){
							$update_extra_val = array('tp_extra_option' =>  $extraList);
						}else{
							$update_extra_val = array('tp_extra_option' => sanitize_text_field($extraList) );
						}
					}
					
					$block_value = array_merge( $update_value , $update_extra_val );
					
					$updated = update_option($action_page, $block_value);
                    $response = '';
                    if ( has_filter( 'nxt_wdk_widget_ajax_call' ) ) {
                        $response = apply_filters( 'nxt_wdk_widget_ajax_call', 'wdk_update_widget' );
                    }

					if ($updated) {
						wp_send_json(['Success' => true]);
					} else {
						wp_send_json(['Success' => false]);
					}
				}
			}

		}else{
			wp_send_json(['Sucees' => false]);
		}
	}

	public function tpgb_connection_data_save_action(){
		$action_page = 'tpgb_connection_data';
		if ( ! current_user_can( 'manage_options' ) ) {
			wp_redirect( esc_url( admin_url('admin.php?page='.$action_page) ) );
		}
		if(isset($_POST["submit-key"]) && !empty($_POST["submit-key"]) && $_POST["submit-key"]=='Save'){
			if ( ! isset( $_POST['nonce_tpgb_connection_data'] ) || ! wp_verify_nonce( sanitize_key($_POST['nonce_tpgb_connection_data']), 'nexter_admin_nonce' ) ) {
				wp_redirect( esc_url(admin_url('admin.php?page='.$action_page)) );
			} else {
				$getArr = array_map('sanitize_text_field', $_POST);
				unset($getArr['nonce_tpgb_connection_data']);
				unset($getArr['_wp_http_referer']);
				unset($getArr['action']);
				unset($getArr['submit-key']);

				$getArr = json_decode(stripslashes( $getArr['tpgb_connection_data'] ),true);
				if ( FALSE === get_option($action_page) ){
					$added = add_option($action_page,$getArr);
					if ($added) {
						wp_send_json(['Success' => true]);
					} else {
						wp_send_json(['Success' => false]);
					}
				}else{
					$updated = update_option( $action_page, $getArr );
					if ($updated) {
						wp_send_json(['Success' => true]);
					} else {
						wp_send_json(['Success' => false]);
					}
					wp_redirect( esc_url( admin_url('admin.php?page='.$action_page) ) );
				}
			}
		}else{
			wp_redirect( esc_url( admin_url('admin.php?page='.$action_page) ) );
		}

	}

	public function tpgb_custom_css_js_save_action(){
		$action_page = 'tpgb_custom_css_js';
		if ( ! current_user_can( 'manage_options' ) ) {
			wp_send_json(['Success' => false]);
		}
		if(isset($_POST["submit-key"]) && !empty($_POST["submit-key"]) && $_POST["submit-key"]=='Save'){
			if ( ! isset( $_POST['nonce_tpgb_custom_css_js'] ) || ! wp_verify_nonce( sanitize_key($_POST['nonce_tpgb_custom_css_js']), 'nexter_admin_nonce' ) ) {
				wp_send_json(['Success' => false]);
			} else {
				$getArr = $_POST;
				unset($getArr['nonce_tpgb_custom_css_js']);
				unset($getArr['_wp_http_referer']);
				unset($getArr['action']);
				unset($getArr['submit-key']);

				$getArr['tpgb_custom_js_editor'] = isset($getArr['tpgb_custom_js_editor']) ? stripslashes($getArr['tpgb_custom_js_editor']) : '';
				$getArr['tpgb_custom_css_editor'] = isset($getArr['tpgb_custom_css_editor']) ? stripslashes($getArr['tpgb_custom_css_editor']) : '';
				if ( FALSE === get_option($action_page) ){
					add_option($action_page,$getArr);
					wp_send_json(['Success' => true]);
				}else{
					update_option( $action_page, $getArr );
					wp_send_json(['Success' => true]);
				}
			}
		}else{
			wp_send_json(['Success' => false]);
		}
	}

    public function block_listout(){
		$this->block_lists = [
			'tp-accordion' => [
				'label' => esc_html__('Accordion','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-accordion-toggle/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-accordion-toggle/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Tabbed', 'the-plus-addons-for-block-editor'),
				'keyword' => ['accordion', 'tabs', 'toggle', 'faq', 'collapse', 'show hide content', 'Tiles'],
			],
			'tp-advanced-buttons' => [
				'label' => esc_html__('Pro Buttons', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-pro-button/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-pro-button/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Button', 'CTA', 'link', 'creative button', 'Call to action', 'Marketing Button'],
			],
			'tp-advanced-chart' => [
				'label' => esc_html__('Advanced Chart', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-advanced-charts-and-graph/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/advanced-charts/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['chart', 'diagram'],
			],
			'tp-adv-typo' => [
				'label' => esc_html__('Advanced Typography', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-advanced-typography/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/advanced-typography/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['adv','text','typo'],
			],
			'tp-animated-service-boxes' => [
				'label' => esc_html__('Animated Service Boxes', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-animated-service-boxes/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/animated-service-boxes/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
			],
			'tp-audio-player' => [
				'label' => esc_html__('Audio Player','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-audio-music-player/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/audio-player/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['audio player', 'music player'],
			],
			'tp-before-after' => [
				'label' => esc_html__('Before After', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-before-after-image-comparison-slider/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/before-after/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
			],
			'tp-blockquote' => [
				'label' => esc_html__('Blockquote','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-blockquote-block/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/blockquote/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
                'keyword' => ['blockquote', 'Block Quotation', 'Citation', 'Pull Quotes','block quote'],
			],
			'tp-breadcrumbs' => [
				'label' => esc_html__('Breadcrumbs','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-breadcrumb-bar/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/breadcrumb/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['breadcrumbs bar', 'breadcrumb trail', 'navigation', 'site navigation', 'breadcrumb navigation']
			],
			'tp-button' => [
				'label' => esc_html__('Advanced Button','the-plus-addons-for-block-editor'),				
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-advanced-button/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/advance-button/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Button', 'CTA', 'link', 'creative button', 'Call to action', 'Marketing Button']
			],
			'tp-button-core' => [
				'label' => esc_html__('Button','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-button/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-button/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['core button','Button', 'CTA', 'link', 'creative button', 'Call to action', 'Marketing Button']
			],
			'tp-anything-carousel' => [
				'label' => esc_html__('Carousel Anything','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-advanced-carousel-sliders/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-advanced-carousel-sliders/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['carousel anything', 'slider', 'slideshow'],
			],
			'tp-carousel-remote' => [
				'label' => esc_html__('Carousel Remote','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-remote-sync/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-remote-sync/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
                'keyword' => ['carousel remote', 'slider controller','next prev','dots','Remote Sync'],
			],
			'tp-circle-menu' => [
				'label' => esc_html__('Circle Menu', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-circle-menu/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/circle-menu/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['circle menu', 'compact menu', 'mobile menu']
			],
			'tp-code-highlighter' => [
				'label' => esc_html__('Code Highlighter', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-source-code-syntax-highlighter/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['prism', 'Source code beautifier', 'code Highlighter',  'syntax Highlighter', 'Custom Code', 'CSS', 'JS', 'PHP', 'HTML', 'React']
			],
			'tp-countdown' => [
				'label' => esc_html__('Countdown','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-countdown-timer/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/countdown/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Countdown', 'countdown timer', 'timer', 'Scarcity Countdown', 'Urgency Countdown', 'Event countdown', 'Sale Countdown', 'chronometer', 'stopwatch']
			],
			'tp-container' => [
				'label' => esc_html__('Container','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-container/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/container/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['container','flex-wrap','flex-based','full-width']
			],
			'tp-coupon-code' => [
				'label' => esc_html__('Coupon Code', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-coupon-code/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/coupon-code/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Coupon Code', 'Promo Code', 'Offers' , 'Discounts', 'Sales', 'Copy Coupon Code']
			],
			'tp-creative-image' => [
				'label' => esc_html__('Advanced Image','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-advanced-image/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/advanced-image/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#video',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Creative image', 'Image', 'Animated Image', 'ScrollReveal', 'scrolling image', 'decorative image', 'image effect', 'Photo', 'Visual']
			],
			'tp-cta-banner' => [
				'label' => esc_html__('CTA Banner','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-cta-banner/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/cta-banner/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['advertisement', 'banner', 'advertisement banner', 'ad manager', 'announcement', 'announcement banner']
			],
			'tp-data-table' => [
				'label' => esc_html__('Data Table','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-data-table/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-data-table/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Data table', 'datatable', 'grid', 'csv table', 'table', 'tabular layout', 'Table Showcase']
			],
			'tp-dark-mode' => [
				'label' => esc_html__('Dark Mode','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-dark-mode-switcher/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/dark-mode/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['dark', 'light', 'darkmode', 'dual']
			],
			'tp-design-tool' => [
				'label' => esc_html__('Design Tool','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/wordpress-design-grid-tool/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['design','tool']
			],
			'tp-draw-svg' => [
				'label' => esc_html__('Draw SVG','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-draw-animated-svg-icon/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/draw-svg/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Draw SVG', 'Draw Icon', 'illustration', 'animated svg', 'animated icons', 'Lottie animations', 'Lottie files', 'effects', 'image effect']
			],
			'tp-dynamic-device' => [
				'label' => esc_html__('Dynamic Device','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-device-mockups/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-device-mockups/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['dynamic device', 'website mockups', 'portfolio', 'desktop view', 'tablet view', 'mobile view']
			],
			'tp-empty-space' => [
				'label' => esc_html__('Spacer','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-spacer/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/spacer/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Spacer', 'Divider', 'Spacing','empty space']
			],
			'tp-external-form-styler' => [
				'label' => esc_html__('External Form Styler','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-contact-form-stylers/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-contact-form-stylers/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['form', 'contect form', 'everest', 'gravity', 'wpform','Contact Form 7', 'contact form', 'form', 'feedback', 'subscribe', 'newsletter', 'contact us', 'custom form', 'popup form', 'cf7']
			],
			'tp-expand' => [
				'label' => esc_html__('Expand','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-unfold-read-more-button/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-unfold-read-more-button/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Expand', 'read more', 'show hide content', 'Expand tabs', 'show more', 'toggle', 'Excerpt']
			],
			'tp-flipbox' => [
				'label' => esc_html__('Flipbox','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-flipbox/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/flipbox/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['flipbox', 'flip box', 'flip', 'flip image', 'flip card', 'action box', 'flipbox 3D', 'card'],
			],
            'tp-form-block' => [
                'label' => esc_html__('Form', 'the-plus-addons-for-block-editor'),
               'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-form-builder/',
                'docUrl' => '',
                'videoUrl' => '',
                'tag' => 'freemium',
                'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
                'keyword' => ['forms' , 'contact Form' , 'marketing']
            ],
			'tp-google-map' => [
				'label' => esc_html__('Google Map','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-google-maps/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-google-maps/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Map', 'Maps', 'Google Maps', 'g maps', 'location map', 'map iframe', 'embed']
			],
			'tp-heading-animation' => [
				'label' => esc_html__('Heading Animation','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-heading-animation/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/heading-animation/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Heading Animation', 'Animated Heading', 'Animation Text', 'Animated Text', 'Text Animation']
			],
			'tp-heading' => [
				'label' => esc_html__('Heading','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-heading/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-heading/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Heading', 'Title', 'Text', 'Heading title', 'Headline']
			],
			'tp-heading-title' => [
				'label' => esc_html__('Advanced Heading','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-title-block/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/advance-heading/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Heading', 'Title', 'Text', 'Heading title', 'Headline']
			],
			'tp-hotspot' => [
				'label' => esc_html__('Hotspot','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-hotspot-pinpoint-image/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/hotspot/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => [ 'Image hotspot', 'maps', 'pin' ],
			],
			'tp-hovercard' => [
				'label' => esc_html__('Hover Card','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/hover-card-animations-wordpress/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/hover-card/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Hover Card', 'Card', 'Business Card'],
			],
			'tp-icon-box' => [
				'label' => esc_html__('Icon','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-icon/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-icon/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['iconbox', 'icon box', 'fontawesome']
			],
			'tp-image' => [
				'label' => esc_html__('Image','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-image/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-image/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['image', 'media']
			],
			'tp-infobox' => [
				'label' => esc_html__('Infobox','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-infobox/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/infobox/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Infobox', 'Information', 'Info box', 'card', 'info']
			],
			'tp-interactive-circle-info' => [
				'label' => esc_html__('Interactive Circle Info','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-interactive-circle-infographic/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/interactive-circle-info/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Tabbed', 'the-plus-addons-for-block-editor'),
				'keyword' => ['interactive circle', 'interactive', 'circle', 'info']
			],
			'tp-login-register' => [
				'label' => __('Login & Signup', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-login-form/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-login-and-registration-form/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['login', 'register', 'Sign up','forgot password']
			],
			'tp-lottiefiles' => [
				'label' => esc_html__('LottieFiles Animation','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-lottiefiles-animations/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/lottie-animations-nexter-blocks/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['animation', 'lottie', 'files']
			],
			'tp-mailchimp' => [
				'label' => esc_html__('Mailchimp','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-mailchimp-form/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Mailchimp', 'Mailchimp addon', 'subscribe form']
			],
			'tp-media-listing' => [
				'label' => esc_html__('Media Listing','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/listing/wordpress-image-gallery/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Listing', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Video Gallery', 'Image Gallery', 'Video Carousel', 'Image Carousel', 'Video Listing', 'Image Listing', 'Youtube', 'Vimeo','media gallery']
			],
			'tp-messagebox' => [
				'label' => esc_html__('Message box','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-message-box/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/message-box/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Message box', 'Notification box', 'alert box']
			],
			'tp-mobile-menu' => [
				'label' => esc_html__('Mobile Menu','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-mobile-menu/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['mobile menu', 'menu','toggle menu']
			],
			'tp-mouse-cursor' => [
				'label' => esc_html__('Mouse Cursor','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-custom-cursors/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/mouse-cursor/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['mouse', 'cursor', 'animated cursor', 'mouse cursor', 'pointer']
			],
			'tp-navigation-builder' => [
				'label' => esc_html__('Navigation Menu','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-navigation-menu/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['navigation menu', 'mega menu', 'header builder', 'sticky menu', 'navigation bar', 'header menu', 'menu', 'navigation builder','vertical menu', 'swiper menu']
			],
			'tp-number-counter' => [
				'label' => esc_html__('Number Counter','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-number-counter/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/number-counter/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['number counter', 'counter', 'animated counter', 'Odometer']
			],
			'tp-popup-builder' => [
				'label' => esc_html__('Popup Builder','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-popup-builder/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['popup', 'pop up', 'alertbox', 'offcanvas', 'modal box', 'modal popup']
			],
			'tp-post-author' => [
				'label' => esc_html__('Post Author', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-post-author-box/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['post author', 'author','user info']
			],
			'tp-post-comment' => [
				'label' => esc_html__('Post Comments', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-post-comment-form/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['post comments', 'comments','comments area']
			],
			'tp-post-content' => [
				'label' => esc_html__('Post Content', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-post-content/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['content', 'post content', 'post excerpt', 'archive description']
			],
			'tp-post-image' => [
				'label' => esc_html__('Post Image', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-post-featured-image/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['post featured image', 'post image', 'featured image']
			],
			'tp-post-listing' => [
				'label' => esc_html__('Post Listing', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/listing/wordpress-post-listing/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Listing', 'the-plus-addons-for-block-editor'),
				'keyword' => ['blog listing', 'article listing','custom post listing','blog view','post listing','masonry','carousel','content view','blog item listing','grid', 'post listing', 'related posts', 'archive posts', 'post list', 'post grid', 'post masonry','post carousel', 'post slider']
			],
			'tp-post-meta' => [
				'label' => esc_html__('Post Meta Info', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-post-meta-info/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['post category', 'post tags', 'post meta info', 'meta info', 'post date', 'post comment', 'post author']
			],
			'tp-post-navigation' => [
				'label' => esc_html__('Post Navigation', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-post-navigation/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['previous next', 'post previous next', 'post navigation']
			],
			'tp-post-title' => [
				'label' => esc_html__('Post Title', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-post-title/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['post title', 'page title', 'archive title']
			],
			'tp-pricing-list' => [
				'label' => esc_html__('Pricing List','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-pricing-list/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/pricing-list/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Pricing list', 'Item price', 'price card', 'Price Guide', 'price box']
			],
			'tp-pricing-table' => [
				'label' => esc_html__('Pricing Table','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-pricing-table/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/pricing-table/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Pricing table', 'pricing list', 'price table', 'plans table', 'pricing plans', 'dynamic pricing', 'price comparison', 'Plans & Pricing Table', 'Price Chart']
			],
			'tp-preloader' => [
				'label' => esc_html__('Pre Loader','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-preloader-animation-and-page-transitions/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-preloader-animation-and-page-transitions/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => [ 'pre loader', 'loader', 'loading','Preloader' ],
			],
			'tp-pro-paragraph' => [
				'label' => esc_html__('Paragraph','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-pro-paragraph/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-pro-paragraph/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#video',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Paragraph', 'wysiwyg', 'editor', 'editor block', 'textarea', 'text area', 'text editor'],
			],
			'tp-process-steps' => [
				'label' => esc_html__('Process Steps','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-process-steps/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/process-steps/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Process steps', 'post timeline', 'step process', 'steps form', 'Steppers', 'timeline', 'Progress Tracker']
			],
			'tp-product-listing' => [
				'label' => esc_html__('Product Listing','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/listing/wordpress-product-listing/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Listing', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Product', 'Woocommerce']
			],
			'tp-progress-bar' => [
				'label' => esc_html__('Progress Bar','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-progress-bar/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/progress-bar/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Progress bar', 'progressbar', 'status bar', 'progress indicator', 'scroll progress', 'process progress bar', 'Progress Tracker']
			],
			'tp-progress-tracker' => [
				'label' => esc_html__('Progress Tracker','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-reading-scroll-progress-bar/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/progress-tracker/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => [ 'Progress bar', 'progressbar', 'status bar', 'progress indicator', 'scroll progress', 'process progress bar', 'Progress Tracker', 'Page scroll tracker','Reading progress indicator','Reading progress bar','Reading position tracker', 'Scroll depth indicator', 'Scroll tracking', 'Scroll Progress Visualizer' ]
			],
            'tp-repeater-block' => [
				'label' => esc_html__('Repeater', 'tpgb'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/listing/wordpress-repeater/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/docs/display-dynamic-repeater-field-data-in-wordpress/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Listing', 'tpgb'),
				'keyword' => ['repeater']
			],
			'tp-row' => [
				'label' => esc_html__('Row','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-container/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Row', 'layout'],
			],
			'tp-site-logo' => [
				'label' => esc_html__('Site Logo','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-site-logo/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '#video',
				'tag' => 'free',
				'block_cate' => esc_html__('Builder', 'the-plus-addons-for-block-editor'),
				'keyword' => ['site logo', 'logo','dual logo'],
			],
			'tp-stylist-list' => [
				'label' => esc_html__('Stylish List','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-stylish-list/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/stylist-list/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#video',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Stylish list', 'listing', 'item listing'],
			],
			'tp-scroll-navigation' => [
				'label' => esc_html__('Scroll Navigation','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-one-page-scroll-navigation/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/scroll-navigation/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#video',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Scroll navigation', 'slide show', 'slideshow', 'vertical slider'],
			],
			'tp-scroll-sequence' => [
				'label' => esc_html__('Scroll Sequence','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-image-scroll-sequence/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/scroll-sequence/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#video',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Cinematic Scroll Image Animation', 'Video Scroll Sequence', 'Image Scroll Sequence'],
			],
			'tp-search-bar' => [
				'label' => esc_html__('Search Bar', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-ajax-search-bar/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/search-bar/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['search', 'post search','WordPress Search Bar', 'Find', 'Search Tool', 'SearchWP'],
			],
			'tp-social-icons' => [
				'label' => esc_html__('Social Icon','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-social-icons/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/social-icon/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Social Icon', 'Icon', 'link']
			],
			'tp-social-embed' => [
				'label' => esc_html__('Social Embed','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-social-embed/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Social', 'the-plus-addons-for-block-editor'),
				'keyword' => ['iframe', 'facebook feed', 'facebook comments', 'facebook like', 'facebook share', 'facebook page' ]
			],
			'tp-social-feed' => [
				'label' => esc_html__('Social Feed','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-social-feed/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Social', 'the-plus-addons-for-block-editor'),
				'keyword' => ['feed', 'facebook', 'google', 'youtube', 'social', 'posts', 'instagram','vimeo']
			],
			'tp-social-sharing' => [
				'label' => esc_html__('Social Sharing','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-social-sharing-icons/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/social-sharing/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#',
				'tag' => 'pro',
				'block_cate' => esc_html__('Advanced', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Social Sharing', 'Social Media Sharing']
			],
			'tp-social-reviews' => [
				'label' => esc_html__('Social Reviews','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-social-reviews/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Social', 'the-plus-addons-for-block-editor'),
				'keyword' => ['social', 'reviews', 'rating', 'stars', 'badges']
			],
			'tp-spline-3d-viewer' => [
				'label' => esc_html__('Spline 3D Viewer','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-spline-3d-viewer/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/spline-3d-viewer/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
				'keyword' => ['canvas animation', 'spline', '3d', 'Spline 3D viewer', 'Spline 3D model embed', 'Spline 3D interactive']
			],
			'tp-smooth-scroll' => [
				'label' => esc_html__('Smooth Scroll','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-smooth-scroll/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/smooth-scroll/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#',
				'tag' => 'free',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
			],
			'tp-switcher' => [
				'label' => esc_html__('Switcher','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-content-switcher/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-content-switcher/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#video',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Tabbed', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Switcher', 'on/off', 'switch control', 'toggle', 'true/false', 'toggle switch', 'state', 'binary']
			],
			'tp-table-content' => [
				'label' => esc_html__('Table of Contents','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-table-of-contents/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/table-of-content/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => [ 'Table of Contents', 'Contents', 'toc', 'index', 'listing', 'appendix' ]
			],
			'tp-tabs-tours' => [
				'label' => esc_html__('Tabs Tours', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-tab-content/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/wordpress-tab-content/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '#video',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Tabbed', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Tabs', 'Tours', 'tab content', 'pills', 'toggle']
			],
			'tp-dynamic-category' => [
				'label' => esc_html__('Taxonomy Listing','the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/builder/wordpress-taxonomy-listing/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Listing', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Category', 'Tags', 'Taxonomy', 'WP Term' , 'Category Grid' , 'product category' , 'Post' , 'CPT' , 'WooCommerce', 'Product Tags']
			],
			'tp-team-listing' => [
				'label' => esc_html__('Team Member', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/listing/wordpress-team-members/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Listing', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Team Member Gallery', 'Team Gallery', 'Team Member Carousel']
			],
			'tp-testimonials' => [
				'label' => esc_html__('Testimonials', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/listing/wordpress-testimonial-reviews/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => '',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Listing', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Testimonials', 'testimonial', 'slider', 'client reviews', 'ratings']
			],
			'tp-timeline' => [
				'label' => esc_html__('Timeline', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-timeline/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/timeline/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Creative', 'the-plus-addons-for-block-editor'),
                'keyword' => ['timeline','Schedule','Sequence','History','Events','Timeframe','Historical data','Time Line']
			],
			'tp-video' => [
				'label' => esc_html__('Video', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/blocks/wordpress-video-player/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-blocks/video/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Essential', 'the-plus-addons-for-block-editor'),
				'keyword' => ['Video', 'youtube video', 'vimeo video', 'video player', 'mp4 player', 'web player', 'youtube content', 'Youtube embed', 'youtube iframe']
			],
		];
	
		$this->block_extra = [
            'tp-global-block-style' => [
				'label' => esc_html__('Global Block Style', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/wordpress-global-block-style/',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-advanced-border-radius' => [
				'label' => esc_html__('Advanced Border Radius', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/wordpress-advanced-border-radius/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-content-hover-effect' => [
				'label' => esc_html__('Content Hover Effect', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/mouse-hover-animation-for-wordpress/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-continuous-animation' => [
				'label' => esc_html__('Continuous Animation', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/wordpress-floating-effect/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-display-rules' => [
				'label' => esc_html__('Display Rules', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/wordpress-display-conditional-rules/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-extras/wordpress-display-conditional-rules/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-equal-height' => [
				'label' => esc_html__('Equal Column Height', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/wordpress-same-equal-height/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'docUrl' => 'https://nexterwp.com/help/nexter-extras/wordpress-same-equal-height/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'free',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-global-tooltip' => [
				'label' => esc_html__('Global Tooltip', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/wordpress-global-tooltip/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-magic-scroll' => [
				'label' => esc_html__('Magic Scroll', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/magic-scroll-effect-for-wordpress/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-mouse-parallax' => [
				'label' => esc_html__('Mouse Parallax', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/mouse-hover-animation-for-wordpress/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-scoll-animation' => [
				'label' => esc_html__('On Scroll Animation', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/wordpress-on-scroll-content-animations/?utm_source=wpbackend&utm_medium=blocks&utm_campaign=nextersettings',
				'videoUrl' => '',
				'tag' => 'freemium',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
			'tp-3d-tilt' => [
				'label' => esc_html__('3D Tilt', 'the-plus-addons-for-block-editor'),
				'demoUrl' => 'https://nexterwp.com/nexter-blocks/extras/mouse-hover-animation-for-wordpress/#tilt-3d',
				'videoUrl' => '',
				'tag' => 'pro',
				'block_cate' => esc_html__('Extras', 'the-plus-addons-for-block-editor'),
			],
		];
	}
	
    /**
     * Render Dashboard Root Div
     * @since 1.0.0 nxtext
     */
    public function nexter_ext_dashboard() {
        echo '<div id="nexter-dash"></div>';
        do_action('nxt_new_update_notice');
    }
	
    /**
     * Code Snippet Render html
     * @since  1.0.0
     */
    public function nexter_code_snippet_display() {
        $features = [
            __('Replace multiple small plugins with a single, unified snippet manager', 'the-plus-addons-for-block-editor'),
            __('Add PHP, HTML, CSS safely without editing theme or core files', 'the-plus-addons-for-block-editor'),
            __('Apply snippets site-wide or on specific pages, posts, or conditions', 'the-plus-addons-for-block-editor'),
            __('Stay protected with built-in validation, version control & rollback', 'the-plus-addons-for-block-editor'),
            __('Keep your site fast, only active snippets are loaded', 'the-plus-addons-for-block-editor'),
            __('Import or Organise snippets from our 1000+ Cloud Snippets Library', 'the-plus-addons-for-block-editor'),
            __('Preview, test, and toggle snippets without affecting live visitors', 'the-plus-addons-for-block-editor'),
        ];

        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
        $pluginslist = get_plugins();

        $extensioninstall = false;
        $extensionactivate = false;
        if ( isset( $pluginslist[ 'nexter-extension/nexter-extension.php' ] ) && !empty( $pluginslist[ 'nexter-extension/nexter-extension.php' ] ) ) {
            if( is_plugin_active('nexter-extension/nexter-extension.php') ){
                $extensioninstall = true;
            }else{
                $extensionactivate = true;
            }
        }

        echo '<div id="nexter-code-snippets">
            <div class="nxt-code-heading-title">'.esc_html__('Code Snippets','nexter').'</div>
            <section class="nxt-install-ext-sec">
                <div class="nxt-ins-ext-cover">
                    <div class="nxt-ins-ext-inner">
                        <span class="badge">' . esc_html__('Code Snippets', 'the-plus-addons-for-block-editor') . '</span>
                        <h1 class="nxt-ins-heading">' . esc_html__('Add Custom PHP, HTML, CSS & JS Code to WordPress - No Child Theme or Extra Plugins Needed', 'the-plus-addons-for-block-editor') . '</h1>
                        <p class="nxt-ins-desc">' . esc_html__('Skip the pain of editing core files or juggling dozens of mini plugins. Nexter Code Snippets lets you safely add and manage custom PHP, HTML, CSS right inside your dashboard, no child theme required. Build smarter, cleaner sites with total control and zero risk to performance.', 'the-plus-addons-for-block-editor') . '</p>
                        <div class="nxt-ins-btns">
                            <button class="nxt-inst-ext-btn ins-btn-primary">' . (!empty($extensionactivate) ? esc_html__('Activate Nexter Extensions', 'the-plus-addons-for-block-editor') : esc_html__('Install Nexter Extensions', 'the-plus-addons-for-block-editor')) . '</button>
                            <a href="https://nexterwp.com/nexter-extension/features/#code%20snippets?utm_source=wpbackend&utm_medium=dashboard&utm_campaign=nextersettings" rel="noopener noreferrer" target="_blank" class="ins-btn-outline">' . esc_html__('Explore All Features', 'the-plus-addons-for-block-editor') . '</a>
                        </div>
                        <ul class="nxt-feature-list">';

                        foreach ($features as $feature) {
                            echo '<li>
                                <svg xmlns="http://www.w3.org/2000/svg" width="14" height="15" fill="none" viewBox="0 0 14 15">
                                    <path fill="#1717cc" d="M6.373.505a7.13 7.13 0 0 0-3.7 1.474c-.535.41-1.228 1.183-1.628 1.813a9.6 9.6 0 0 0-.63 1.29c-.135.367-.28.931-.351 1.367-.085.534-.085 1.547 0 2.081a6.9 6.9 0 0 0 .65 2.04c.361.738.736 1.26 1.34 1.866a6.5 6.5 0 0 0 1.866 1.34 7 7 0 0 0 2.042.649c.534.084 1.548.084 2.083 0a7 7 0 0 0 2.041-.65 6.5 6.5 0 0 0 1.867-1.339 6.5 6.5 0 0 0 1.34-1.865c.241-.49.362-.81.493-1.304C13.96 8.61 14 8.251 14 7.49c0-.762-.041-1.12-.214-1.778a6.3 6.3 0 0 0-.493-1.304 6.5 6.5 0 0 0-1.34-1.865 6.5 6.5 0 0 0-1.867-1.34A6.8 6.8 0 0 0 8.058.56C7.655.497 6.756.467 6.373.505"/>
                                    <path fill="#fff" d="M10.673 4.482c.137.044.348.249.406.4a.76.76 0 0 1-.017.561c-.088.178-4.599 4.654-4.802 4.766a.66.66 0 0 1-.624-.003c-.116-.06-2.193-1.92-2.547-2.279a.68.68 0 0 1-.205-.506c.005-.414.31-.693.72-.666.1.008.22.033.267.06.074.036 1.458 1.282 1.907 1.712l.129.126 2.05-2.046c1.126-1.123 2.086-2.062 2.135-2.087a.7.7 0 0 1 .58-.038"/>
                                </svg>
                                ' . esc_html($feature) . '
                            </li>';
                        }

                echo'</ul>
                    </div>
                    <div class="nxt-ins-ext-img">
                        <img src="' . esc_url(TPGB_URL . 'dashboard/assets/images/install-nexter-extension.png') . '" alt="' . esc_attr__('Nexter Extension', 'the-plus-addons-for-block-editor') . '" />
                    </div>
                </div>
            </section>
        </div>';
    }

    /**
     * Theme Builder Render html
     * @since  1.0.0
     */
    public function nexter_blocks_builder_display() {
        echo '<div id="nexter-theme-builder"></div>';
    }
	
	public function get_post_statuses_sql(){
		$statuses = array_map(
			function( $item ){
				return esc_sql( $item );
			},
			array( 'publish', 'private', 'pending', 'future', 'draft' )
		);
		return "'" . implode( "', '", $statuses ) . "'";
	}

	/*
	 * Scan Unused Blocks
	 * @since 1.3.1
	 */
	public function tpgb_is_block_used_not_fun(){
		if ( defined( 'DOING_AJAX' ) && DOING_AJAX && 
			isset( $_POST['nonce'] ) && 
			!empty( $_POST['nonce'] ) && 
			wp_verify_nonce( sanitize_text_field( wp_unslash ($_POST['nonce']) ), 'nexter_admin_nonce' ) 
		) {
			global $wpdb;
			$block_scan =[];
			
			if(isset($_POST['default_block']) && $_POST['default_block']=='false'){
				$this->block_listout();
				if(!empty($this->block_lists)){
					foreach($this->block_lists as $key => $block){
						$sql_posts = $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_status IN ( {$this->get_post_statuses_sql()} ) AND post_content LIKE %s LIMIT 1", '%<!-- wp:tpgb/' . $wpdb->esc_like($key) . '%' );
                        $found_in_posts = $wpdb->get_var($sql_posts);
						
						$block_scan[$key]= $found_in_posts ? 1 : 0;
						if( ! $found_in_posts ){
							$sql_widgets = $wpdb->prepare( "SELECT option_id FROM {$wpdb->options} WHERE option_name = %s AND option_value LIKE %s LIMIT 1", 'widget_block','%<!-- wp:tpgb/' . $wpdb->esc_like($key) . '%');
                            $found_in_widgets = $wpdb->get_var($sql_widgets);
							
							$block_scan[$key]= $found_in_widgets ? 1 : 0;
						}
					}
				}
			}else if(isset($_POST['default_block']) && $_POST['default_block']!='' && $_POST['default_block']==true){
				$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();
				if( !empty($block_types) ){
					foreach($block_types as $key => $block){
						if(str_contains($key, 'core/')){
							if( $key !='core/missing' && $key !='core/block'&& $key !='core/widget-group' && !empty($block->title) ){
								$core_key = str_replace( 'core/', '', $key );
								$core_key = esc_sql( $core_key );
								$pass_key = str_replace( 'core/', 'core-', $key );
								$sql_posts = $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_status IN ( {$this->get_post_statuses_sql()} ) AND post_content LIKE %s LIMIT 1", '%<!-- wp:' . $wpdb->esc_like($core_key) . '%');
                                $found_in_posts = $wpdb->get_var($sql_posts);
								
								$block_scan[$pass_key]= $found_in_posts ? 1 : 0;
								if( ! $found_in_posts ){
									$sql_widgets = $wpdb->prepare( "SELECT option_id FROM {$wpdb->options} WHERE option_name = %s AND option_value LIKE %s LIMIT 1", 'widget_block', '%<!-- wp:' . $wpdb->esc_like($core_key) .'%' );
                                    $found_in_widgets = $wpdb->get_var($sql_widgets);
									$block_scan[$pass_key]= $found_in_widgets ? 1 : 0;
								}
							}
						}
					}
				}
			}
			wp_send_json($block_scan);
			exit;
		}
		exit;
	}

	/*
	 * Unused Disable Blocks
	 * @since 1.4.4
	 */
	public function tpgb_disable_unsed_block_fun(){
		if( defined('DOING_AJAX') && DOING_AJAX && isset( $_POST['nonce'] ) && !empty($_POST['nonce']) && wp_verify_nonce( sanitize_text_field( wp_unslash ($_POST['nonce'] ) ), 'nexter_admin_nonce') ){
			
			if(!isset($_POST['blocks']) || empty($_POST['blocks'])){
				echo 0;
				exit;
			}
			$default_block = (isset($_POST['default_block']) && $_POST['default_block']!='') ? sanitize_text_field( wp_unslash ($_POST['default_block'] ) ) : '';
			if(isset($default_block) && $default_block!='' && $default_block=='false'){
				$blocks = map_deep(wp_unslash(json_decode(stripslashes($_POST['blocks']), true)), 'sanitize_text_field');
				
				$action_page = 'tpgb_normal_blocks_opts';
				$all_block = get_option($action_page);
				$update_block = [];
				if(is_array($blocks)){
					foreach($blocks as $key => $val){
						if($val==1){
							$update_block[] = $key;
						}
					}
					$all_block['enable_normal_blocks'] = map_deep( wp_unslash( $update_block ), 'sanitize_text_field');
					update_option( $action_page, $all_block );
					Tpgb_Library()->remove_backend_dir_files();
					echo 1;
					exit;
				}
			}
			
		}
		echo 0;
		exit;
	}

	/*
	 * Filter to Enable All Block For WDesignkit
	 * @since 4.0.14
	 */

	public function tpgb_blocks_enable_all_filter() {
		$this->block_listout();
		$default_value = array(
			'enable_normal_blocks' => array(),
			'tp_extra_option' => array()
		);
	
		$free_enable = !defined('TPGBP_VERSION');
	
		$process_blocks = function ($blocks, $key) use (&$default_value, $free_enable) {
			foreach ($blocks as $block_key => $block) {
				if (class_exists('Tpgb_Library') && method_exists('Tpgb_Library', 'remove_backend_dir_files')) {
					Tpgb_Library()->remove_backend_dir_files();
				}

				if (!$free_enable || ( isset($block['tag']) && $block['tag'] === 'free' )) {
					$default_value[$key][] = $block_key;
				}
			}
		};
	
		if (!empty($this->block_lists)) {
			$process_blocks($this->block_lists, 'enable_normal_blocks');
		}
		if (!empty($this->block_extra)) {
			$process_blocks($this->block_extra, 'tp_extra_option');
		}

		$option_exists = get_option('tpgb_normal_blocks_opts');
		return $option_exists === false ? add_option('tpgb_normal_blocks_opts', $default_value) : update_option('tpgb_normal_blocks_opts', $default_value);
	}

	/*
	 * Unused Disable Blocks Filter Function For WDesignkit
	 * @since 4.0.1
	 */

	public function tpgb_disable_unsed_block_filter_fun() {
		global $wpdb;
	
		$this->block_listout();
		$block_scan = [];
	
		if (!empty($this->block_lists)) {
			foreach ($this->block_lists as $key => $block) {
				$post_statuses = $this->get_post_statuses_sql();
				$like_key = '%<!-- wp:tpgb/' . $wpdb->esc_like($key) . '%';
	
				$sql_posts = $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_status IN ($post_statuses) AND post_content LIKE %s LIMIT 1", $like_key );
				$found_in_posts = $wpdb->get_var($sql_posts);
	
				$block_scan[$key] = $found_in_posts ? 1 : 0;
	
				if (!$found_in_posts) {
					$sql_widgets = $wpdb->prepare( "SELECT option_id FROM {$wpdb->options} WHERE option_name = %s AND option_value LIKE %s LIMIT 1", 'widget_block', $like_key );
					$found_in_widgets = $wpdb->get_var($sql_widgets);
	
					$block_scan[$key] = $found_in_widgets ? 1 : 0;
				}
			}
	
			$action_page = 'tpgb_normal_blocks_opts';
			$all_block = get_option($action_page);
	
			if (is_array($block_scan)) {
				foreach ($block_scan as $key => $val) {
					if ($val == 1) {
						$update_block[] = $key;
					}
				}
				$all_block['enable_normal_blocks'] = map_deep(wp_unslash($update_block), 'sanitize_text_field');
				update_option($action_page, $all_block);
	
				if (class_exists('Tpgb_Library') && method_exists('Tpgb_Library', 'remove_backend_dir_files')) {
					Tpgb_Library()->remove_backend_dir_files();
				}
			}
		}
	}

    /*
	 * Wdesignkit Widgets Enable / Disabled Ajax
	 * @since 4.0.7
	 */
    public function nxt_wdk_widget_ajax_callback(){

        $response = apply_filters( 'nxt_wdk_widget_ajax_call', 'wdk_update_widget' );

        wp_send_json( $response );
        wp_die();
    }

    /*
	 * Wdesignkit Import Template Block List Merge
	 * @since 4.2.4
	 */

    public function nexter_block_list_merge_action( $blockList ){

        if( empty( $blockList ) ){
            return [ 'success' => true , 'message'  => 'Block Name Not Found.' , 'description' => 'Block Name Not Found.' ];
        }

        $option_key = 'tpgb_normal_blocks_opts';
        $all_block  = get_option( $option_key );

        if ( ! is_array( $all_block ) ) {
            $all_block = [];
        }

        if ( ! isset( $all_block['enable_normal_blocks'] ) || ! is_array( $all_block['enable_normal_blocks'] ) ) {
            $all_block['enable_normal_blocks'] = [];
        }

        $sani_blockList = map_deep( wp_unslash( $blockList ), 'sanitize_text_field' );

        $all_block['enable_normal_blocks'] = array_unique( array_merge( $all_block['enable_normal_blocks'], $sani_blockList ) );
        
        if ( in_array( 'tp-google-map', $sani_blockList, true ) ) {
			$connection_key  = 'tpgb_connection_data';
			$connection_opts = get_option( $connection_key );

			if ( ! is_array( $connection_opts ) ) {
				$connection_opts = [];
			}

			// Check if not set OR explicitly "disable"
			if ( ! isset( $connection_opts['gmap_api_switch'] ) || $connection_opts['gmap_api_switch'] == "disable" ) {
				$connection_opts['gmap_api_switch'] = 'enable';
				update_option( $connection_key, $connection_opts );
			}
		}

        update_option( $option_key, $all_block );
        return [ 'success' => true , 'message'  => 'success' , 'description' => 'success' ];
    }

    /*
    * Store User Data in Database From Onboarding Process
    * @since 4.2.4
    */
    public function nxt_block_boarding_store(){

		check_ajax_referer('nexter_admin_nonce', 'security');

		$tponbData = ( isset($_POST['boardingData']) && !empty($_POST['boardingData']) ) ? wp_unslash(json_decode(stripslashes($_POST['boardingData']), true)) : [];
    
		$userData = [];
		if( isset($tponbData) && !empty($tponbData) ){
            
			// $tpoUpdate = update_option('tpgb_onboarding_data' , $tponbData);
			if(isset($tponbData['tpgb_onboarding']) && $tponbData['tpgb_onboarding'] == true ){
                
				$userData['web_server'] = $_SERVER['SERVER_SOFTWARE'];

				// Memory Limit
				$userData['memory_limit'] = ini_get('memory_limit');

				// Memory Limit
				$userData['max_execution_time'] = ini_get('max_execution_time');

				// Php Version
				$userData['php_version'] = phpversion();

				// Wordpress Version
				$userData['wp_version'] = get_bloginfo( 'version' );

				// Active Theme
				$acthemeobj = wp_get_theme();
				if(  $acthemeobj->get( 'Name' ) !== null && !empty( $acthemeobj->get( 'Name' ) ) ){
					$userData['theme'] = $acthemeobj->get( 'Name' );
				}

				// Active Plugin Name
				$actPlugin = [];
				$actplu = get_option('active_plugins');
				if ( ! function_exists( 'get_plugins' ) ) {
					require_once ABSPATH . 'wp-admin/includes/plugin.php';
				}

				$plugins=get_plugins();
				foreach ($actplu as $p){
					if(isset($plugins[$p])){
						$actPlugin[] = $plugins[$p]['Name'];
					}
				}

				$userData['plugin'] = json_encode($actPlugin);

                // No Of TPAG Block Used
				$get_blocks_list = get_option('tpgb_normal_blocks_opts');

				if(isset($get_blocks_list) && !empty($get_blocks_list) && isset($get_blocks_list['enable_normal_blocks']) && !empty($get_blocks_list['enable_normal_blocks']) ){
					$userData['no_block']  = count($get_blocks_list['enable_normal_blocks']);
					$userData['used_blocks'] = json_encode($get_blocks_list['enable_normal_blocks']);
 				}

				// User Email
				$userData['email'] = get_option('admin_email');

				// Site Url
				$userData['site_url'] = get_option('siteurl');

				// Site Url
				$userData['site_language'] = get_bloginfo("language");

                // Nexter Block Version
                $userData['nexter_block_version'] = TPGB_VERSION;

				$response = wp_remote_post('https://api.posimyth.com/wp-json/tpgb/v2/tpgb_store_user_data' , array(
					'method' => 'POST',
					'body' => json_encode($userData)
				) );

				if (is_wp_error($response)) {
					echo wp_send_json([ 'onBoarding' => false ]);
				} else {
					$StatusOne = wp_remote_retrieve_response_code($response);
					if($StatusOne == 200){
						$GetDataOne = wp_remote_retrieve_body($response);
						$GetDataOne = (array) json_decode(json_decode($GetDataOne, true));
						if(isset($GetDataOne['success']) && !empty($GetDataOne['success']) ){
                            add_option( 'nxt_onboarding_done' , true );
                            echo wp_send_json([ 'onBoarding' => true ]);
						}
					}
				}
			}else{
                add_option( 'nxt_onboarding_done' , true );
                echo wp_send_json([ 'onBoarding' => true ]);
            }
		}
		exit;
	}

    /*
    * Template Get ajax call
    * @since 4.6.0
    */
    public function nexter_temp_api_call() {

        check_ajax_referer( 'nexter_admin_nonce', 'nexter_nonce' );

        if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
            wp_send_json_error( array( 'content' => __( 'Insufficient permissions.', 'the-plus-addons-for-block-editor' ) ) );
            wp_die();
        }

        $method  = isset( $_POST['method'] ) ? sanitize_text_field( wp_unslash( $_POST['method'] ) ) : 'POST';
        $api_url = isset( $_POST['api_url'] ) ? esc_url_raw( wp_unslash( $_POST['api_url'] ) ) : '';
        $body    = isset( $_POST['url_body'] ) ? json_decode( wp_unslash( $_POST['url_body'] ), true ) : array();

        $args = array(
            'method'  => $method,
            'timeout' => 30,
            'headers' => array(
                'Content-Type' => 'application/json',
            ),
        );

        if ( ! empty( $body ) ) {
            $args['body'] = wp_json_encode( $body );
        }

        // Make the request based on method
        if ( 'POST' === $method ) {
            $response = wp_remote_post( $api_url, $args );
        } elseif ( 'GET' === $method ) {
            $response = wp_remote_get( $api_url, $args );
        } else {
            wp_send_json_error( array(
                'HTTP_CODE' => 400,
                'error' => 'Invalid HTTP method'
            ) );
            wp_die();
        }

        $statuscode = wp_remote_retrieve_response_code( $response );
        $getdataone = wp_remote_retrieve_body( $response );
        
        $response_data = json_decode( $getdataone, true );

        $statuscode_array = array( 'HTTP_CODE' => $statuscode );

        // Merge status code with response data
        if ( is_array( $response_data ) ) {
            $final = array_merge( $statuscode_array, $response_data );
        } else {
            $final = array_merge( $statuscode_array, array( 'data' => $response_data ) );
        }

        wp_send_json( $final );
        wp_die();
    }
}
// Get it started
$Tpgb_Gutenberg_Settings_Options = new Tpgb_Gutenberg_Settings_Options();
$Tpgb_Gutenberg_Settings_Options->hooks();