WordPress.org

Ready to get started?Download WordPress

Forums

Bogo
Performance issue in bogo_languages() function (2 posts)

  1. Rulatir
    Member
    Posted 12 months ago #

    There is a performance issue in bogo_languages() function. The $langauges array is recreated on every call to bogo_languages(), resulting in 61 calls to __() - one for each language name. bogo_languages() is in turn called 70 times during a request for "/" (on my machine, but a cursory glance at the code suggest that the exact number depends on the number of installed locales). This results in 61*70 = 4270 calls to translate(), and the performance hit is noticeable.

    Please consider caching the $languages array in a global variable.

    http://wordpress.org/plugins/bogo/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 12 months ago #

    You're right. Thank you for the good suggestion.

Reply

You must log in to post.

About this Plugin

About this Topic