Support » Plugin: Toplytics » custom.template.php deleted while updating

  • Resolved bapman

    (@bapman)


    Hello,

    I just updated to 4.0.10 from 4.0.9 with wp-cli and it deleted my custom.template.php file!

    Can you please correct this?

    Cheers!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Presslabs

    (@presslabs)

    Hello @bapman,

    That shouldn’t happen. Let me look into this and get back to you.

    Was the file located in the plugin folder or the active theme folder?

    Thread Starter bapman

    (@bapman)

    Thanks! It is in plugins/toplytics/resources/views/frontend

    Plugin Author Presslabs

    (@presslabs)

    Thank you.

    I’ll run some tests and get back to you.

    Plugin Author Presslabs

    (@presslabs)

    Hello @bapman,

    Thank you for reporting this behavior.

    I have tested this and I confirm that it happens as you described. It happens due to how WP updates the plugin, so there’s nothing we can do to fix it.

    However, there is an alternative you can use right now to prevent this from happening with the next update of the plugin.

    Please move the custom template to your child-theme folder and name it toplytics-template.php. It should be in wp-content/themes/<child-theme-slug>/toplytics-template.php. It’s important to be a child theme, otherwise, it will be overwritten again when you update the theme. WP updates the theme similar to how it updates the plugins so unless you have a child theme it will vanish when you updated the theme as well.

    About child themes:
    https://developer.wordpress.org/themes/advanced-topics/child-themes/

    I’ll need to update the docs for this and even remove the custom template check it does for the plugin folder itself. I’ll prepare a new release soon to include the comment updates and remove the check it does for the plugin folder itself.

    Github issue: https://github.com/presslabs/toplytics/issues/162

    • This reply was modified 1 month, 4 weeks ago by Presslabs. Reason: Add github issue
    Thread Starter bapman

    (@bapman)

    Hello!

    Thanks for the great support!

    I have a full custom theme so I directly moved the toplytics template inside it. I trust it will keep working when updating now.

    Again, thanks for this beautiful plugin!

    Plugin Author Presslabs

    (@presslabs)

    Thank you as well @bapman!

    It will continue to work from the active theme folder for sure.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.