how to protect wordpress content from crawler
The one I use a lot is Defender Pro by WPMUDEV but its not a cheap solution. https://premium.wpmudev.org/project/wp-defender/
The one I use a lot is Defender Pro by WPMUDEV but its not a cheap solution. https://premium.wpmudev.org/project/wp-defender/
indeed from your question is not entirely clear what are you trying to achieve. However wordpress gives you the option to create custom roles and capabilities. If you follow that native wordpress path, you should not be concerned about security. check if the role exists IFF not add the role and capibilities Make sure to … Read more
How to prevent my external API call from being called by anyone but me (my site)
Don’t know if there is plugin for this or not, you should try by searching “restrict page by user roles” in WordPress directory. But if you can code and know few conditional tags and how to use them then I think you should try following snippet and it will work for you. But Beware, this … Read more
the quick solution I found is to str_replace empty value. /* Query */ global $wpdb; $tablename = $wpdb->prefix . ‘data’; $sql = $wpdb->prepare( ” UPDATE $tablename SET `date` = %s, WHERE id= %d “, $_POST[‘date’], $_POST[‘id’] ); // SQL = UPDATE prefix_data SET `date` = ” WHERE id = 1 $sql = str_replace(“””,’NULL’, $sql); // … Read more
Looks like the recommended permissions are 755 for folders and 644 for files. However I was able to test files with 444 permissions successfully.
Putting an important credentials in functions.php is not a good idea. The better way is you can utilize WP REST API from your second site to handle GET and POST method for the data and using global $wpdb variable inside the code. You can either create a custom endpoint for that by making a custom … Read more
Look into adding a constant check at the top of the script: if ( ! defined( ‘ABSPATH’ ) ) { exit; // Exit if accessed directly } See: https://stackoverflow.com/questions/43212340/what-is-meant-by-if-defined-abspath
What I haven’t thought of is that I could use wp_nonce instead of jwt – create nonce on backend, store it on frontend and send it with every request till it expires. What drawbacks does wp nonce method have vs jwt method? Using nonces as a replacement for an authentication protocol, or as a session … Read more
Solution: sanitize_post is coming with “display” default filter option. And it does not sanitize tags. But if you tries a code like this: $sanitizer = function($post){ return sanitize_post($post, “db”); // or “edit” }; array_map($sanitizer, $data[“post”]); Now it sanitizes fields against XSS!