__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php

namespace EssentialBlocks\Core;

use EssentialBlocks\Modules\StyleHandler;
use EssentialBlocks\Traits\HasSingletone;

class Maintenance
{
    use HasSingletone;

    public function __construct()
    {
        add_action( 'admin_init', [ $this, 'update_actions' ], 5 );

        $this->init( ESSENTIAL_BLOCKS_PLUGIN_BASENAME );
    }

    public function update_actions()
    {
        $_version        = get_option( 'essential_blocks_version' );
        $_code_version   = ESSENTIAL_BLOCKS_VERSION;
        $requires_update = version_compare( $_version, $_code_version, '<' );

        if ( ! $_version ) {
            update_option( 'essential_blocks_user_type', 'new' );
        }
        if ( $requires_update ) {
            // Version Updated in DB.
            $this->update_version();

            if ( get_option( 'essential_blocks_user_type' ) !== 'new' ) {
                update_option( 'essential_blocks_user_type', 'old' );
            }

            $checkPro = class_exists( 'EssentialBlocks\Pro\Plugin' ) ? 1 : 0;

            //Redirect to quick setup page
            $is_quick_setup_shown = get_option( 'essential_blocks_quick_setup_shown' );
            if ( ! $is_quick_setup_shown && $checkPro === 0 ) {
                // Do not redirect AJAX requests
                if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
                    //Nothing to do
                } else {
                    wp_safe_redirect( admin_url( 'admin.php?page=eb-quick-setup' ) );
                    exit;
                }
            }

            // Update Related Works
            if ( ESSENTIAL_BLOCKS_WHATSNEW_REDIRECT !== 'none' ) {
                set_transient( 'essential_block_maybe_whatsnew_redirect', true, MINUTE_IN_SECONDS * 10 );
            } else if ( EB_SHOW_WHATS_NEW_NOTICE !== 'none' ) {
                set_transient( 'essential_block_whats_new_notice', true, MINUTE_IN_SECONDS * 10 );
            }

            //Create Table on Plugin Update
            self::db_create_tables();

            //update all blocks in db
            update_option( 'essential_all_blocks', Blocks::all() );
            update_option( 'essential_quick_toolbar_allowed_blocks', Blocks::quick_toolbar_blocks() );

            //Regenerate Assets
            StyleHandler::init()->remove_frontend_assets();
        }
    }

    /**
     * Update WC version to current.
     */
    private function update_version()
    {
        update_option( 'essential_blocks_version', ESSENTIAL_BLOCKS_VERSION );
    }

    /**
     * Init Maintenance
     *
     * @since 2.0.1
     * @return void
     */
    public function init( $plguin_basename )
    {
        register_activation_hook( $plguin_basename, [ __CLASS__, 'activation' ] );
        register_deactivation_hook( $plguin_basename, [ __CLASS__, 'deactivation' ] );
        register_uninstall_hook( $plguin_basename, [ __CLASS__, 'uninstall' ] );
    }

    /**
     * Runs on activation
     *
     * @since 2.0.1
     * @return void
     */
    public static function activation()
    {
        update_option( 'essential_all_blocks', Blocks::all() );
        update_option( 'essential_quick_toolbar_allowed_blocks', Blocks::quick_toolbar_blocks() );

        self::db_create_tables();
    }

    /**
     * Runs on deactivation
     *
     * @since 5.5.3
     * @return void
     */
    public static function deactivation()
    {
        // Clean up AI job manager scheduled events
        if ( class_exists( 'EssentialBlocks\Integrations\AI\JobManager' ) ) {
            \EssentialBlocks\Integrations\AI\JobManager::cleanup_hooks();
        }
    }

    /**
     * Runs on uninstallation.
     *
     * @since 2.0.1
     * @return void
     */
    public static function uninstall()
    {
        // Clean up AI job manager scheduled events and data
        if ( class_exists( 'EssentialBlocks\Integrations\AI\JobManager' ) ) {
            \EssentialBlocks\Integrations\AI\JobManager::cleanup_hooks();
            \EssentialBlocks\Integrations\AI\JobManager::cleanup_expired_jobs();
        }
    }

    private static function db_create_tables()
    {
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        global $wpdb;
        $charset_collate = $wpdb->get_charset_collate();

        //Create Table "eb_form_settings"
        $sql = 'CREATE TABLE ' . ESSENTIAL_BLOCKS_FORM_SETTINGS_TABLE . ' (
                    id INT AUTO_INCREMENT,
                    block_id VARCHAR(24) NOT NULL,
                    title TEXT NOT NULL,
                    fields TEXT NOT NULL,
                    form_options TEXT NOT NULL,
                    settings TEXT NOT NULL,
                    created_by INT NOT NULL,
                    updated_at DATETIME NOT NULL,
                    PRIMARY KEY (id),
                    UNIQUE (block_id)
                )' . $charset_collate;
        // dbDelta( $sql );
        $create = maybe_create_table( ESSENTIAL_BLOCKS_FORM_SETTINGS_TABLE, $sql );
        if ( ! $create ) {
            error_log( 'Table "' . ESSENTIAL_BLOCKS_FORM_SETTINGS_TABLE . '" couldn\'t be created for Essential Blocks. Please contact with plugin author.' );
        }
    }
}

Filemanager

Name Type Size Permission Actions
Block.php File 5.61 KB 0640
Blocks.php File 4.69 KB 0640
BlocksPatterns.php File 6.88 KB 0640
FaqSchema.php File 6.88 KB 0640
FontLoader.php File 4.79 KB 0640
Maintenance.php File 5.06 KB 0640
ModifyWPCore.php File 761 B 0640
PageTemplates.php File 4.87 KB 0640
PostMeta.php File 637 B 0640
Scripts.php File 30.98 KB 0640
Filemanager