wordpress更新到3.5以上后,我发现这个插件有错误。
我不知道如何修理它。如果有人能帮我解决这些问题,或者给我一个如何解决的例子
以下是插件的完整代码:http://pastebin.com/pVUXjWat
我得到的错误:
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'wp_jsrm_menus\' at line 1 for query SHOW TABLES LIKE wp_jsrm_menus made by activate_plugin, do_action(\'activate_simple-retail-menus/simple-retail-menus.php\'), call_user_func_array, jsrm_activate_loop, jsrm_activate
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'wp_jsrm_items\' at line 1 for query SHOW TABLES LIKE wp_jsrm_items made by activate_plugin, do_action(\'activate_simple-retail-menus/simple-retail-menus.php\'), call_user_func_array, jsrm_activate_loop, jsrm_activate
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'wp_jsrm_menus\' at line 1 for query SHOW TABLES LIKE wp_jsrm_menus made by do_action(\'activate_simple-retail-menus/simple-retail-menus.php\'), call_user_func_array, jsrm_activate_loop, jsrm_activate
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'wp_jsrm_items\' at line 1 for query SHOW TABLES LIKE wp_jsrm_items made by do_action(\'activate_simple-retail-menus/simple-retail-menus.php\'), call_user_func_array, jsrm_activate_loop, jsrm_activate
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'wp_jsrm_menus\' at line 1 for query SHOW TABLES LIKE wp_jsrm_menus made by do_action(\'activate_simple-retail-menus/simple-retail-menus.php\'), call_user_func_array, jsrm_activate_loop, jsrm_activate
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'wp_jsrm_items\' at line 1 for query SHOW TABLES LIKE wp_jsrm_items made by do_action(\'activate_simple-retail-menus/simple-retail-menus.php\'), call_user_func_array, jsrm_activate_loop, jsrm_activate
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'wp_jsrm_menus\' at line 1 for query SHOW TABLES LIKE wp_jsrm_menus made by activate_plugin, do_action(\'activate_simple-retail-menus/simple-retail-menus.php\'), call_user_func_array, jsrm_activate_loop, jsrm_activate
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'wp_jsrm_items\' at line 1 for query SHOW TABLES LIKE wp_jsrm_items made by activate_plugin, do_action(\'activate_simple-retail-menus/simple-retail-menus.php\'), call_user_func_array, jsrm_activate_loop, jsrm_activate
此处的所有sql查询
function jsrm_activate() {
add_option(\'jsrm_val_cols\', \'2\');
global $wpdb;
$jsrm_menu_table = $wpdb->prefix . "jsrm_menus";
$jsrm_item_table = $wpdb->prefix . "jsrm_items";
require_once(ABSPATH . \'wp-admin/includes/upgrade.php\');
if (!empty ($wpdb->charset))
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
if (!empty ($wpdb->collate))
$charset_collate .= " COLLATE $wpdb->collate";
if ($wpdb->get_var( "SHOW TABLES LIKE $jsrm_menu_table") != $jsrm_menu_table){
$sql1 = "CREATE TABLE IF NOT EXISTS $jsrm_menu_table (
id mediumint(9) NOT NULL AUTO_INCREMENT,
menuorder mediumint(9) NOT NULL,
name tinytext NOT NULL,
description text,
label tinytext NOT NULL,
itemheader tinytext NOT NULL,
valueheader tinytext NOT NULL,";
for ($v=2;$v<=JSRM_VALUE_COLS;$v++){
$sql1 .= "valueheader" . $v . " tinytext NOT NULL,";
};
$sql1 .= "UNIQUE KEY id (id)
) $charset_collate;";
dbDelta($sql1);
}
if ($wpdb->get_var( "SHOW TABLES LIKE $jsrm_item_table") != $jsrm_item_table){
$sql2 = "CREATE TABLE IF NOT EXISTS $jsrm_item_table (
id mediumint(9) NOT NULL AUTO_INCREMENT,
menu mediumint(9) NOT NULL,
itemorder mediumint(9) NOT NULL,
item tinytext NOT NULL,
description text,
image tinytext,
linked tinyint(1),
linkurl tinytext,
itemhidden tinyint(1),
value tinytext,";
for ($v=2;$v<=JSRM_VALUE_COLS;$v++){
$sql2 .= "value" . $v . " tinytext,";
};
$sql2 .= "UNIQUE KEY id (id)
) $charset_collate;";
dbDelta($sql2);
}
}
// CHECK DATABASE TABLES ON INIT AND UPDATE IF NECESSARY
function jsrm_check_database_version(){
$dbversion = get_option( \'jsrm_db_version\', \'1\' );
if ($dbversion != JSRM_DB_VERSION){
jsrm_activate_loop();
}
}
add_action(\'init\', \'jsrm_check_database_version\');