Can we Manage Plugin Settings on A Plugin Before (Or After) Network Activation

Can we Manage Settings on A Plugin Before (Or After) Network Activation? I want to preset the max and min settings for image size for the plugin called WP Smush Pro before I network activate it. Is that possible? I have about 1000 sub sites on my WP MS install and do not want 1000 users to each have to set max and min image settings to 1024 from the default 9999. I have seen the max setting in the settings file called “wp-smushit/lib/class-wp-smush-admin.php”. If I change that, then network activate, will my edited max of 1024 take effect?

  • nistregistration
    • Flash Drive

    Hi Luis,

    I tried editing the file in the place where I thought the code would be then notwork activated the plugin, but the sites on my install only take on the default WP Smush settings. Perhaps I am editing the wrong part of the file, or I need to use a script to find and edit the plugin settings in each blog database.

  • Luís Lopes
    • QA

    Hi nistregistration ,

    Hope you’re doing well today!

    Try override all themes settings, using this code:

    function override_thumb_size (){

    if( function_exists( 'add_theme_support' ) ) {

    set_post_thumbnail_size( 1200, 1024);

    }

    }

    add_action( 'after_setup_theme', 'override_thumb_size', 11 );

    I created a mu-plugin, so, download the .zip file attached, unzip it and upload the “override-thumb-size.php” to “wp-content/mu-plugins” folder.

    If you don’t have a “mu-plugins” folder inside “wp-content”, please, create it.

    https://wpmudev.com/manuals/wpmu-manual-2/installing-mu-plugins/

    I hope this information has been helpful. If I can help you in this or other questions, please let me know!

    Cheers, Luís

  • nistregistration
    • Flash Drive

    Hi there,

    We tried to deploy this and we don’t see any difference in our WP Smush settings on any blog on our multisite server. Thanks for trying to help. I suspect that we are just not skilled enough to explain what we want or to know how to deploy your solution.

  • Jude
    • DEV MAN

    Hi there nistregistration

    Hope all is well with you, just working alongside Luis here.

    I see that you already have the plugin activated, in this case it may be better to back your database up and simply set this directly.

    Look for this key

    wp-smush-resize_sizes

    It will be found in the wp_options table, simply edit the height and width there and you should be set

    Cheers

    Jude