This is the plugin code using php wrapper