uawdijnntqw1x1x1
IP : 216.73.216.15
Hostname : webm041.cluster026.gra.hosting.ovh.net
Kernel : Linux webm041.cluster026.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
OS : Linux
PATH:
/
home
/
.
/
monikamovk
/
.
/
www
/
.
/
wp-content
/
plugins
/
nextgen-gallery
/
src
/
DataMapper
/
..
/
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' ); } }
/home/./monikamovk/./www/./wp-content/plugins/nextgen-gallery/src/DataMapper/../WPCLI/Settings.php