How to find out where a plugin/route/rack/port/state is used?

Oh, I’ve just found @Neil_Durant’s post from last year which pretty much covers all of this! I’ve voted on the Trello.

The 1 item not covered by Neil’s post is

  1. Show usage by audio or MIDI port

Neil, would you be willing to share your python script please?

Thanks!