<?php
/**
 * Plugin Name:       topicPolls for bbPress
 * Plugin URI:        https://plugins.dev4press.com/gd-topic-polls/
 * Description:       Implement a polls system for topics in bbPress powered forums, with settings to control voting, poll closing, display of results and more.
 * Author:            Milan Petrovic
 * Author URI:        https://www.dev4press.com/
 * Text Domain:       gd-topic-polls
 * Version:           4.4.1
 * Requires at least: 6.2
 * Tested up to:      7.0
 * Requires PHP:      8.0
 * Requires Plugins:  bbpress
 * License:           GPLv3 or later
 * License URI:       https://www.gnu.org/licenses/gpl-3.0.html
 *
 * @package           GDTopicPolls
 *
 * == Copyright ==
 * Copyright 2008 - 2026 Milan Petrovic (email: support@dev4press.com)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>
 *
   */

use Dev4Press\v55\WordPress;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( function_exists( 'topicpolls_fs' ) ) {
	topicpolls_fs()->set_basename( false, __FILE__ );
} else {
	$topicpolls_urlname_basic = plugins_url( '/', __FILE__ );

	define( 'TOPICPOLLS_FILE', __FILE__ );
	define( 'TOPICPOLLS_PATH', __DIR__ . '/' );

	define( 'TOPICPOLLS_URL', $topicpolls_urlname_basic );

	require_once TOPICPOLLS_PATH . 'vendor/autoload.php';

	require_once TOPICPOLLS_PATH . 'vendor/dev4press/library/core.php';

	require_once TOPICPOLLS_PATH . 'core/freemius.php';
	require_once TOPICPOLLS_PATH . 'core/autoload.php';
	require_once TOPICPOLLS_PATH . 'core/bridge.php';
	require_once TOPICPOLLS_PATH . 'core/functions.php';

	gdpol_db();
	gdpol_settings();

	gdpol();

	if ( WordPress::instance()->is_admin() ) {
		gdpol_admin();
	}
}
