esc_attr() on hard coded string

All text entered into the database is, in essence, “user entered”. If the site gets hacked a hacker could change every instance of the field “title” to contain javascript, for example. If you just echo out the field then you’re writing the javascript to the page and thus injecting the code into the page. Therefore, … Read more

Should I worry about SQL injection when using REST API?

Yes. This is not secure at all. You’re putting user input directly into a database query. You need to use $wpdb->prepare() if you’re inserting user input into SQL: $post_slug = $request->get_param( ‘slug’ ); $query = $wpdb->prepare( “select * from wp_posts where post_name=%s and post_status=”publish” limit 1;”, $post_slug ); $results = $wpdb->get_results( $query );

Verifying that I have fully removed a WordPress hack?

Have you identified the exploit vector? If not, you may be leaving yourself open to future exploit. Other things to consider: Change WordPress admin user passwords – done Change Hosting account user password Change FTP passwords Change MySQL db user password – done Change the db table prefix Update your wp-config nonces/salt Check your directory/file … Read more