• Resolved Kevin Pirnie

    (@kevp75)


    I notice in the wp-admin settings area, that you need to configure the plugin for each subsite of a multisite install.

    While this is ok (albeit slightly tedious) for a multisite with only a couple of subsites, I personally have a circumstance where I am managing one with 50+ subsites.

    Is there a way I can configure the plugin globally across all subsites? Or am I stuck going one by one?

Viewing 15 replies - 1 through 15 (of 42 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    afraid there is no network-level settings-UI, but this code snippet (not mine) offers a relatively easy way to network configure.

    hope this helps,
    frank

    Thread Starter Kevin Pirnie

    (@kevp75)

    Excellent. Appreciate the help.

    Any thoughts to adding a “global” config settings page to the plugin itself?

    Thread Starter Kevin Pirnie

    (@kevp75)

    This is working great, one more question, under extras, i’d like to set the “Remove emojis”, the “Remove querystrings”, do you happen to know what those settings are called?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Any thoughts to adding a “global” config settings page to the plugin itself?

    well, it’s on the long list of potential improvements. if ever you’re into developement and have some spare time; feel free to chime in!

    i’d like to set the “Remove emojis”, the “Remove querystrings”, do you happen to know what those settings are called?

    those are stored in autoptimize_extra_settings but do take into account that is an array;

    array(
        'autoptimize_extra_checkbox_field_1' => '0', // disable emojis
        'autoptimize_extra_checkbox_field_0' => '0', // remove querystring
        'autoptimize_extra_radio_field_4'    => '1', // google fonts
        'autoptimize_extra_text_field_2'     => '',  // preconnect
        'autoptimize_extra_text_field_3'     => '',  // async
        'autoptimize_extra_checkbox_field_5' => '0', // imgopt, will go to sep. setting in 2.5
        'autoptimize_extra_select_field_6'   => '2', // imgopt quality, will go to sep. setting in 2.5
    );

    have fun! ??
    frank

    Thread Starter Kevin Pirnie

    (@kevp75)

    Appreciate it Frank ??
    Will definately look into that… and setting up a “global settings” admin page ??

    Thread Starter Kevin Pirnie

    (@kevp75)

    Hey Frank… one last one for ya… (almost done with a “addon” plugin for it btw ?? )

    I notice some of the options are “on”, “1”, “0”, ”, etc…

    Do they really need to be strings? or am I safe simply having (int)1 or (int)0?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Hmm, AO doesn’t set those options explicitly, they are saved by WordPress core upon settings-page submission, so the safest thing to do (avoiding any issues) would be to use the exact same values as what you see in the wp_options-table?

    Thread Starter Kevin Pirnie

    (@kevp75)

    Appreciate the response… I’ll have to do some more digging ??

    Thread Starter Kevin Pirnie

    (@kevp75)

    Want to collaborate?

    I’m stuck on the final piece… have all options saving correctly, and it does indeed appear to be working as intended… subsites caching properly, options are saved to the proper tables within the database, etc… the odd thing is, when I go into a subsites autoptimize settings page, none of the saved settings populate the form…

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Want to collaborate?

    Would love to but afraid I don’t have a lot of time currently (working hard on finalizing AO25) :-/

    I’m stuck on the final piece… have all options saving correctly, and it does indeed appear to be working as intended… subsites caching properly, options are saved to the proper tables within the database, etc… the odd thing is, when I go into a subsites autoptimize settings page, none of the saved settings populate the form…

    OK, what I would do is have 2 subsites, leaving one configured at the global level and then configuring one at the subsite level (which should result in the settings being visible on the subsites admin page) and then carefully comparing the differences between those at the database level?

    Thread Starter Kevin Pirnie

    (@kevp75)

    Done that ??
    Only difference initially was the feed transient wasnt in the subsites options… but appeared after I visited the settings page for it.

    then I thought server-side caching, wp caching, etc…

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Hmm … and does using update_site_option iso update_option change anything?

    Thread Starter Kevin Pirnie

    (@kevp75)

    I’ll have to look into that update_site_option… right now what I’m doing is looping the sites, setting the “blog”, running update_option, then restoring the current blog…

    Thread Starter Kevin Pirnie

    (@kevp75)

    Yeah, not so sure that’s what we need. It looks like that does indeed update the settings on a network level (in sitemeta table), however, now none of the sites autopopulate their respective settings pages in the admin, and no caching happens.

    It really does seem to only be a display thing here. When I set it up to use just update_options, the primary sites AO settings page is fully populate with the settings created in the new ‘Network Options’ page, they just aren’t displayed in the subsites AO settings pages… yet all caching does indeed work.

    I’ll have to look through your options page and see if I see anything out of whack… maybe I’ve got a typo or something somewhere that is “blocking” the rest of the form from populating…

    Thread Starter Kevin Pirnie

    (@kevp75)

    so… I did as you suggest, it looks like I am missing one setting. autoptimize_service_availablity

Viewing 15 replies - 1 through 15 (of 42 total)
  • The topic ‘Globally Configure for Multisite’ is closed to new replies.