How to upgrade custom 2.79 .py addons to 2.80?
The updated add-on for 2.8 could like the following code:

bl_info = {
'name': 'Move origin to selected',
'author': '',
'version': (0, 0, 1),
'blender': (2, 8, 0),
'location': '3D view &gt; F3 &gt; Origin Move to Selected',
'description': 'In edit mode, sets object origin to the median of selected verts/edges/faces',
'wiki_url': '',
'tracker_url': '',
'category': '3D View'
}

import bpy

class OBJECT_OT_origin_to_selected(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.origin_to_selected"
    bl_label = "Origin Move To Selected"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):
        obj = context.view_layer.objects.active
        if context.area.type == 'VIEW_3D' and obj is not None and obj.mode == 'EDIT':
            return True
        else:
            return False

    def execute(self, context):
        saved_location = bpy.context.scene.cursor.location.copy()
        bpy.ops.view3d.snap_cursor_to_selected()

        bpy.ops.object.mode_set(mode = 'OBJECT')
        bpy.ops.object.origin_set(type='ORIGIN_CURSOR')  
        bpy.context.scene.cursor.location = saved_location

        bpy.ops.object.mode_set(mode = 'EDIT')
        return {'FINISHED'}


def register():
    bpy.utils.register_class(OBJECT_OT_origin_to_selected)


def unregister():
    bpy.utils.unregister_class(OBJECT_OT_origin_to_selected)


if __name__ == "__main__":
    register()


API changes include:


How the active object is accessed
How to get the cursor location
Mandatory naming convention for operators