• Resolved redsand

    (@redsand)


    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://ww.wp.xz.cn/plugins/google-language-translator/

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

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