updated plugin GP Premium
version 1.11.2
This commit is contained in:
@ -1,6 +1,17 @@
|
||||
<?php
|
||||
defined( 'WPINC' ) or die;
|
||||
/**
|
||||
* This file handles the site restore functionality.
|
||||
*
|
||||
* @package GP Premium
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // No direct access, please.
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore previous site.
|
||||
*/
|
||||
class GeneratePress_Sites_Restore {
|
||||
/**
|
||||
* Instance.
|
||||
@ -19,22 +30,28 @@ class GeneratePress_Sites_Restore {
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self;
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get it going.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'wp_ajax_generate_restore_theme_options', array( $this, 'theme_options' ) );
|
||||
add_action( 'wp_ajax_generate_restore_site_options', array( $this, 'site_options' ) );
|
||||
add_action( 'wp_ajax_generate_restore_content', array( $this, 'content' ) );
|
||||
add_action( 'wp_ajax_generate_restore_plugins', array( $this, 'plugins' ) );
|
||||
add_action( 'wp_ajax_generate_restore_widgets', array( $this, 'widgets' ) );
|
||||
add_action( 'wp_ajax_generate_restore_css', array( $this, 'css' ) );
|
||||
add_action( 'wp_ajax_generate_restore_site_clean_up', array( $this, 'clean_up' ) );
|
||||
add_action( 'wp_ajax_generate_restore_theme_options', array( $this, 'theme_options' ) );
|
||||
add_action( 'wp_ajax_generate_restore_site_options', array( $this, 'site_options' ) );
|
||||
add_action( 'wp_ajax_generate_restore_content', array( $this, 'content' ) );
|
||||
add_action( 'wp_ajax_generate_restore_plugins', array( $this, 'plugins' ) );
|
||||
add_action( 'wp_ajax_generate_restore_widgets', array( $this, 'widgets' ) );
|
||||
add_action( 'wp_ajax_generate_restore_css', array( $this, 'css' ) );
|
||||
add_action( 'wp_ajax_generate_restore_site_clean_up', array( $this, 'clean_up' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore theme options.
|
||||
*/
|
||||
public function theme_options() {
|
||||
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
|
||||
|
||||
@ -108,6 +125,9 @@ class GeneratePress_Sites_Restore {
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore site options.
|
||||
*/
|
||||
public function site_options() {
|
||||
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
|
||||
|
||||
@ -120,7 +140,7 @@ class GeneratePress_Sites_Restore {
|
||||
|
||||
if ( ! empty( $backup_data ) ) {
|
||||
foreach ( $backup_data['site_options'] as $key => $val ) {
|
||||
if ( in_array( $key, ( array ) generatepress_sites_disallowed_options() ) ) {
|
||||
if ( in_array( $key, (array) generatepress_sites_disallowed_options() ) ) {
|
||||
GeneratePress_Sites_Helper::log( 'Disallowed option: ' . $key );
|
||||
continue;
|
||||
}
|
||||
@ -138,6 +158,9 @@ class GeneratePress_Sites_Restore {
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore content.
|
||||
*/
|
||||
public function content() {
|
||||
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
|
||||
|
||||
@ -163,6 +186,9 @@ class GeneratePress_Sites_Restore {
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore plugins.
|
||||
*/
|
||||
public function plugins() {
|
||||
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
|
||||
|
||||
@ -182,6 +208,9 @@ class GeneratePress_Sites_Restore {
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore widgets.
|
||||
*/
|
||||
public function widgets() {
|
||||
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
|
||||
|
||||
@ -201,6 +230,9 @@ class GeneratePress_Sites_Restore {
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore CSS.
|
||||
*/
|
||||
public function css() {
|
||||
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
|
||||
|
||||
@ -232,6 +264,9 @@ class GeneratePress_Sites_Restore {
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* General cleanup.
|
||||
*/
|
||||
public function clean_up() {
|
||||
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
|
||||
|
||||
|
Reference in New Issue
Block a user