Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I changed my prefix of my tables from the wp_ to something else for security reasons and good practice etc. I was curious most of new plugins installed take on the new prefix but I have one that refuses and still installs with wp_ it still works but i was curious is that normal practice or just a bad written plugin?

share|improve this question

1 Answer 1

Short answer: Just a badly written plugin.

Longer answer: When a plugin calls the database in the right/correct/best practice way it uses Global $wpdb instead of just naming the database table, for example:

Wrong way

$sql = "SELECT * FROM wp_posts WHERE... "

Right way

$sql = "SELECT * FROM $wpdb->posts WHERE... "

this way it would work even if you change your tables prefix.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.