Support » Plugin: WP Cassify » Where’s the backup file?

  • Resolved buddywhatshisname

    (@vhmarkgmailcom)


    When I backup the configuration settings, I see the message “Settings saved successfully”, but where is the backup file? Nothing has downloaded and there’s no visible link to download.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Alain-Aymerick FRANCOIS

    (@aaf017)

    Hi,

    You must click on “Backup Plugin Configuration” button not on “Save Options” button. Then json configuration file is automatically downloaded on your local default download folder on your computer.

    Best regards.

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    I wasn’t clear enough 🙂
    I’m indeed clicking the ““Backup Plugin Configuration” button; id=”wp_cassify_backup_plugin_options_settings”. Tested also with
    jQuery(‘#wp_cassify_backup_plugin_options_settings’).click()
    No JS console errors show.

    Tested with WP 4.9 with no other plugins/themes and a clean nightly WP build; multisite; Chrome latest on Windows.

    The request is to
    /wp-admin/network/settings.php?page=wp-cassify.php
    and the request payload shows a form submission of the form data.

    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    The problem is that
    wp-cassify\admin\admin-menu.php::wp_cassify_create_network_menu() does not include these two hooks:

    		// Call export plugin configurations settings function
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_export_configuration_options_settings' ) );
                    
                    // Call import plugin configurations settings function
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_import_configuration_options_settings' ) );
    

    So testing in a single-site will not show the problem.

    I suggest adding them via abstracting the add_action statements that are common to multisite and single site:

    
    	/**
    	 *  Multisite and single-site add_action statements
    	 */                 
            function wp_cassify_add_admin_actions() {
    		// Add javascript needed by metaboxes
    		add_action( 'admin_init', array( $this , 'wp_cassify_add_metaboxes_js' ) );			 
    		 
    		// Call export plugin configurations settings function
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_export_configuration_options_settings' ) );
                    
                    // Call import plugin configurations settings function
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_import_configuration_options_settings' ) );
    		 
    		// Register differents metaboxes on admin screen.
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this, 'wp_cassify_register_metaboxes' ) );  
    		
    		// Add custom javascript functions specific to this plugin
    		add_action( 'load-'. $this->wp_cassify_admin_page_hook, array( $this , 'wp_cassify_add_custom_js' ) );
    	}
            
    	/**
    	 *  Add admin menu options
    	 */ 
    	public function wp_cassify_create_menu() {
    		$this->wp_cassify_admin_page_hook = add_options_page( $this->wp_cassify_plugin_datas['Name'] . ' Options', 
    			$this->wp_cassify_plugin_datas['Name'], 
    			'manage_options', 
    			'wp-cassify.php' , 
    			array( $this, 'wp_cassify_options' )
    		 );
                    
                    $this->wp_cassify_add_admin_actions();
            }
    	
    	/**
    	 *  Add admin menu options if plugin is activate over the network
    	 */         
    	public function wp_cassify_create_network_menu() {
    
    		$this->wp_cassify_admin_page_hook = add_submenu_page( 
                'settings.php',
                $this->wp_cassify_plugin_datas['Name'] . ' Options', 
    			$this->wp_cassify_plugin_datas['Name'], 
    			'manage_options', 
    			'wp-cassify.php' , 
    			array( $this, 'wp_cassify_options' )
    		 );
    
    		// Call register settings function
    		add_action( 'admin_init', array( $this , 'wp_cassify_register_plugin_settings' ) );
    
    		// Call register settings function
    		add_action( 'admin_init', array( $this , 'wp_cassify_register_plugin_settings' ) );
    
                    $this->wp_cassify_add_admin_actions();
    	}
    
    • This reply was modified 3 years, 7 months ago by buddywhatshisname. Reason: Remove error_log() statement
    Thread Starter buddywhatshisname

    (@vhmarkgmailcom)

    Another couple of fixes is needed for multisite wp-cassify config backup to work:

    wp-cassify\admin\admin-menu.php::wp_cassify_export_configuration_options_settings() – replace false in the export function call with $wp_cassify_network_activated:

    			if (! empty( $_POST['wp_cassify_backup_plugin_options_settings'] ) ){
                            global $wp_cassify_network_activated;
    	        	$wp_cassify_backup_plugin_options_settings = WP_Cassify_Utils::wp_cassify_export_configuration_options( $wp_cassify_network_activated );
    	
    				nocache_headers();

    ————————

    wp-cassify\classes\wp_cassify_utils.php::wp_cassify_export_configuration_options() – network option key and value names differ, so need their own for loop

                    if ($wp_cassify_network_activated) {
                        $configuration_options = $wpdb->get_results("SELECT <code>meta_key</code>,</code>meta_value</code> FROM {$wpdb->prefix}sitemeta WHERE <code>meta_key</code> LIKE 'wp_cassify%' AND</code>meta_key</code> != 'wp_cassify_xml_response_value'");
                        foreach ($configuration_options as $configuration_option) {
                            $wp_cassify_export_configuration_options[$configuration_option->meta_key] = $configuration_option->meta_value;
                        }
                    } else {
                        $configuration_options = $wpdb->get_results("SELECT <code>option_name</code>,</code>option_value</code> FROM {$wpdb->prefix}options WHERE <code>option_name</code> LIKE 'wp_cassify%' AND</code>meta_key</code> != 'wp_cassify_xml_response_value'");
                        foreach ($configuration_options as $configuration_option) {
                            $wp_cassify_export_configuration_options[$configuration_option->option_name] = $configuration_option->option_value;
                        }
                    }

    Hi,

    I’ve integrated all your patches in release 2.1.7. The issue might be solved definitively in release 2.1.7.

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Where’s the backup file?’ is closed to new replies.