Load Time

Hello: My site was loading slower then normal so I investigated and found that this plugin was the culprit. More specifically the custom date picker java script. I don't think I am using the date picker.

I don't know much about java script but my question is...

Can this part of the plugin be disabled or this portion of the plugin be removed without breaking the other functionality? Here is the string http://hspire.com/wp-content/plugins/custompress/datepicker/js/i18n/jquery.ui.datepicker-.js?ver=1.8.18

All suggestions and options are greatly appreciated.

  • aecnu
    • WP Unicorn

    Greetings randit,

    This is a great question in which I do not have an answer.

    I see the date picker in Custom Press settings but no way to disable it.

    I will go ahead and ask the lead developer to come in here and offer his invaluable insight to see if in fact we can disable the date picker somehow.

    This may take a bit longer then a normal ticket, but i will try to get him in here asap.

    Cheers, Joe

  • aecnu
    • WP Unicorn

    Greetings randit and Arnold,

    @Arnold thank you so much for popping in here so quickly, it is greatly appreciated and I am certain that our member will appreciate it also.

    @randit please let us know at your earliest convenience if Arnold's attached fix above does indeed fix the reported performance issue.

    We look forward to hearing from you one way or the other.

    Cheers, Joe

  • lighthouse
    • Design Lord, Child of Thor


    We have tried the beta version above and it works well if no language is specified.

    However it is still breaking when we specify a 5 letter code (e.g. en-GB) due to line 65 of core.php only taking the first two letters (it is trying to load the non-existent jquery.ui.datepicker-en.js). Changing that line to $lang = WPLANG; fixes the issue.

  • Arnold
    • El Macho WP


    "The naming convention of the .mo files is based on the ISO-639 language code (e.g. pt for Portuguese) followed by the ISO-3166 country code (e.g. _PT for Portugal or _BR for Brazil). So, the Brazilian Portuguese file would be called pt_BR.mo, and a non-specific Portuges file would be called pt.mo."


    So you should be using en_GB instead of en-GB. However the page referenced promptly gives an example using en-GB so they violate their own standard. :slight_smile:

    The standard translation files naming convention for datepicker is with the dash so I think I'm going to have to make it accept either version to avoid the confusion. Don't know what effect using the dash for WPLANG would have on other plugins and themes.

    PHP uses dash convention for setlocale() but Zend has a big list of locales using the underbar in their code.


    In the final analysis it's just string matching.

  • lighthouse
    • Design Lord, Child of Thor

    Hi thanks for the quick responses,

    I'm not sure I fully explained the problem - the Custompress plugin stores its language files for the jQuery datepicker in JavaScript files which happen to be in the 'dash' format, however this isn't an issue as it already converts _ to - in the code (at around line 69 of custompress/core/code.php).

    Our problem is a couple of lines above (around line 65) where the $lang variable is set to only take the first two characters of WPLANG - this means that en_GB becomes just en which isn't a huge issue but there isn't a query.ui.datepicker-en.js file meaning that we are getting the original problem randit had of a 404 page being slowly loaded as a script file!

  • Arnold
    • El Macho WP

    Yes and just below that it looks through a list of 5 character locale code, one of which is "en_GB" as exceptions and there is a language file for that. If it finds it it uses the 5 character locale uinsted of the 2 character. You are using "en-GB" which of course doesn't match.

    The next version will convert everytihng to "-" and then do the matching which should solve it.

  • aecnu
    • WP Unicorn


    It appears that with the release of Custom Press 1.2.4 this particular topic is now resolved/closed, if you need any further assistance please let us know.

    If it wasn't resolved, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Thank you for being a WPMU Dev member!

    Cheers, Joe :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.