Replaced deprecated $wpdb->escape to esc_sql that causes notices on
strict PHP settings