In your gllr_custom_permalinks() function you are using
$wp_rewrite->flush_rules(); to flush the permalink structure, but you have attached it to the INIT hook. Rewrite rules should never be flushed on INIT, only on activation.
When you flush rewrite rules on INIT (or many of hooks), you cause the permalinks to be flushed on every page load, and this, aside from causing poor performance, is also extremely prone to creating conflicts with other plugins that register custom post types or taxonomies.
Please remove the
$wp_rewrite->flush_rules(); and instruct users to flush the permalinks themselves or move
$wp_rewrite->flush_rules(); to an activation hook instead.