<?php

namespace DiviBooster\DiviBooster\Modules\CircleCounter;

// is_plugin_active() is defined in wp-admin/includes/plugin.php and may not be loaded
// yet in some front-end / early-load contexts. Guard against fatal errors.
if (!function_exists('is_plugin_active')) {
    $plugin_php = ABSPATH . 'wp-admin/includes/plugin.php';
    if (defined('ABSPATH') && is_readable($plugin_php)) {
        include_once $plugin_php;
    }
}

// If the function is still unavailable for some reason, treat the plugin as inactive.
$dbdb_is_plugin_active = function_exists('is_plugin_active')
    ? is_plugin_active('circle-counter-module-text-before-number/circle-counter-module-text-before-number.php')
    : false;

if (!$dbdb_is_plugin_active) {
    include_once(dirname(__FILE__) . '/features/text-before-number/text-before-number.php');
}