I've been developing a Wordpress plugin on my windows box using Visual Studio 2019 and Devsense PHP tools.
I've copied a clean Wordpress zip file contents into my VS project and I've got everything working nicely. Can debug and cleaned up all errors. I've added a custom post type, metabox and UI elements for it, jquery-ui-fresh, custom javascript to attach a date picker to some elements in the metabox, custom css and the some code to query the post types and display on all pages.
Works perfectly so I zipped up the plugin folder (include the folder itself as the top level item in the zip) and deployed to a live Wordpress site. After activating the plugin it hangs and I eventually get a 504 when visiting the site. All admin panels work fine... I can add new posts of my custom type without an issue.
I've found many pages which go through troubleshooting options and all any of them really say is "disable plugins" to try to determine what component is causing the issue. I know which plugin is causing the issue so this isn't particularly useful.
Is there some kind of best practice I'm potentially not following, some code I'm supposed to put at the top of the file?
I've tried using the "Query Monitor" plugin but nothing is listed in its list of events
I'm totally lost.
Here's the code