$GLOBALS['wpkb'] = $wpkb = new Plugin(WPKB_VERSION, __FILE__, __DIR__);
$wpkb->add_hooks();
// load breadcrumbs
$breadcrumbs = new Breadcrumbs\Manager($wpkb->get_option('custom_archive_page_id'));
$breadcrumbs->add_hooks();
$wpkb->attach($breadcrumbs, 'breadcrumbs');
// load search
$search = new Search($wpkb);
$search->add_hooks();
$wpkb->attach($search, 'search');
// load code highlighter
$highlighting = new CodeHighlighting($wpkb);
$highlighting->add_hooks();
// load callouts
$callouts = new Callouts();
$callouts->add_hooks();
// rating
$rating = new Rating\Rater();
$rating->add_hooks();
$wpkb->attach($rating, 'rating');
if (is_admin()) {
    $rating_admin = new Rating\Admin();
    $rating_admin->add_hooks();
}
// load template manager
add_action('template_redirect', function () use($wpkb) {
    $template = new TemplateManager($wpkb);
    $template->override_templates();
});
// Register [wpkb_list] shortcode
ArticleList::register_shortcode();