If a plugin is clicked on, an AJAX error is correctly handled if error 500 occurs. However, the plugin itself is not disabled and there is no evidence of the error 500 in the Cacti log since it occurs before Cacti can even start.
Have a simple API page to receive a single name of the plugin to disable (with validation code?) which can be called without checking the status from the jQuery HTTP error handler if /plugins/ is detected in the url.