File Type Is Not Permitted – Cronjob

Defining ALLOW_UNFILTERED_UPLOADS isn’t enough anymore: it doesn’t grant the capability, it just permits non-admin users who have the unfiltered_uploads capability to upload any file (except on a multisite). You also need to grant yourself the capability, e.g. from Sebastian’s answer here # # For this, see: wp-includes/capabilities.php > map_meta_cap() # function wpse_6533_map_unrestricted_upload_filter($caps, $cap) { if … Read more

Suspicious Files

When someone sends a POST request with a variable php and a base 64 encoded value that is PHP code after decoding it, that PHP code will run with the permissions of all your own PHP files. The attacker can read all database content, create new users, upload files … The second code does the … Read more

wp_insert_comment and security

wp_insert_comment() is low level function, it only saves passed data without concern for what it contains. If you are looking to replicate sanitizing WP does on comment data (totally good idea 🙂 you are probably looking for higher level wp_new_comment().

How do I properly update the WordPress database password?

This is technically challenging. WordPress must have access to your DB password in plain text. Having access to the wp-config.php contents is already a breach of security in progress. There are alternate approaches to configuration, such as loading credentials via environment variables, but in practice they are used exceedingly rarely because PHP’s configuration file is … Read more

Should I Worry About SQL Injection When Using wp_insert_post?

WordPress DOES take care of SQL injection and for you. See the Security section on this page. The wp_insert_post() function runs through sanitize_post(). Be aware that malicious or unintended code can still be inserted: “You may wish, however, to remove HTML, JavaScript, and PHP tags from the post_title and any other fields. Surprisingly, WordPress does … Read more

WordPress security issue to output data from user input from theme option form

Security issues arise when you write code that open up possibilities for outsiders to access your database or otherwise compromise your installation. The above code just reads options and content from the database and translates this into static html that will be send to the browser of the page’s visitor. There’s no code (like a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)