1

We recently did a major WordPress site upgrade (3.7.25 to 4.9.4 - yes, probably shouldn't have waited this long). I set up a test environment first and thought there would be no issues. However, upon going live, one of our old plugins didn't work after the upgrade. I did research on the issue and discovered that in 4.9.2 a change was made to always use mysqli by default, and I figured that with this being an older plugin that was probably the issue. A link I found said to add this line in the wp-config.php file:

define('WP_USE_EXT_MYSQL', true);

This solved the issue, everything is working correctly now.

My question is, are there any consequences to using this workaround and enabling the "old" mysql_* functions? Our whole point of upgrading WordPress (and about a year back, our PHP version) was for better security, so I don't want to backtrack and have us be as vulnerable as if we were still on the old version anyway. But at this point we still need this plugin, and updating it is probably not going to happen...

0

I think the problem you are going to have is that of Depreciation. As php is upgraded they will only have the libraries for mysqli installed. This may in the future cause your plugin to stop working.

  • I believe mysql_connect() or mysql_query() functions have been deprecated for years and years, and have finally been removed in PHP 7 – Ken Feb 23 '18 at 19:00
  • Yeah, I'm guessing eventually we're going to need to find another plugin to replace this one, if we want to stay up-to-date. We're currently on PHP 5.6.32. So as far as security is concerned, there wouldn't be an issue with enabling this while we still need this plugin? Would it cause any other portions of our WordPress site to start using mysql_* instead of mysqli_*, or only when it's absolutely necessary (i.e. this old plugin)? – Mike Feb 23 '18 at 20:12
  • I don't believe so. The queries in the normal WP or other plugins that are up-to-date would use the mysqli functions. It would only call the older functions when the plugin makes the query. – Ken Feb 23 '18 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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