Example #1
0
function dekoBokoActivate()
{
    $autoLoaderPath = dirname(__FILE__) . '/../toppa-plugin-libraries-for-wordpress/ToppaAutoLoaderWp.php';
    if (!function_exists('spl_autoload_register')) {
        trigger_error('You must have at least PHP 5.1.2 to use Deko Boko (this is not actually a PHP error)', E_USER_ERROR);
    } else {
        if (version_compare(get_bloginfo('version'), '3.0', '<')) {
            trigger_error('You must have at least WordPress 3.0 to use Deko Boko (this is not actually a PHP error)', E_USER_ERROR);
        } else {
            if (!file_exists($autoLoaderPath)) {
                trigger_error('You must install the plugin "Toppa Plugin Libraries for WordPress" to use Deko Boko (this is not actually a PHP error)', E_USER_ERROR);
            } else {
                require_once $autoLoaderPath;
                $toppaAutoLoader = new ToppaAutoLoaderWp('/toppa-plugin-libraries-for-wordpress');
                $dekoBokoAutoLoader = new ToppaAutoLoaderWp('/deko-boko-a-recaptcha-contact-form-plugin');
                $functionsFacade = new ToppaFunctionsFacadeWp();
                $dekoBoko = new DekoBoko($functionsFacade);
                $dekoBoko->install();
            }
        }
    }
}