title: Call to undefined function add_action()
body: <p>I am developing a plugin for custom registration form.I have first file customapplicationform.php file , other files in side registration and shortcode folder.
  So, My Plugin Directory structure like this :</p>
  
  <pre><code>  ---&gt;customapplicationform 
      |--js
          |--ajax-registration.js
      |--registration  
         |--registration.php
         |--regsubmit.php
         |--scripts.php  
     |--shortcode 
         |--display.php 
         |--shortcodes.php            
  </code></pre>
  
  <p>--customapplicatioform.php</p>
  
  <p>It's give error :</p>
  
  <pre><code> Fatal error: Call to undefined function add_action() in     E:\xampp\htdocs\aism\wp-content\plugins\customapplicationform\registration\scripts.php on line 17
  </code></pre>
  
  <p>Please , Tell me what is the problem with this ? and if there any better way than suggest me. Thanks in advance.</p>
  
  <p>1) This is my <code>customapplicationform.php</code> file.</p>
  
  <pre><code>require_once(ABSPATH.'wp-admin/includes/plugin.php');
  
  
  ob_start();
  
  global $app_db_version;
  $app_db_version = '1.0';
  
  
  function app_install() {
  
  global $wpdb;
  global $app_db_version;
  
  $table_name = $wpdb-&gt;prefix .'registeration';
  
   $charset_collate = $wpdb-&gt;get_charset_collate();
  
  $sql = "CREATE TABLE $table_name (
      regid mediumint(9) NOT NULL AUTO_INCREMENT,
      time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
      fname varchar(50) NOT NULL,
              lname varchar(50) NOT NULL,
              email varchar(50) NOT NULL,
              phno  int(12) NOT NULL,
      PRIMARY KEY(regid)
  ) ";
  
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
  dbDelta( $sql );
  
  add_option( 'app_db_version', $app_db_version );
  }
  register_activation_hook( __FILE__, 'app_install');
  include_once('/shortcode/shortcodes.php');
  </code></pre>
  
  <p>2) This is my <code>shortcodes.php</code> file.</p>
  
  <pre><code> function shortcode_function( $atts ) {
      $plugin_dir_path = dirname(__FILE__);
      include_once('display.php');
      $data = ob_get_clean();
      return $data; 
    }
   add_shortcode( 'custom-application', 'shortcode_function' );
  </code></pre>
  
  <p>3) This is my <code>display.php</code> file.</p>
  
  <pre><code>    include_once(''.dirname(dirname(__FILE__)).'/registration/registration.php');
  </code></pre>
  
  <p>4) This is my <code>registration.php</code> file. </p>
  
  <pre><code>  &lt;form action="&lt;?php echo plugins_url();&gt;/customapplicationform/registration/regsubmit.php" method="Post"&gt;
  
  &lt;label&gt;First Name:&lt;/label&gt;
  &lt;input type="text" name="appfname" id="appfname" /&gt;
  
  &lt;label&gt;Last Name :&lt;/label&gt;
  &lt;input type="text" name="applname" id="applname" /&gt;
  
  &lt;label&gt;Email :&lt;/label&gt;
  &lt;input type="email" name="appemail" id="appemail" /&gt;
  
  &lt;label&gt;Phone :&lt;/label&gt;
  &lt;input type="tel" name="appphone" id="appphone" /&gt;
  
  &lt;?php// wp_nonce_field('app_new_user','app_new_user_nonce', true, true ); ?&gt;
  
  &lt;input type="Submit" value="Submit" id="btn-new-user"&gt;
  
  
  &lt;/form&gt;
  </code></pre>
  
  <p>5) This is my <code>regsubmit.php</code> file.</p>
  
  <pre><code>require_once('scripts.php');
    // Verify nonce
   if( ! wp_verify_nonce( $_POST['app_new_user_nonce'], 'app_new_user' ) )
   {
    die( 'Ooops, something went wrong, please try again later.' );
   }
  else {
  
  if(isset($_POST['appemail'])) {
  // Post values
  echo $fname = $_POST['appfname'];
  echo  $lname = $_POST['applname'];
  echo  $email    = $_POST['appemail'];
  echo  $phone     = $_POST['appphone'];
  
  $userdata = array(
      'fname' =&gt; $fname,
      'lname'  =&gt; $lname,
      'email' =&gt; $email,
      'phno' =&gt; $phone,
  
   );
  
  $user_id = wp_insert_user( $userdata ) ;
  
  // Return
     if( !is_wp_error($user_id) ) {
           echo '1';
       } else {
          echo $user_id-&gt;get_error_message();
       }
    }
   }
  </code></pre>
  
  <p>6) This is my <code>scripts.php</code> file . </p>
  
  <pre><code>  function app_register_user_scripts() {
      // Enqueue script
         wp_register_script('app_reg_script', dirname(__FILE__). '/js/ajax-          registration.js', array('jquery'), null, false);
      wp_enqueue_script('app_reg_script');
  
     wp_localize_script( 'app_reg_script', 'app_reg_vars',      array('app_ajax_url' =&gt; admin_url( 'admin-ajax.php' )));
       }
    add_action('wp_enqueue_scripts', 'app_register_user_scripts');
  </code></pre>