403Webshell
Server IP : 213.186.33.4  /  Your IP : 216.73.216.222
Web Server : Apache
System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64
User : karinebmkh ( 644538)
PHP Version : 8.4.22
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/karinebmkh/www/wp-content/plugins/spotlight-social-photo-feeds/modules/Dev/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/karinebmkh/www/wp-content/plugins/spotlight-social-photo-feeds/modules/Dev/DevResetDb.php
<?php

namespace RebelCode\Spotlight\Instagram\Modules\Dev;

use RebelCode\Spotlight\Instagram\Utils\DbQueries;

/**
 * Dev tool that resets the DB.
 */
class DevResetDb
{
    /** @var callable */
    protected $deletePostsAction;

    /** Constructor */
    public function __construct(callable $deletePostsAction)
    {
        $this->deletePostsAction = $deletePostsAction;
    }

    public function __invoke()
    {
        $resetDb = filter_input(INPUT_POST, 'sli_reset_db');
        if (!$resetDb) {
            return;
        }

        if (!wp_verify_nonce($resetDb, 'sli_reset_db')) {
            wp_die('You cannot do that!', 'Unauthorized', [
                'back_link' => true,
            ]);
        }

        set_time_limit(30 * 60);

        global $wpdb;
        $count = 0;

        // The post types to delete
        $postTypes = [];
        // Check for "reset accounts"
        if (filter_input(INPUT_POST, 'sli_reset_accounts', FILTER_VALIDATE_BOOLEAN)) {
            $postTypes[] = 'sl-insta-account';
        }
        // Check for "reset feeds"
        if (filter_input(INPUT_POST, 'sli_reset_feeds', FILTER_VALIDATE_BOOLEAN)) {
            $postTypes[] = 'sl-insta-feed';
        }

        // Check for "reset import lock"
        if (filter_input(INPUT_POST, 'sli_reset_import_lock', FILTER_VALIDATE_BOOLEAN)) {
            spotlightInsta()->get('engine/importer/lock')->delete();
        }

        // Delete the accounts and feeds
        if (!empty($postTypes)) {
            $query = DbQueries::deletePostsByType($postTypes);
            $count += $wpdb->query($query);
        }

        // Check for "reset posts" and delete the posts
        if (filter_input(INPUT_POST, 'sli_reset_posts', FILTER_VALIDATE_BOOLEAN)) {
            $count += ($this->deletePostsAction)();
        }

        if ($wpdb->last_error) {
            wp_die($wpdb->last_error, 'Spotlight DB Reset - Error', ['back_link' => true]);
        }

        $count += $wpdb->query("DELETE FROM {$wpdb->options}
                              WHERE (option_name LIKE 'sli_%' OR option_name LIKE '%_sli_%') AND
                                     option_name != 'sli_user_did_onboarding'");

        if ($wpdb->last_error) {
            wp_die($wpdb->last_error, 'Spotlight DB Reset - Error', ['back_link' => true]);
        }

        add_action('admin_notices', function () use ($count) {
            printf('<div class="notice notice-success"><p>Deleted %d items from the database</p></div>', $count);
        });
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit