Title: Call to undefined function __()
Last modified: January 23, 2023

---

# Call to undefined function __()

 *  Resolved [Carsten Bach](https://wordpress.org/support/users/carstenbach/)
 * (@carstenbach)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/call-to-undefined-function-__/)
 * ⌊👏⌉⌊👏⌉</img> Dear [@olliejones](https://wordpress.org/support/users/olliejones/),
   I really enjoy the christmas-present, you made to the community in the end of
   last year. Thank you very, very much! ⌊👏⌉</img>
 * After 3 weeks of testing, there was only one small caveat I had to come around.
 * For some unknown reason and during one of this crazy development nights, at some
   point my logs screamed at me:
 *     ```wp-block-code
       01:06:45 UTC] Exception: database disk image is malformed in [..]/wp-content/object-cache.php:490
       01:06:45 UTC] sqlite_object_cache connection failure, deleting sqlite files to retry. 1
       01:06:45 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function __() in [...]/wp-admin/includes/file.php:16
       ```
   
 * So I went down the rabbit hole and found out, that I can avoid this fatal.
 *     ```wp-block-code
       // needed for __()
       require_once ABSPATH . 'wp-includes/l10n.php';
       ```
   
 * I added this to your existing `private function delete_offending_files()` at 
   around line 1821, in the `object-cache.php` dropin.
 * With this fix in place the regeneration of the corrupted db, was not a problem
   anymore.
 * **Was this a proper solution? 
   And would you like to implement this in a upcoming
   release?
 * Maybe you could have a look into this.
 * —
 * I could also create an Issue & PR at [github](https://github.com/OllieJones/sqlite-object-cache)
   if you want.
    -  This topic was modified 3 years, 4 months ago by [Carsten Bach](https://wordpress.org/support/users/carstenbach/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [OllieJones](https://wordpress.org/support/users/olliejones/)
 * (@olliejones)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/call-to-undefined-function-__/#post-16401640)
 * This is very useful indeed. Thanks, [@carstenbach](https://wordpress.org/support/users/carstenbach/)!
   I’ll put it in.
 *  Plugin Author [OllieJones](https://wordpress.org/support/users/olliejones/)
 * (@olliejones)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/call-to-undefined-function-__/#post-16403120)
 * I ended up using the following code. That pattern comes up elsewhere, and looks
   like the way to do this loading of the translation functions if they’re not yet
   loaded. (They’re not loaded when the object cahce drop-in is first loaded.)
 * `if ( ! function_exists( '__' ) ) {`
    `wp_load_translations_early();``}`
 * Thanks again.
    -  This reply was modified 3 years, 4 months ago by [OllieJones](https://wordpress.org/support/users/olliejones/).
    -  This reply was modified 3 years, 4 months ago by [OllieJones](https://wordpress.org/support/users/olliejones/).
 *  Thread Starter [Carsten Bach](https://wordpress.org/support/users/carstenbach/)
 * (@carstenbach)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/call-to-undefined-function-__/#post-16403667)
 * **👍</img>** Looks way better!
 * Great you found my hint useful and were able to implement a nicer solution so
   fast. Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Call to undefined function __()’ is closed to new replies.

 * ![](https://ps.w.org/sqlite-object-cache/assets/icon-128x128.jpg?rev=2829632)
 * [SQLite Object Cache](https://wordpress.org/plugins/sqlite-object-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sqlite-object-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sqlite-object-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/sqlite-object-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sqlite-object-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sqlite-object-cache/reviews/)

## Tags

 * [i18n](https://wordpress.org/support/topic-tag/i18n/)
 * [object-cache](https://wordpress.org/support/topic-tag/object-cache/)

 * 3 replies
 * 2 participants
 * Last reply from: [Carsten Bach](https://wordpress.org/support/users/carstenbach/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/call-to-undefined-function-__/#post-16403667)
 * Status: resolved