????JFIF??x?x????'403WebShell
403Webshell
Server IP : 104.21.112.1  /  Your IP : 216.73.216.145
Web Server : LiteSpeed
System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : tempvsty ( 647)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/tempvsty/peekmysite.com/wp-content/plugins/nextgen-gallery/src/WPCLI/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/tempvsty/peekmysite.com/wp-content/plugins/nextgen-gallery/src/WPCLI/Settings.php
<?php

namespace Imagely\NGG\WPCLI;

use Imagely\NGG\Util\Transient;
use Imagely\NGG\Util\Installer;
use Imagely\NGG\Settings\Settings as SettingsManager;

class Settings {

	/**
	 * @param array $args
	 * @param array $assoc_args
	 * @subcommand list
	 */
	public function _list( $args, $assoc_args ) {
		$settings  = SettingsManager::get_instance();
		$temporary = $settings->to_array();
		$display   = [];
		foreach ( $temporary as $key => $val ) {
			$display[] = [
				'key'   => $key,
				'value' => $val,
			];
		}
		\WP_CLI\Utils\format_items( 'table', $display, [ 'key', 'value' ] );
	}

	/**
	 * @param array $args
	 * @param array $assoc_args
	 * @synopsis <key> <value>
	 */
	public function edit( $args, $assoc_args ) {
		$settings = SettingsManager::get_instance();
		$settings->set( $args[0], $args[1] );
		$settings->save();
		\WP_CLI::success( 'Setting has been updated' );
	}

	/**
	 * Export all NextGen settings to a file in JSON format
	 *
	 * @param $args
	 * @param $assoc_args
	 * @synopsis <json-file-path>
	 */
	public function export( $args, $assoc_args ) {
		$settings = SettingsManager::get_instance();
		file_put_contents( $args[0], $settings->to_json() );
		\WP_CLI::success( "Settings have been stored in {$args[0]}" );
	}

	/**
	 * Import settings from a JSON file
	 *
	 * @param array $args
	 * @param array $assoc_args
	 * @synopsis <json-file-path>
	 */
	public function import( $args, $assoc_args ) {
		$settings     = SettingsManager::get_instance();
		$file_content = file_get_contents( $args[0] );
		$json         = json_decode( $file_content );

		if ( null === $json ) {
			\WP_CLI::error( 'Could not parse JSON file' );
		}

		foreach ( $json as $key => $value ) {
			$settings->set( $key, $value );
		}

		$settings->save();

		\WP_CLI::success( "Settings have been imported from {$args[0]}" );
	}

	/**
	 * Deactivates NextGen and NextGen Pro and resets all settings to their default state
	 *
	 * @param array $args
	 * @param array $assoc_args
	 */
	public function reset( $args, $assoc_args ) {
		\WP_CLI::confirm( 'Are you sure you want to reset all NextGen settings?', $assoc_args );

		$settings = SettingsManager::get_instance();
		Transient::flush();

		if ( defined( 'NGG_PRO_PLUGIN_VERSION' ) || defined( 'NEXTGEN_GALLERY_PRO_VERSION' ) ) {
			Installer::uninstall( 'photocrati-nextgen-pro' );
		}
		if ( defined( 'NGG_PLUS_PLUGIN_VERSION' ) ) {
			Installer::uninstall( 'photocrati-nextgen-plus' );
		}
		Installer::uninstall( 'photocrati-nextgen' );

		// removes all ngg_options entry in wp_options.
		$settings->reset();
		$settings->destroy();

		global $wpdb;
		$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->posts} WHERE post_type = %s", 'display_type' ) );
		$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->posts} WHERE post_type = %s", 'lightbox_library' ) );

		\WP_CLI::success( 'All NextGen settings have been reset' );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit