Plugin Directory

Changeset 2362636


Ignore:
Timestamp:
08/17/2020 12:26:18 AM (6 years ago)
Author:
baseapp
Message:

Option_save_Fix

Location:
wpbase-cache/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wpbase-cache/trunk/wpbase-cache.php

    r2362525 r2362636  
    44  Plugin URI: https://www.wpoven.com/
    55  Description: Custom WordPress Caching plugin for WPOven Hosted Sites which uses all caches on varnish, nginx, php-fpm stack and Redis.
    6   Version: 5.5.33
     6  Version: 5.5.4
    77  Author: Vikrant Datta
    88  Author URI: https://www.wpoven.com/
  • wpbase-cache/trunk/wpbase-redis-cache.php

    r2362524 r2362636  
    250250    }
    251251
    252     public function do_admin_actions() {
    253 
    254             global $wp_filesystem;
    255             if ( $this->initialize_filesystem( $url, true ) ) {
    256 
    257                 if ($_POST['wpbase_cache_options']['redis_cache'] == '1') {
    258                         update_option('wpbase_cache_options', 'redis_cache', "1");
    259                         $wp_filesystem->copy(plugin_dir_path(__FILE__) . '/includes/object-cache.php', WP_CONTENT_DIR . '/object-cache.php', true);
    260                         do_action( 'redis_object_cache_enable', $result );
    261                 } else if ($_POST['wpbase_cache_options']['redis_cache'] == NULL || $_POST['wpbase_cache_options']['redis_cache'] == '0') {
    262                         update_option('wpbase_cache_options', 'redis_cache', '0');
    263                         $wp_filesystem->delete(WP_CONTENT_DIR . '/object-cache.php');
    264                         do_action( 'redis_object_cache_disable', $result );
    265                 }
     252
     253
     254        public function do_admin_actions() {
     255            if(strpos($_SERVER["HTTP_REFERER"], "options-general.php?page=wpbasecache") !== false){
     256                    global $wp_filesystem;
     257                    if ( $this->initialize_filesystem( $url, true ) ) {
     258                            if ($_POST['wpbase_cache_options']['redis_cache'] == '1') {
     259                                    update_option('wpbase_cache_options', 'redis_cache', "1");
     260                                    $wp_filesystem->copy(plugin_dir_path(__FILE__) . '/includes/object-cache.php', WP_CONTENT_DIR . '/object-cache.php', true);
     261                                    do_action( 'redis_object_cache_enable', $result );
     262                            } else if ($_POST['wpbase_cache_options']['redis_cache'] == NULL || $_POST['wpbase_cache_options']['redis_cache'] == '0') {
     263                                    update_option('wpbase_cache_options', 'redis_cache', '0');
     264                                    $wp_filesystem->delete(WP_CONTENT_DIR . '/object-cache.php');
     265                                    do_action( 'redis_object_cache_disable', $result );
     266                            }
     267                    }
    266268            }
    267        }
     269    }
     270
    268271    public function initialize_filesystem( $url, $silent = false ) {
    269272
Note: See TracChangeset for help on using the changeset viewer.