小部件和插件有什么区别?

Is it better to develop a plugin or widget.Which one should I choose either plugin or widget.

It actually depends on you. First you need to understand the requirement and difference between them.

A widget is generally a drag & drop component which you can use in Widget Areas, You can use that in many widget Areas and you can define some setting for that widget, Usually by program.

A plugin is a actually a php snippet which can be Activated/Deactivated according to the requirement, This snippet can perform many functions defined in the file, a plugin can be make some widget which can be used in the WP. a plugin is easy to handle and easy to change. A plugin can be updates time to time as per the requirement.

I will prefer you to make a plugin instead of a widget