How to add custom JS / CSS files to your plugin?
If you are building your own website, you can add required JS and CSS directly in your theme layout file. But if you are building fully functional plugin, you need to put all required assets within it.
All plugin related JS / CSS / Image files should be in "public" folder withing plugin.
To add these files to theme, you need to create "system.php" file in your plugin root directory with following content:
If your plugin has widgets, CSS / JS / Image files needed for those widgets should be included in the same way. And it is good practice to use one CSS and / or JS file for all widgets of one plugin if there is not significant amount of code.
All this is for website frontend. If you are creating administration tab in management area, these methods doesn't work. Administration tabs just print anything you return in manager.php file. Deal with required CSS / JS in anyway you like / need.