Why my function.php file in theme delete automatically?

I was using electro theme. and that was going fine I add some code for woocommerce order cancellation in the function.php file of the theme. after that, my site shows an error that “There has been a critical error on your website.”.
when I checked my Cpanel… I found that the function.php file of my theme is missing. I have the site on the localhost and that’s is going well. I uploaded function.php file from my localhost theme into the Cpanel, my site runs perfectly but for just 7-10 sec.. after that, it is showing the same error and when I check Cpanel I found that functiono.php is missing again..
I uploaded it again but that got delete again..
I uploaded the whole theme again but got the same issue.. then I uploaded the whole wp-content folder but still the same issue that function.php got delete automatically. then I uploaded the whole site from the localhost and connect it with the database but still, I got the same error..
I set debug to true and I got these errors you can see in screenshotWhy my function.php file in theme delete automatically?

kindly help me in solving this issue

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

this error was due to the server.. server marked it as spam.. thats why deleting it immediately..


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x