| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Genealogical Tree |
| 5 |
* |
| 6 |
* This is the main plugin file, which is responsible for loading the plugin, |
| 7 |
* defining activation and deactivation hooks, and including dependencies. |
| 8 |
* |
| 9 |
* @link https://wordpress.org/plugins/genealogical-tree |
| 10 |
* @since 1.0.0 |
| 11 |
* @package Genealogical_Tree |
| 12 |
* |
| 13 |
* @wordpress-plugin |
| 14 |
* Plugin Name: Genealogical Tree |
| 15 |
* Plugin URI: https://wordpress.org/plugins/genealogical-tree |
| 16 |
* Description: The ultimate solution for creating and displaying family trees and family history on WordPress. |
| 17 |
* Version: 2.2.8 |
| 18 |
* Author: ak devs |
| 19 |
* Author URI: https://github.com/akdevsfr |
| 20 |
* License: GPL-2.0+ |
| 21 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 22 |
* Text Domain: genealogical-tree |
| 23 |
* Domain Path: /languages |
| 24 |
* @fs_premium_only: /admin/genealogical-tree-handel-import.php, /admin/genealogical-tree-handel-import-csv.php, /admin/genealogical-tree-handel-export.php, /includes/php-gedcom/, /admin/partials/genealogical-tree-meta-tree-settings-premium.php, /includes/class-genealogical-tree-api.php |
| 25 |
*/ |
| 26 |
// Abort if this file is called directly. |
| 27 |
if ( !defined( 'WPINC' ) ) { |
| 28 |
die; |
| 29 |
} |
| 30 |
/** |
| 31 |
* Autoload dependencies using Composer. |
| 32 |
* |
| 33 |
* Throws an error if the autoload file is not found to ensure the plugin |
| 34 |
* cannot run without required dependencies. |
| 35 |
* |
| 36 |
* @throws RuntimeException If the autoload file is missing. |
| 37 |
*/ |
| 38 |
if ( !file_exists( __DIR__ . '/vendor/autoload.php' ) ) { |
| 39 |
throw new RuntimeException('Composer autoload file not found. Please run "composer install".'); |
| 40 |
} |
| 41 |
require_once __DIR__ . '/vendor/autoload.php'; |
| 42 |
/** |
| 43 |
* Freemius SDK Initialization and Setup. |
| 44 |
* |
| 45 |
* Initializes the Freemius SDK for managing plugin subscriptions and licensing. |
| 46 |
* |
| 47 |
* @return mixed The Freemius SDK instance. |
| 48 |
*/ |
| 49 |
if ( function_exists( 'gt_fs' ) ) { |
| 50 |
gt_fs()->set_basename( false, __FILE__ ); |
| 51 |
} else { |
| 52 |
// if gt_fs not defined. |
| 53 |
if ( !function_exists( 'gt_fs' ) ) { |
| 54 |
// Create a helper function for easy SDK access. |
| 55 |
function gt_fs() { |
| 56 |
global $gt_fs; |
| 57 |
if ( !isset( $gt_fs ) ) { |
| 58 |
// Activate multisite network integration. |
| 59 |
if ( !defined( 'WP_FS__PRODUCT_3592_MULTISITE' ) ) { |
| 60 |
define( 'WP_FS__PRODUCT_3592_MULTISITE', true ); |
| 61 |
} |
| 62 |
// Include Freemius SDK. |
| 63 |
require_once dirname( __FILE__ ) . '/freemius/start.php'; |
| 64 |
$gt_fs = fs_dynamic_init( array( |
| 65 |
'id' => '3592', |
| 66 |
'slug' => 'genealogical-tree', |
| 67 |
'premium_slug' => 'genealogical-tree-pro', |
| 68 |
'type' => 'plugin', |
| 69 |
'public_key' => 'pk_e7259dba96b5463b7e746506d5e2c', |
| 70 |
'is_premium' => false, |
| 71 |
'premium_suffix' => 'Pro', |
| 72 |
'has_addons' => true, |
| 73 |
'has_paid_plans' => true, |
| 74 |
'trial' => array( |
| 75 |
'days' => 7, |
| 76 |
'is_require_payment' => true, |
| 77 |
), |
| 78 |
'menu' => array( |
| 79 |
'slug' => 'genealogical-tree', |
| 80 |
'first-path' => '/edit-tags.php?taxonomy=gt-family-group&post_type=gt-member', |
| 81 |
'support' => false, |
| 82 |
), |
| 83 |
'is_live' => true, |
| 84 |
'is_org_compliant' => true, |
| 85 |
) ); |
| 86 |
} |
| 87 |
return $gt_fs; |
| 88 |
} |
| 89 |
|
| 90 |
// Init Freemius. |
| 91 |
gt_fs(); |
| 92 |
// Signal that SDK was initiated. |
| 93 |
do_action( 'gt_fs_loaded' ); |
| 94 |
} |
| 95 |
/** |
| 96 |
* Define plugin constants. |
| 97 |
*/ |
| 98 |
define( 'GENEALOGICAL_TREE_VERSION', '2.2.8' ); |
| 99 |
define( 'GENEALOGICAL_TREE_DIR_URL', plugin_dir_url( __FILE__ ) ); |
| 100 |
define( 'GENEALOGICAL_TREE_DIR_PATH', plugin_dir_path( __FILE__ ) ); |
| 101 |
/** |
| 102 |
* Registers the plugin's activation hook. |
| 103 |
* |
| 104 |
* This uses an arrow function for concise activation logic. However, for |
| 105 |
* improved debugging and maintainability, using a named function is generally |
| 106 |
* recommended (see example below). |
| 107 |
* |
| 108 |
* @since 1.0.0 |
| 109 |
*/ |
| 110 |
register_activation_hook( __FILE__, fn() => \Zqe\Genealogical_Tree_Activator::activate() ); |
| 111 |
/** |
| 112 |
* Registers the plugin's deactivation hook. |
| 113 |
* |
| 114 |
* This uses an arrow function for concise deactivation logic. While concise, |
| 115 |
* using a named function is generally recommended for deactivation hooks due to |
| 116 |
* improved debugging and documentation possibilities. |
| 117 |
* |
| 118 |
* @since 1.0.0 |
| 119 |
*/ |
| 120 |
register_deactivation_hook( __FILE__, fn() => \Zqe\Genealogical_Tree_Deactivator::deactivate() ); |
| 121 |
/** |
| 122 |
* Initializes and runs the Genealogical Tree plugin (using an arrow function). |
| 123 |
* This is the most concise way for simple initialization tasks. |
| 124 |
* |
| 125 |
* @since 1.0. |
| 126 |
*/ |
| 127 |
add_action( 'plugins_loaded', fn() => ( new \Zqe\Genealogical_Tree() )->run(), 5 ); |
| 128 |
} |