How to get data from WordPress site sql file

The problem is that your images reside in /wp-content/uploads/ and without this folder, everything will be restored except images and some files you have previously uploaded to the Media Library. The plugin(s) and the theme you used could be installed (uploaded and activated) again. To backup a WordPress websites you only need to backup the … Read more

change wp user status from wp_users table

User roles are not stored in wp_user table. They are stored as User Metadata. In wp_usermeta you can find two rows for every user: <prefix>capabilities (for example wp_capabilities) which contains serialized array of roles assigned to that user <prefix>user_level (for example wp_user_level) which contains level of given user. It’s important to remember, that keys for … Read more

Migrating WordPress from DreamHost to Azure WordPress Resource via UpdraftPlus “wp_options table does not exist…” error

We downloaded a database back up via UpdraftPlus from the Azure WordPress. And the problem became pretty clear. Take a look at the Storage Engine and Collation of the create query: CREATE TABLE `wp_options` ( `option_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `option_name` varchar(191) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”, `option_value` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL, … Read more

What is the proper way to validate and sanitize JSON response from REST API?

Thanks to @GTsvetanov from Stackoverflow.com. Missing part of my code is $request->get_json_params(); for getting json request then compare it with schema using rest_validate_value_from_schema() then using rest_sanitize_value_from_schema() for saving proper data to database. $schema = $this->user_playtime_meta_schema(); $val = $request->get_json_params();//<– my mistake $result = rest_validate_value_from_schema( $values, $schema ); if ( ! is_wp_error( rest_validate_value_from_schema( $val, $schema ) ) … Read more