| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Tainacan |
| 4 |
Plugin URI: https://tainacan.org/ |
| 5 |
Description: Open source, powerful and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional repository platform. |
| 6 |
Author: Tainacan.org |
| 7 |
Author URI: https://tainacan.org/ |
| 8 |
Version: 1.2.0 |
| 9 |
Requires at least: 6.5 |
| 10 |
Tested up to: 7.0 |
| 11 |
Requires PHP: 7.4 |
| 12 |
Stable tag: 1.2.0 |
| 13 |
Text Domain: tainacan |
| 14 |
License: GPLv3 or later |
| 15 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html |
| 16 |
*/ |
| 17 |
|
| 18 |
// Prevent direct access to the file |
| 19 |
defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
| 20 |
|
| 21 |
// Basic constants |
| 22 |
const TAINACAN_VERSION = '1.2.0'; |
| 23 |
const TAINACAN_BASE_DIR = __DIR__; |
| 24 |
const TAINACAN_CLASSES_DIR = __DIR__ . '/classes/'; |
| 25 |
|
| 26 |
$TAINACAN_BASE_URL = plugins_url('', __FILE__); |
| 27 |
$TAINACAN_API_MAX_ITEMS_PER_PAGE = defined('TAINACAN_API_MAX_ITEMS_PER_PAGE') ? max(TAINACAN_API_MAX_ITEMS_PER_PAGE, 12) : get_option('tainacan_option_search_results_per_page', 96); |
| 28 |
|
| 29 |
// Initialization logic (loads most classes and instantiates singletons) |
| 30 |
require_once(TAINACAN_CLASSES_DIR . 'tainacan-creator.php'); |
| 31 |
|
| 32 |
// Perform migrations |
| 33 |
require_once('migrations.php'); |
| 34 |
add_action('init', ['Tainacan\Migrations', 'run_migrations']); |
| 35 |
|
| 36 |
// Hook to update .htaccess when the plugin is activated |
| 37 |
register_activation_hook(__FILE__, ['Tainacan\Private_Files', 'add_htaccess_rules']); |
| 38 |
|