Feature/155 fix data validation in sql queries

Please note https://github.com/laterpay/laterpay-wordpress-plugin/issues/155#issuecomment-50284096 in the code review.