Title: Plugin not working!
Last modified: August 31, 2016

---

# Plugin not working!

 *  [Fahad Alduraibi](https://wordpress.org/support/users/fduraibi/)
 * (@fduraibi)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/plugin-not-working-377/)
 * I am testing the plug in on a fresh blog, (no other plugins and default everything)
   WP v. 4.4.2.
 * I added two languages Arabic and English
 * The html tag without the plugin looks like this:
    `<html class="js" lang="en-
   US">`
 * But after enabling the plugin it becomes:
    `<html class="" <br="">`
 * This happenes on the front page and also single posts regardless if a language
   is chosen or not.
 * [https://wordpress.org/plugins/language-field/](https://wordpress.org/plugins/language-field/)

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

 *  Thread Starter [Fahad Alduraibi](https://wordpress.org/support/users/fduraibi/)
 * (@fduraibi)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/plugin-not-working-377/#post-7233200)
 * I get these errors from php:
 *     ```
       Undefined index: lang in /var/www/html/wordpress/wp-content/plugins/language-field/lf_core_functions.php
       Undefined variable: thePostID in /var/www/html/wordpress/wp-content/plugins/language-field/lf_core_functions.php
       ```
   
 * Might be the reason behind it not working.
 *  Thread Starter [Fahad Alduraibi](https://wordpress.org/support/users/fduraibi/)
 * (@fduraibi)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/plugin-not-working-377/#post-7233202)
 * The problem is with thePostID
 * It is defined as `the_Post_ID` but then used as `thePostID`
 * Here is the original code:
 *     ```
       $the_Post_ID = $wp_query->post->ID;
       	$lf_language_code = get_post_meta( $thePostID, '_lf_language_code', true);
       ```
   
 * The fix:
 *     ```
       $the_Post_ID = $wp_query->post->ID;
       	$lf_language_code = get_post_meta( $the_Post_ID, '_lf_language_code', true);
       ```
   
 * But the other error is still not resolved.
 *  Thread Starter [Fahad Alduraibi](https://wordpress.org/support/users/fduraibi/)
 * (@fduraibi)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/plugin-not-working-377/#post-7233207)
 * There are so many issues with your plugin, also the code is not following a standard
   indentation.
 *     ```
       Notice: Use of undefined constant addlflang - assumed 'addlflang' in /var/www/html/wordpress/wp-content/plugins/language-field/lf_admin_page.php on line 10
   
       Notice: Use of undefined constant reset - assumed 'reset' in /var/www/html/wordpress/wp-content/plugins/language-field/lf_admin_page.php on line 12
   
       Notice: Undefined index: reset in /var/www/html/wordpress/wp-content/plugins/language-field/lf_admin_page.php on line 12
       ```
   
 *  Thread Starter [Fahad Alduraibi](https://wordpress.org/support/users/fduraibi/)
 * (@fduraibi)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/plugin-not-working-377/#post-7233215)
 * The solution for the `undefined constant` is to quote the array keys as follow:
 *     ```
       if(isset($_POST['addlflang'])) {
       ```
   
 * and
 *     ```
       } else if($_GET['reset']==1) {
       ```
   
 *  Thread Starter [Fahad Alduraibi](https://wordpress.org/support/users/fduraibi/)
 * (@fduraibi)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/plugin-not-working-377/#post-7233221)
 * Solution for `undefined index` do this:
 *     ```
       else if( (isset($_GET['reset']) ? $_GET['reset'] : '')==1 ) {
       ```
   

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

The topic ‘Plugin not working!’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/language-field_dcdcdc.svg)
 * [Language Field](https://wordpress.org/plugins/language-field/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/language-field/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/language-field/)
 * [Active Topics](https://wordpress.org/support/plugin/language-field/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/language-field/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/language-field/reviews/)

 * 5 replies
 * 1 participant
 * Last reply from: [Fahad Alduraibi](https://wordpress.org/support/users/fduraibi/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/plugin-not-working-377/#post-7233221)
 * Status: not resolved