• Resolved Rhapsody348

    (@rhapsody348)


    This post is to help others who may have Multisite installations and want to automatically configure the All In One WP Security & Firewall settings on new sites that are added.

    I have a PHP file that automatically configures a new site added with various settings such as the theme & associated settings, setting up sidebar widgets, etc. The firewall settings have been added to the PHP file as follows:

    $aio_wp_security_configs = array (
      'aiowps_enable_debug' => '',...
    
    ..... see comment below on how to get this array.....
    
      'aiowps_block_fake_googlebots' => '1',
    ); // setting to be saved in options table
    
    // update the aio_wp_security_configs using the stored array
    		$status = update_option( 'aio_wp_security_configs', $aio_wp_security_configs );

    The values for the $aio_wp_security_configs were obtained by:
    1. Setting up a new multisite subsite
    2. Manually configure the firewall on this site the same as desired for all sites to be added and save the settings
    3. Use phpmyadmin and open the WordPress database for the multisite
    4. Open with table wp_#_options where wp_# is the prefix for the site you configured in step 2
    5. Use the search for option_name = aio_wp_security_configs
    6. edit the value so you may copy the serialized array to your clipboard
    7. Use the free online unserialize website https://www.unserialize.com/ then paste the clipboard into the input box, select var_export, then click the unserialize button
    8. The Copy the resulting screen output and paste it in the php file between the = sign and the closing ; for the $aio_wp_security_configs = line

Viewing 1 replies (of 1 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Thank you for sharing your solution here. I am sure this will help others wanted to carry out the same settings as you.

    Enjoy the plugin.

    Kind regards

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Code to save & apply Multisite settings’ is closed to new replies.