using includes cross domain that contain php code – failing-Collection of common programming errors

The root of the original question seemed to be the poster’s concern about using a PHP script or plugin on multiple sites and then having an onerous task each time it needs to be updated. While trying to include PHP files across sites is a bad idea, it is a better plan to structure your script to be as self contained as possible. Keep the entire plugin contained in one directory…. and ensure your function calls to utilize it are as well formed as possible – clean, well named functions, uniform naming conventions and a well thought out plan for what parameters each function needs. Avoid using global variables.

Ideally you should then have quite an easy time each time you need to update the plugin/script in all locations. You can even set up an automated process that will upload the new directory containing the plugin to each site replacing the old one. And the function calls within your code should rarely if ever change.

If your script is big enough you might implement an automatic update process like the more recent versions of WordPress use. Click a button and it updates itself. In the past, updating a dozen sites running WordPress (as an example) was a massive pain.