__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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:

www-data@216.73.216.10: ~ $
<?php

namespace WP_Statistics\Service\Admin\Metabox;

use WP_Screen;
use WP_Statistics\Core\CoreFactory;

class MetaboxManager
{
    public function __construct()
    {
        add_action('admin_init', [$this, 'registerMetaboxes']);
        add_action('admin_init', [$this, 'hideDashboardMetaboxes']);
    }

    /**
     * Registers active metaboxes.
     *
     * @return void
     */
    public function registerMetaboxes()
    {
        $metaboxes = MetaboxHelper::getActiveMetaboxes();

        foreach ($metaboxes as $metabox) {
            $metabox->register();
        }
    }

    /**
     * Hides default dashboard metaboxes for the current user on fresh installs.
     *
     * Hooked into 'admin_init'. Runs only once on fresh installs.
     * Excludes the 'wp-statistics-quickstats-widget' from being hidden.
     *
     * @return void
     */
    public function hideDashboardMetaboxes()
    {
        $userId             = get_current_user_id();
        $hiddenMetaboxesKey = 'metaboxhidden_dashboard';
        $metaboxInitFlagKey = 'wp_statistics_metaboxhidden_dashboard_initialized';

        if (get_user_meta($userId, $metaboxInitFlagKey, true)) {
            return;
        }

        if (!CoreFactory::isFresh() && get_user_meta($userId, $hiddenMetaboxesKey, true)) {
            return;
        }

        $hidden = [];

        $metaboxes = MetaboxHelper::getActiveMetaboxes();

        foreach ($metaboxes as $metabox) {
            $key = $metabox->getKey();

            if ($key === 'wp-statistics-quickstats-widget') {
                continue;
            }

            $hidden[] = $key;
        }

        if (empty($hidden)) {
            return;
        }

        $existingHidden = get_user_meta($userId, $hiddenMetaboxesKey, true);

        if (!is_array($existingHidden)) {
            update_user_meta($userId, $hiddenMetaboxesKey, $hidden);
        } elseif (array_diff($hidden, $existingHidden)) {
            $mergedHidden = array_unique(array_merge($existingHidden, $hidden));
            update_user_meta($userId, $hiddenMetaboxesKey, $mergedHidden);
        }

        update_user_meta($userId, $metaboxInitFlagKey, 1);
    }
}

Filemanager

Name Type Size Permission Actions
Metaboxes Folder 0755
MetaboxDataProvider.php File 7.37 KB 0644
MetaboxHelper.php File 5.01 KB 0644
MetaboxManager.php File 2.12 KB 0644
Filemanager