title: Parse error: syntax error, unexpected end of file - WordPress Plugin
body: <p>I just bought one WordPress plugin and trying to activate using dashboard. I tried to solve this myself but not getting any success.</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code> '2'); ?&gt;
  Parse error: syntax error, unexpected end of file
  </code></pre>
  
  <p><strong>My Code</strong></p>
  
  <pre><code>&lt;?php
  
  function sourceGuard_cp(){
  
  global $sourceGuard_settings;
  ?&gt;
  &lt;div class="wrap"&gt;
  &lt;h2&gt;Source Guard Settings&lt;/h2&gt;
  
  
  &lt;?
  $current_mode = $sourceGuard_settings['mode'];
  
  $enabled_modules = array('html_obfuscator' =&gt; false, 'js_encoder' =&gt; false);
  
  if(isset($_POST['submit'])){
  
      if(($_POST['html_obfuscator'] == 1) &amp;&amp; ($_POST['js_encoder'] == 1)){
  
          $new_mode = '3';
      }
      else if($_POST['html_obfuscator'] == 1){
  
          $new_mode = '1';
      }
      else if($_POST['js_encoder'] == 1){
  
          $new_mode = '2';
      }
      else{
  
          $new_mode = '0';
      }
  
  
      if($fp = @fopen(plugin_dir_path(__FILE__).'settings.php', 'w')){
  
          $current_mode = $new_mode;
  
          fwrite($fp, "&lt;?\n\$sourceGuard_settings = array('mode' =&gt; '".$current_mode."');\n?&gt;");
          fclose($fp);
  
          echo '&lt;div id="setting-error-settings_updated" class="updated settings-error"&gt; &lt;p&gt;&lt;strong&gt;Settings saved.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;';
      }
      else{
  
          echo '&lt;div id="setting-error-settings_updated" class="error settings-error"&gt; &lt;p&gt;&lt;strong&gt;Settings cant be saved!&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;';
      }
  }
  
  switch($current_mode){
  
      case '1';
          //html obfuscation
  
          $enabled_modules['html_obfuscator'] = true;
      break;
      case '2';
          //js encoding
  
          $enabled_modules['js_encoder'] = true;
      break;
      case '3';
          //html+js
  
          $enabled_modules['html_obfuscator'] = true;
          $enabled_modules['js_encoder'] = true;
      break;
  }
  ?&gt;
  
  
  &lt;form action="" method="POST"&gt;
  &lt;h3&gt;Available modules&lt;/h3&gt;
  
  &lt;table class="form-table"&gt;
  
  &lt;tr valign="top"&gt;
  &lt;th scope="row"&gt;&lt;label&gt;HTML obfuscation&lt;/label&gt;&lt;/th&gt;
  &lt;td&gt;
  
      &lt;label&gt;&lt;input name="html_obfuscator" type="radio" value="1" autocomplete="off"&lt;?=($enabled_modules['html_obfuscator'])?' checked':'';?&gt;&gt;&amp;nbsp; &lt;span&gt;Enabled&lt;/span&gt;&lt;/label&gt;&amp;nbsp;&amp;nbsp;
      &lt;label&gt;&lt;input name="html_obfuscator" type="radio" value="0" autocomplete="off"&lt;?=(!$enabled_modules['html_obfuscator'])?' checked':'';?&gt;&gt;&amp;nbsp; &lt;span&gt;Disabled&lt;/span&gt;&lt;/label&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr valign="top"&gt;
  &lt;th scope="row"&gt;&lt;label&gt;JavaScript encoding&lt;/label&gt;&lt;/th&gt;
  &lt;td&gt;
  
      &lt;label&gt;&lt;input name="js_encoder" type="radio" value="1" autocomplete="off"&lt;?=($enabled_modules['js_encoder'])?' checked':'';?&gt;&gt;&amp;nbsp; &lt;span&gt;Enabled&lt;/span&gt;&lt;/label&gt;&amp;nbsp;&amp;nbsp;
      &lt;label&gt;&lt;input name="js_encoder" type="radio" value="0" autocomplete="off"&lt;?=(!$enabled_modules['js_encoder'])?' checked':'';?&gt;&gt;&amp;nbsp; &lt;span&gt;Disabled&lt;/span&gt;&lt;/label&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;p class="submit"&gt;&lt;input name="submit" id="submit" class="button-primary" value="Save Changes" type="submit"&gt;&lt;/p&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;?
  }
  ?&gt;
  </code></pre>
  
  <p>I am getting this error when I am trying to activate one plugin in my WordPress dashboard.</p>
  
  <p>Please help me to solve the issue.</p>