Title: PHP Notices in debug.log
Last modified: August 30, 2016

---

# PHP Notices in debug.log

 *  Resolved [redsand](https://wordpress.org/support/users/redsand/)
 * (@redsand)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/php-notices-filling-up-debuglog/)
 * Hi Rob,
 * This is a great translation plugin. However there are a few small but nagging
   issues that need to be fixed. We run WP_DEBUG with logging 24/7 on all our test
   sites. Our debug.log files have gotten a lot of errors from this plugin. We’ve
   had to modify the plugin code to get rid of them.
 * It doesn’t seem like you’ve been monitoring the support forum on here for a long
   time now, so I’m hoping that you check back in here and fix some of these things.
 * Here are the errors:
 *     ```
       PHP Notice:  Undefined variable: english_flag_choice in /XXXXXX/wp-content/plugins/google-language-translator/google-language-translator.php on line 372
       PHP Notice:  Undefined variable: english_flag_choice in /XXXXXX/wp-content/plugins/google-language-translator/google-language-translator.php on line 375
       PHP Notice:  Undefined variable: spanish_flag_choice in /XXXXXX/wp-content/plugins/google-language-translator/google-language-translator.php on line 378
       PHP Notice:  Undefined variable: portuguese_flag_choice in /XXXXXX/wp-content/plugins/google-language-translator/google-language-translator.php on line 381
       PHP Notice:  Undefined variable: lang_attribute in /XXXXXX/wp-content/plugins/google-language-translator/google-language-translator.php on line 385
       ```
   
 * They’re all easy fixes. Just make the following edits.
 * Change line 372 from:
 *     ```
       if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
       ```
   
 * to:
 *     ```
       if ( isset( $language_name, $english_flag_choice ) && $language_name === 'English' && $english_flag_choice === 'canadian_flag' ) {
       ```
   
 * Change line 375 from:
 *     ```
       if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
       ```
   
 * to:
 *     ```
       if ( isset( $language_name, $english_flag_choice ) && $language_name === "English" && $english_flag_choice === 'us_flag' ) {
       ```
   
 * Change line 378 from:
 *     ```
       if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
       ```
   
 * to:
 *     ```
       if ( isset( $language_name, $spanish_flag_choice ) && $language_name === 'Spanish' && $spanish_flag_choice === 'mexican_flag' ) {
       ```
   
 * Change line 381 from:
 *     ```
       if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
       ```
   
 * to:
 *     ```
       if ( isset( $language_name, $portuguese_flag_choice ) && $language_name === 'Portuguese' && $portuguese_flag_choice === 'brazilian_flag' ) {
       ```
   
 * Change line 385 from:
 *     ```
       if ($lang_attribute == 'yes') {
       ```
   
 * to:
 *     ```
       if ( isset( $lang_attribute ) && $lang_attribute === 'yes') {
       ```
   
 * One additional request…it would be great if you could minify the JavaScript code
   that you place inline in the HTML, so it takes up the minimum amount of space
   in a page’s code, since not everyone uses minification plugins.
 * Thank you.
 * – Scott
 * [https://wordpress.org/plugins/google-language-translator/](https://wordpress.org/plugins/google-language-translator/)

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

 *  [Rob Myrick](https://wordpress.org/support/users/rm2773/)
 * (@rm2773)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/php-notices-filling-up-debuglog/#post-6324140)
 * Scott, thanks for the update. I will definitely get this fixed here in the next
   few week.
 * I appreciate the helpful feedback here. Very helpful and the solution provided–
   thanks man!
 *  Thread Starter [redsand](https://wordpress.org/support/users/redsand/)
 * (@redsand)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/php-notices-filling-up-debuglog/#post-6324143)
 * You’re very welcome. 🙂 Awesome…looking forward to it.
 * No problem…glad to contribute a little bit.
 * I’ll be sure to update my rating back to 5 after the update too. 🙂
 *  [Rob Myrick](https://wordpress.org/support/users/rm2773/)
 * (@rm2773)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/php-notices-filling-up-debuglog/#post-6324322)
 * Scott, would you mind emailing me here, and I’ll send you an update so that you
   can do an objective test 🙂
 * Email info at wp-studio.net
 *  Thread Starter [redsand](https://wordpress.org/support/users/redsand/)
 * (@redsand)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/php-notices-filling-up-debuglog/#post-6324323)
 * Hey Rob…you got it. Emailing in 3, 2, 1. 🙂
 *  Thread Starter [redsand](https://wordpress.org/support/users/redsand/)
 * (@redsand)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/php-notices-filling-up-debuglog/#post-6324394)
 * Thanks for fixing everything, Rob! 🙂
 *  [Rob Myrick](https://wordpress.org/support/users/rm2773/)
 * (@rm2773)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/php-notices-filling-up-debuglog/#post-6324401)
 * Your welcome Scott. Thanks man!

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

The topic ‘PHP Notices in debug.log’ is closed to new replies.

 * ![](https://ps.w.org/google-language-translator/assets/icon-256x256.png?rev=3007649)
 * [Translate WordPress - Google Language Translator](https://wordpress.org/plugins/google-language-translator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-language-translator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-language-translator/)
 * [Active Topics](https://wordpress.org/support/plugin/google-language-translator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-language-translator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-language-translator/reviews/)

## Tags

 * [errors](https://wordpress.org/support/topic-tag/errors/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 6 replies
 * 2 participants
 * Last reply from: [Rob Myrick](https://wordpress.org/support/users/rm2773/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/php-notices-filling-up-debuglog/#post-6324401)
 * Status: resolved