add some tests for sample
add test plugin
minor changes, add visibility to php function