To my big surprise: when I deleted this comment block:
/************************************************************************************************************************************************************
* Name: wpforms_execute
* Arguments: $fields, $entry, $form_data, $entry_id from WPForms action hook
* Returns: None
* Function: Depending on the FormID [constants defined in wp-config.php]- adds a bid / executes selection action on bid / sets guest users for bid
*************************************************************************************************************************************************************/
The snippet can be saved. Maybe there is a hidden character in the block.
It is actually the word wp-config.php which throws the 404 error at saving. Even when it is just comment.
Somebody is a little too serious about security 🙂
Huh, this seems quite strange.
Code Snippets does not include this sort of security feature – perhaps there is some software installed on your host, or a different plugin, which is filtering HTTP request data and blocking requests including wp-config.php as a phrase?
Hi Shea,
Thank you for your response. I created a staging site to be able to test without any other plugin activated. Basically an empty WP site with code snippets active. As soon as I insert the phrase wp-config.php the 404 is thrown during save.
Maybe it is a WP internal security feature, but it does not come from my other plugins.
Anyhow: it is working for me now and I love to use Code Snippets.
Thank you for all your extra testing, it makes problems like this much more easier to figure out.
If it’s not from a plugin, then the next place to check would be server settings – especially if your staging site is running on the same server as your other site. There were some issues with 404 errors upon saving a while back, which was caused by certain settings in Apache’s mod_security module. Perhaps something similar could be happening here?