403Webshell
Server IP : 38.190.208.107  /  Your IP : 216.73.217.46
Web Server : nginx/1.28.1
System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64
User : root ( 0)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/wp.12/wp-content/plugins/duplicator/src/Utils/ExtraPlugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/wp.12/wp-content/plugins/duplicator/src/Utils/ExtraPlugins/CrossPromotion.php
<?php

namespace Duplicator\Utils\ExtraPlugins;

use DUP_LITE_Plugin_Upgrade;
use Duplicator\Controllers\AboutUsController;
use Duplicator\Core\Controllers\ControllersManager;
use Duplicator\Core\Notifications\Notice;
use Duplicator\Core\Views\TplMng;

class CrossPromotion
{
    const PLUGINS_LIMIT = 3;

    /** @var string */
    const NOTICE_SLUG = 'duplicator_cross_promotion';

    /**
     * Init notice
     *
     * @return void
     */
    public static function init()
    {
        if (!current_user_can('install_plugins')) {
            return;
        }

        $installInfo = DUP_LITE_Plugin_Upgrade::getInstallInfo();
        if ($installInfo['updateTime'] + (2 * WEEK_IN_SECONDS) > time()) {
            return;
        }

        if (!ControllersManager::isCurrentPage(ControllersManager::MAIN_MENU_SLUG)) {
            return;
        }

        $plugins = self::getExtraPlugins();
        if (count($plugins) === 0) {
            return;
        }

        AboutUsController::enqueueScripts();

        Notice::add(
            TplMng::getInstance()->render(
                'parts/cross_promotion/list',
                [
                    'plugins' => $plugins,
                    'limit' => self::PLUGINS_LIMIT,
                ],
                false
            ),
            self::NOTICE_SLUG,
            '',
            [
                'autop' => false,
                'dismiss' => Notice::DISMISS_USER,
            ]
        );
    }

    /**
     * Get the extra plugins to be promoted
     *
     * @return ExtraItem[]
     */
    public static function getExtraPlugins()
    {
        $slugs           = self::getSlugs();
        $plugins         = [];
        $extraPluginsMng = ExtraPluginsMng::getInstance();

        foreach ($slugs as $slug) {
            if (count($plugins) >= self::PLUGINS_LIMIT) {
                break;
            }

            if (($plugin = $extraPluginsMng->getBySlug($slug)) === false) {
                continue;
            }

            if ($plugin->isInstalled() || !$plugin->checkRequirments()) {
                continue;
            }

            $plugins[] = $plugin;
        }

        foreach ($extraPluginsMng->getAll() as $plugin) {
            if (count($plugins) >= self::PLUGINS_LIMIT) {
                break;
            }

            if (in_array($plugin->getSlug(), $slugs)) {
                continue;
            }

            if ($plugin->isInstalled() || !$plugin->checkRequirments()) {
                continue;
            }

            $plugins[] = $plugin;
        }

        return $plugins;
    }

    /**
     * Get the slugs of the extra plugins to be promoted with priority
     *
     * @return string[]
     */
    protected static function getSlugs()
    {
        return [
            'search-replace-wpcode/wsrw.php',
            'wp-mail-smtp/wp_mail_smtp.php',
            'insert-headers-and-footers/ihaf.php',
            'all-in-one-seo-pack/all_in_one_seo_pack.php',
            'wpforms-lite/wpforms.php',
            'uncanny-automator/uncanny-automator.php',
        ];
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit