WordPress.org

Forums

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

  1. Rulatir
    Member
    Posted 1 year 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 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic