get_all_settings(); foreach ( \QWSpeedCache\Settings\Schema::secret_keys() as $k ) { unset( $s[ $k ] ); } $active = array(); if ( function_exists( 'get_option' ) ) { $active = (array) get_option( 'active_plugins', array() ); } return array( 'plugin' => 'qw-speed-cache', 'version' => defined( 'QWSC_VERSION' ) ? QWSC_VERSION : '', 'wp' => isset( $wp_version ) ? $wp_version : '', 'php' => PHP_VERSION, 'home' => home_url( '/' ), 'multisite' => is_multisite(), 'wp_cache' => defined( 'WP_CACHE' ) && WP_CACHE, 'advanced_cache' => defined( 'WP_CONTENT_DIR' ) && file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ), 'object_cache' => defined( 'WP_CONTENT_DIR' ) && file_exists( WP_CONTENT_DIR . '/object-cache.php' ), 'settings' => $s, 'active_plugins' => $active, 'theme' => function_exists( 'get_stylesheet' ) ? get_stylesheet() : '', 'conflicts' => class_exists( '\QWSpeedCache\Safety\ConflictDetector' ) ? \QWSpeedCache\Safety\ConflictDetector::active_conflicts() : array(), 'generated' => gmdate( 'c' ), ); } public function download() { check_admin_referer( 'qwsc_support_export' ); if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'Unauthorized', 'qw-optimize' ), '', array( 'response' => 403 ) ); } $data = self::build(); header( 'Content-Type: application/json; charset=utf-8' ); header( 'Content-Disposition: attachment; filename=qwsc-support-' . gmdate( 'Y-m-d' ) . '.json' ); echo wp_json_encode( $data, JSON_PRETTY_PRINT ); exit; } }