Fix performance of wpsc_get_child_object_in_terms

also updated code to standards see issue #464