{"action":"created","issue":{"url":"https://api.github.com/repos/oomphinc/WP-Forms-API/issues/8","labels_url":"https://api.github.com/repos/oomphinc/WP-Forms-API/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/oomphinc/WP-Forms-API/issues/8/comments","events_url":"https://api.github.com/repos/oomphinc/WP-Forms-API/issues/8/events","html_url":"https://github.com/oomphinc/WP-Forms-API/issues/8","id":101701084,"number":8,"title":"How to handle multiple-instance conflicts?","user":{"login":"jcowher","id":7431141,"avatar_url":"https://avatars.githubusercontent.com/u/7431141?v=3","gravatar_id":"","url":"https://api.github.com/users/jcowher","html_url":"https://github.com/jcowher","followers_url":"https://api.github.com/users/jcowher/followers","following_url":"https://api.github.com/users/jcowher/following{/other_user}","gists_url":"https://api.github.com/users/jcowher/gists{/gist_id}","starred_url":"https://api.github.com/users/jcowher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcowher/subscriptions","organizations_url":"https://api.github.com/users/jcowher/orgs","repos_url":"https://api.github.com/users/jcowher/repos","events_url":"https://api.github.com/users/jcowher/events{/privacy}","received_events_url":"https://api.github.com/users/jcowher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-18T16:56:40Z","updated_at":"2015-11-04T15:06:31Z","closed_at":null,"body":"@bendoh,\r\n\r\nAs WP-Forms-API user base increases, there is a strong possibility that multiple themes, plugins, etc could all be using the wp-forms-api in one WordPress installation.\r\n\r\nI added a conditional check in `wp-forms-api.php` see if the library already exists before loading the library, but how do we handle version conflicts?\r\n\r\nFor example:\r\n\r\nPlugin A was built on version 1.0 of the wp-forms-api library\r\nPlugin B was built on version 1.1 of the wp-forms-api library\r\n\r\nDue to how WordPress loads plugins alphabetically... the wp-forms-api library that is included with Plugin A will be loaded first. This could potentially cause some functionality in Plugin B to break or create fatal errors (e.g. a new function/method that was added in version 1.1, but is not in version 1.0).\r\n\r\nAny thoughts how we should handle this?"},"comment":{"url":"https://api.github.com/repos/oomphinc/WP-Forms-API/issues/comments/153755616","html_url":"https://github.com/oomphinc/WP-Forms-API/issues/8#issuecomment-153755616","issue_url":"https://api.github.com/repos/oomphinc/WP-Forms-API/issues/8","id":153755616,"user":{"login":"bendoh","id":1833896,"avatar_url":"https://avatars.githubusercontent.com/u/1833896?v=3","gravatar_id":"","url":"https://api.github.com/users/bendoh","html_url":"https://github.com/bendoh","followers_url":"https://api.github.com/users/bendoh/followers","following_url":"https://api.github.com/users/bendoh/following{/other_user}","gists_url":"https://api.github.com/users/bendoh/gists{/gist_id}","starred_url":"https://api.github.com/users/bendoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendoh/subscriptions","organizations_url":"https://api.github.com/users/bendoh/orgs","repos_url":"https://api.github.com/users/bendoh/repos","events_url":"https://api.github.com/users/bendoh/events{/privacy}","received_events_url":"https://api.github.com/users/bendoh/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T15:06:31Z","updated_at":"2015-11-04T15:06:31Z","body":"I think a site is going to generally use the WP Forms API as a singular mu-plugin, and so the version will be controlled there. We should implement a version identifier in the code that can be read by dependent plugins so they can ensure the correct version is given. I think that would be the cleanest way of doing it. Hopefully we never end up in a situation where Plugin A NEEDS WPFAPI <= 1.0 and Plugin B NEEDS WPFAPI > 1.0, which would definitely be a conflict, but I think we can avoid that in general with semantic versioning."}}