I bought a villa off-plan in 2006 and the solicitor I used was connected to the developer. (my mistake)
I ended up owning a villa with an embargo on it for €477000 because nobody checked. I had to engage a recommended solicitor to take up the case. After 2 years I won the case because I had paid 90% of the asking price before the debt was put on and the embargo was removed. Total legal cost to myself €2500. (unrecoverable).
I was advised by the 2nd solicitor to always ask for these checks to be made as a solicitor may not do it automatically.
Only give your money to your solicitor, not to anyone else ie (Estate Agent)
Ask if the property is legal.
Does the property have a certificate of habitation (if not it there is a chance it is not a legal building)
Check for embargos that may be in place.
Check that the actual buildings and outbuildings ie swimming pool, garage, are shown on the deed plan. (if not they may not be legal)
When I bought m 3rd property in Spain I did all these things and everything was revealed. So no nasty supprises this time