I'm working on a plugin that lets you selectively disable plugins for each page. I have everything in place but I have some concerns with the way I had to do it. My plugin is loaded as a must use plugin so it loads befare all standard plugins and can disable them before they are loaded. Since the $wp_query, $wp_rewrite, and $wp objects have not been created yet there is no easy way to get the post id from the permalink of the current page. What I had to do was to create the $wp_query, $wp_rewrite, and $wp objects and use the url_to_postid() function. This doesnt seem like a good idea. Does anyone know a better way to accomplish this?