• Resolved Pierre_02

    (@pierre_02)


    Hi Scott πŸ™‚ !

    you’ll curse me :)… I’ve found a bug in Simply Static.
    Apparently, to optimize the generation process, you keep a “log” of the last parseed file in the table “wp_simply_static_pages”. The problem is that if a user change its theme you’re gone send the old themes files (and all their dependencies) AND the new ones :). So the destination directory will grow again and again and the genaration process will takes more and more time.

    Could you have a look, please ?

    TIA,

    Amicably,

    Pierre.

    https://ww.wp.xz.cn/plugins/simply-static/

Viewing 2 replies - 1 through 2 (of 2 total)
  • It’s true. If Simply Static has found any pages or files previously it will keep trying to fetch them on subsequent attempts. This is mainly to support future functionality, where Simply Static can compare the content on the current page vs. the last time and figure out if it needs to do any further processing.

    Maybe I need to add some kind of checkbox when initiating the process where it’ll start from scratch and ignore what it’d done previously. I’ll think on it.

    In any case, one way around this is to remove the theme from your WordPress installation. If Simply Static can’t find the files, it won’t include them in the static archive πŸ™‚

    Thread Starter Pierre_02

    (@pierre_02)

    Ok, i’ve worked recently on themes in my functions and there’s a really easy way to get the actual used theme by : get_stylesheet();. This will give you the “slug name” (short name) of the theme.

    So, if it’s the first time the user click on “Generate” you store the value of get_stylesheet(); in the array of settings of simply_static in wp_options table and every other time, you do a get_stylesheet();, compare it with the one you’ve stored before and if it has changed you applied the required process πŸ˜‰ ?
    BTW, no need for users to remove theme(s) from WP and a cleaner method to apply change πŸ™‚ !

    TIA,

    Pierre.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug when changing themes’ is closed to new replies.