Update the code so it'll work in v1.8

provide api_version() so that the plugin system could pick it up and display in "Preference"