WPIntell

Source evidence

Database error – using incorrect table prefix

Advanced Admin Search · support · 2019-10-25T07:15:00+00:00

mixedsentiment
highseverity
0.89relevance
1replies
Evidence onlycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 1 rows with source links

100.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

0 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Gal Baras resolved
I’m getting the following error on multiple sites: [22-Oct-2019 23:22:20 UTC] WordPress database error Table 'DBNAME.wp_postmeta' doesn't exist for query SELECT * FROM wp_postmeta WHERE meta_key LIKE '%classroom-375%' OR meta_value LIKE '%classroom-375%' made by do_action('wp_ajax_search_result'), WP_Hook->do_action, WP_Hook->apply_filters, Kuroit\AdvancedAdminSearch\AASKP_advancedAdminSearch->AASKP_searchAction, Kuroit\AdvancedAdminSearch\AASKP_advancedAdminSearch->AASKP_getPostMeta DBNAME is correct on each site, but the table prefix is not “wp_”. Line 268 of advanced-admin-search.php should change from: $postMeta = $wpdb->get_results("SELECT * FROM wp_postmeta WHERE meta_key LIKE '%".$post_search."%' OR meta_value LIKE '%".$post_search."%'"); to $postMeta = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."postmeta WHERE meta_key LIKE '%".$post_search."%' OR meta_value LIKE '%".$post_search."%'"); For security reasons, this statement should also be changed to using prepare : $search_term = '%' . $post_search . '%'; $postMeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}postmeta WHERE meta_key LIKE '%s' OR meta_value LIKE '%s'", $search_term, $search_term ); Hi Gal Baras, Thanks for pointing out the issue. We have just released an update for the plugin which should fix this problem. Regards

Comments

1 shown
Kuroit 2019-12-06T07:15:00+00:00

Hi Gal Baras, Thanks for pointing out the issue. We have just released an update for the plugin which should fix this problem. Regards