Recover Same WordPress Admin Password

In general, no. This is not possible. The password is btw, not encrypted only once, but twice with md5. There are some cases where you type the password to the database, and for the short time, it will not be encrypted at all. 🙂 The very first time the admin authenticate itself again, the password … Read more

How to stop WordPress from using utf8mb4_unicode_ci collation

You can filter every database query with the hook query, for example like this: add_filter( ‘query’, function ( $query ) { return str_replace( ‘utf8mb4_unicode_ci’, ‘utf8_unicode_ci’, $query ); }); However, I would strongly recommend not to do this. Update your databases instead. The old utf8_* collations have very annoying limitations, and you will run into plugin … Read more

DROP TABLE IF EXISTS `wp_options` error?

Check this ref. If you don’t have the database create instruction inside your script: CREATE DATABASE your_db; You need to manually do that. Else if you have the database: use this to select it first before executing the script. USE your_db;

Database size Widget

Add the following code to your widget code: function fileSizeInfo($filesize) { $bytes = array(‘KB’, ‘KB’, ‘MB’, ‘GB’, ‘TB’); if ($filesize < 1024) $filesize = 1; for ($i = 0; $filesize > 1024; $i++) $filesize /= 1024; $dbSizeInfo[‘size’] = round($filesize, 3); $dbSizeInfo[‘type’] = $bytes[$i]; return $dbSizeInfo; } function databaseSize() { global $wpdb; $dbsize = 0; $rows … Read more

Attach posts based on category and position

I’m wondering if you’re actually looking at post revisions. Keep in mind that WordPress creates a revision of a post any time you make a change to it. Each revision stays in the database, however, the way you access it is by going into the post itself and then locating the revision section in the … Read more

Log IP of users who click a button? [closed]

It depends on how the button works. For instance, you can make an API. When the button is clicked, you can call the api via Ajax and save the IP during the process. Or most likely you will write ip via action hook, if the button call the hook. In this case, you will use … Read more

Prevent creation of unused database tables?

I’m afraid it won’t be easy to do (if possible at all). These tables are empty and you don’t use them, but… There are still many SQL queries that use them in JOINs. It means, that if you remove these tables, these JOINs queries will cause errors. There are many functionalities in backend, that use … Read more