Title: Code Mod Request
Last modified: August 21, 2016

---

# Code Mod Request

 *  Resolved [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/)
 * Hello,
 * I was assisting a user with trying to figure out why the email notification links
   were resulting in 404 errors. I checked your plugin code and noticed that you
   are hard coding the table names. More importantly you are assuming that someone
   has not changed their WP Table prefix and are using the default wp_ DB table 
   prefix.
 * This is very simple to correct.
 *     ```
       function wev_install(){
       		global $wpdb, $wp_version;
   
       		if($wpdb->get_var("show tables like '".wev_temp_user. "'") != wev_temp_user){
       		$sSql = "CREATE TABLE IF NOT EXISTS <code>&quot;. wev_temp_user. &quot;</code> (";
       		$sSql = $sSql . "<code>user_id</code> INT NOT NULL AUTO_INCREMENT ,";
       		$sSql = $sSql . "<code>user_name</code> TEXT NOT NULL,";
       		$sSql = $sSql . "<code>user_pass</code> TEXT NOT NULL,";
       		$sSql = $sSql . "<code>user_email</code> TEXT NOT NULL,";
       		$sSql = $sSql . "<code>confirm_code</code> TEXT NOT NULL,";
       		$sSql = $sSql . "PRIMARY KEY (<code>user_id</code>)";
       		$sSql = $sSql . ")";
       		$wpdb->query($sSql);
       	}
       	}
       ```
   
 * Example of how to use the WordPress DB table prefix object and other things.
 *     ```
       $example_table_name = $wpdb->prefix . "example_table_name";
   
       	if ( $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s", $example_table_name ) ) != $example_table_name ) {	
   
       	$sql = "CREATE TABLE $example_table_name (
         id bigint(20) NOT NULL AUTO_INCREMENT,
         status VARCHAR(60) DEFAULT '' NOT NULL,
         user_id VARCHAR(60) DEFAULT '' NOT NULL,
         username VARCHAR(60) DEFAULT '' NOT NULL,
         public_name VARCHAR(250) DEFAULT '' NOT NULL,
         email VARCHAR(100) DEFAULT '' NOT NULL,
         role VARCHAR(15) DEFAULT '' NOT NULL,
         human_time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
         login_time VARCHAR(10) DEFAULT '' NOT NULL,
         lockout_time VARCHAR(10) DEFAULT '' NOT NULL,
         failed_logins VARCHAR(2) DEFAULT '' NOT NULL,
         ip_address VARCHAR(45) DEFAULT '' NOT NULL,
         hostname VARCHAR(60) DEFAULT '' NOT NULL,
         request_uri VARCHAR(255) DEFAULT '' NOT NULL,
         UNIQUE KEY id (id)
           );";
   
       	require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
       	dbDelta($sql);
       	}
       ```
   
 * [https://wordpress.org/plugins/woocommerce-email-verification/](https://wordpress.org/plugins/woocommerce-email-verification/)

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

 *  Plugin Author [subhansanjaya](https://wordpress.org/support/users/subhansanjaya/)
 * (@subhansanjaya)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859211)
 * Thanks for letting me know, but I’m not sure why I need to use prefix for the
   custom table as if you check the class file, you will see that I used table prefix
   for the core tables.
 *  Thread Starter [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859214)
 * Well what happens is your DB Tables are never created in the first place. Then
   these php errors will be seen in the php error log file.
 * This particular user’s DB table prefix is: cwkq1hx6b_
    You can see from the php
   errors that the DB name is limeskittles and the error indicates that the wp_users
   DB table does not exist because the DB table name is cwkq1hx6b_users since the
   DB Table prefix was changed/renamed.
 *     ```
       [25-Apr-2014 01:24:53 UTC] WordPress database error Table 'limeskittles.wp_users' doesn't exist for query
       		SELECT *
       		FROM <code>wp_users</code>
       		WHERE <code>ID</code> = 58
       		LIMIT 1
       		 made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, WC_Form_Handler->process_registration, wc_create_new_customer, wp_insert_user, do_action('user_register'), call_user_func_array, WEV_Email_Verification->create_temp_user
       ```
   
 * Same issue here. the DB table does not exist and if it did it should be cwkq1hx6b_wev_temp_user
   and NOT wev_temp_user.
 *     ```
       [28-Apr-2014 05:02:38 UTC] WordPress database error Table 'limeskittles.wev_temp_user' doesn't exist for query INSERT INTOwev_temp_user`
       			(user_name, user_pass, user_email, confirm_code)
       			VALUES('info', '$P$BvxRe/u/HyZUtZ0nsI0mx.XUvMOJVL.', 'info@ait-pro.com', '652be0f93752ea92fa63d999b03d5ee5') made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, WC_Form_Handler->process_registration, wc_create_new_customer, wp_insert_user, do_action('user_register'), call_user_func_array, WEV_Email_Verification->create_temp_user`
       ```
   
 *  Thread Starter [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859216)
 * And yes I did see that your class was using the WP DB Table prefix code so you
   only need to modify the other functions that do not have/include the necessary
   WP DB Table prefix code.
 *  Plugin Author [subhansanjaya](https://wordpress.org/support/users/subhansanjaya/)
 * (@subhansanjaya)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859242)
 * I don’t think it is necessary to use prefix for a custom table which is temporary.
   You probably testing an old version of the plugin or you might change the code.
 *  Thread Starter [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859245)
 * I downloaded your most current version. It is no big deal to me and does not 
   matter to me. I will inform the user that he needs to uninstall or recode your
   plugin if he wants to use it. I was just trying to help you out to save you the
   endless headaches you are definitely going to have with your plugin. Good luck
   with that.
 *  Plugin Author [subhansanjaya](https://wordpress.org/support/users/subhansanjaya/)
 * (@subhansanjaya)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859246)
 * Thanks because I’m getting really good reviews about the plugin and there is 
   a premium version of the plugin. You can have a look, if you like.
 *  Thread Starter [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859250)
 * Congratulations! Yep, we do pretty well ourselves with our Pro version. 😉
 *  [KushClean](https://wordpress.org/support/users/kushclean/)
 * (@kushclean)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859251)
 * your code messed up our site, just because you don’t have bad reviews doesnt 
   mean your code is good. AITpro hit the name on the head, good luck with the problems
   you will eventually have. i uninstalled your plugin and NOW the problem is gone.
   🙂
    you need to sometimes listen to others that have more experience. you cost
   me a lot of headaches until the problem YOUR PLUGIN was found.
 *  Thread Starter [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859252)
 * [@kushclean](https://wordpress.org/support/users/kushclean/) – ouch man. I did
   not expect you to give this plugin author a 1 star vote (being a plugin author
   this is a very painful thing). I understand your frustration man, but give subhansanjaya
   a chance on this one to correct things or work directly with you to figure this
   out. I think everything just got misinterpreted/distorted here so I’m sure you
   can work this out. You can change your star ratings/vote once everything is good
   to go. Thanks.
 *  Thread Starter [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859272)
 * I stand corrected and was wrong about needing to add the additional – `$wpdb-
   >prefix` – object since I misinterpreted what your plugin is doing.
 * The source origin of the problem is that the wp better security plugin was installed
   on this site at one point and it breaks your plugin. See the link below for additional
   information.
 * [http://wordpress.org/support/topic/admin-area-impossible-to-create-new-account?replies=18#post-5518161](http://wordpress.org/support/topic/admin-area-impossible-to-create-new-account?replies=18#post-5518161)
 *  [KushClean](https://wordpress.org/support/users/kushclean/)
 * (@kushclean)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859275)
 * found the problem
    here is my new review which clearly find me and ithemes DB
   entry at fault not your plugin great work it does what it says and thats what
   we wanted
 *  [KushClean](https://wordpress.org/support/users/kushclean/)
 * (@kushclean)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859276)
 * [http://wordpress.org/support/view/plugin-reviews/woocommerce-email-verification](http://wordpress.org/support/view/plugin-reviews/woocommerce-email-verification)

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

The topic ‘Code Mod Request’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-email-verification_7c6f5f.
   svg)
 * [WooCommerce Email Verification](https://wordpress.org/plugins/woocommerce-email-verification/)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-email-verification/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-email-verification/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-email-verification/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-email-verification/reviews/)

## Tags

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

 * 12 replies
 * 3 participants
 * Last reply from: [KushClean](https://wordpress.org/support/users/kushclean/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/code-mod-request-1/#post-4859276)
 * Status: resolved