• Resolved joppuyo

    (@joppuyo)


    Hey!

    I think this plugin is really great but only issue I have noticed that if you have a lot of plugins and themes, it can make the string translation panel very slow. It can take 10-30 seconds to load every time you click anything. This seems to be caused by the fact that the plugin scans all themes and plugins on every page load.

    This makes it very time-consuming to edit the translations, particularly in production environments where translations very rarely change anyway.

    Would it be possible to implement some kind of cache so that the files are scanned for example every five minutes or something like that because results are saved as a transient? This could be an optional feature implemented using a filter.

    Then a small third-party plugin could for example check the current wp_environment_type or the presence of WP_DEBUG variable and set this filter accordingly to enable cache.

    This would allow instantly updating translations in a local environment and improve loading speed in a production environment. Let me know what you think! If you think it’s a good idea I could create a fork of this plugin with this feature which could be then merged into the plugin.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    hello @joppuyo ,
    thank you for your suggestion.
    Firstly, please check if you have necessary themes and plugins selected in tab (In admin dashboard): Languages -> TTfP Settings.

    Secondly, file scanner is run only in “Translations” tab so it’s not so bad, I think 🙂 But it may be very inefficient (as you suggested)…
    Cache idea is very good, I will implement it in my next free time.
    Thanks!

    Thread Starter joppuyo

    (@joppuyo)

    Yes, I realized that it’s possible to uncheck those themes and plugins I don’t need, which dramatically improved the performance.

    The options were a bit hard to find because it is named “Export/import translations”. I would suggest perhaps renaming this to something like “Theme and plugin translation” or similar. It would be nice also to mention this feature in the documentation.

    Anyway, thanks for the great work on the plugin. It would be nice if some of my suggestions could be taken into account in future versions so more people can benefit from improved performance.

    Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    yes, I changed “Export/import translations” in latest version to “TTfP Settings”.

    Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    @joppuyo done, I added little cache in 3.3.0 version of plugin.
    The plugin store scan result for 60 seconds.
    I will develop this in the future with a cache cleaning option etc.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Don’t scan translations every admin panel is accessed’ is closed to new replies.