| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* @link https://www.dynamicweblab.com/ |
| 5 |
* @since 2.0.2 |
| 6 |
* @package Wp_Team_Manager |
| 7 |
* |
| 8 |
* @wordpress-plugin |
| 9 |
* Plugin Name: Dynamic Team Manager |
| 10 |
* Plugin URI: https://wpteammanager.com/ |
| 11 |
* Description: Showcase your team members, sports rosters, or creative portfolios with grid, list and Carousel layout. Fully customizable with Elementor and shortcode builder. Supports Corporate, Sports League, and more modes. |
| 12 |
* Version: 2.6.6 |
| 13 |
* Author: DynamicWebLab |
| 14 |
* Author URI: https://dynamicweblab.com/ |
| 15 |
* License: GPL-2.0+ |
| 16 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 17 |
* Text Domain: wp-team-manager |
| 18 |
* Domain Path: /languages |
| 19 |
*/ |
| 20 |
// If this file is called directly, abort. |
| 21 |
if ( !defined( 'ABSPATH' ) ) { |
| 22 |
exit; |
| 23 |
} |
| 24 |
if ( function_exists( 'tmwstm_fs' ) ) { |
| 25 |
tmwstm_fs()->set_basename( false, __FILE__ ); |
| 26 |
} else { |
| 27 |
/** |
| 28 |
* DO NOT REMOVE THIS IF, IT IS ESSENTIAL FOR THE |
| 29 |
* `function_exists` CALL ABOVE TO PROPERLY WORK. |
| 30 |
*/ |
| 31 |
if ( !function_exists( 'tmwstm_fs' ) ) { |
| 32 |
// Create a helper function for easy SDK access. |
| 33 |
function tmwstm_fs() { |
| 34 |
global $tmwstm_fs; |
| 35 |
if ( !isset( $tmwstm_fs ) ) { |
| 36 |
// Activate multisite network integration. |
| 37 |
if ( !defined( 'WP_FS__PRODUCT_14958_MULTISITE' ) ) { |
| 38 |
define( 'WP_FS__PRODUCT_14958_MULTISITE', true ); |
| 39 |
} |
| 40 |
// Include Freemius SDK. |
| 41 |
require_once dirname( __FILE__ ) . '/includes/freemius/start.php'; |
| 42 |
$tmwstm_fs = fs_dynamic_init( array( |
| 43 |
'id' => '14958', |
| 44 |
'slug' => 'wp-team-manager', |
| 45 |
'type' => 'plugin', |
| 46 |
'public_key' => 'pk_51d4e036fdcfa3c1272210e3a0733', |
| 47 |
'is_premium' => false, |
| 48 |
'premium_suffix' => 'Pro', |
| 49 |
'has_addons' => false, |
| 50 |
'has_paid_plans' => true, |
| 51 |
'is_live' => true, |
| 52 |
'trial' => array( |
| 53 |
'days' => 7, |
| 54 |
'is_require_payment' => true, |
| 55 |
), |
| 56 |
'has_affiliation' => 'customers', |
| 57 |
'menu' => array( |
| 58 |
'slug' => 'edit.php?post_type=team_manager', |
| 59 |
'first-path' => 'edit.php?post_type=team_manager&page=team-manager-tools', |
| 60 |
'contact' => true, |
| 61 |
'support' => false, |
| 62 |
), |
| 63 |
'is_org_compliant' => true, |
| 64 |
) ); |
| 65 |
} |
| 66 |
return $tmwstm_fs; |
| 67 |
} |
| 68 |
|
| 69 |
// Init Freemius. |
| 70 |
tmwstm_fs(); |
| 71 |
// Signal that SDK was initiated. |
| 72 |
do_action( 'tmwstm_fs_loaded' ); |
| 73 |
} |
| 74 |
// Check PHP version compatibility |
| 75 |
if ( version_compare( PHP_VERSION, '8.0.0', '<' ) ) { |
| 76 |
add_action( 'admin_notices', function () { |
| 77 |
echo '<div class="notice notice-error"><p>'; |
| 78 |
echo sprintf( __( 'WP Team Manager requires PHP 8.0 or higher. Current version: %s. Please upgrade PHP.', 'wp-team-manager' ), PHP_VERSION ); |
| 79 |
echo '</p></div>'; |
| 80 |
} ); |
| 81 |
return; |
| 82 |
} |
| 83 |
define( 'TM_VERSION', '2.6.6' ); |
| 84 |
define( 'TM_PHP_MIN_VERSION', '8.0.0' ); |
| 85 |
define( 'TM_FILE', __FILE__ ); |
| 86 |
define( 'TM_PATH', __DIR__ ); |
| 87 |
define( 'TM_URL', plugins_url( '', TM_FILE ) ); |
| 88 |
define( 'TM_ADMIN_ASSETS', TM_URL . '/admin/assets' ); |
| 89 |
define( 'TM_PUBLIC', TM_URL . '/public' ); |
| 90 |
define( 'TM_PRO_PATH', __DIR__ . '/pro' ); |
| 91 |
define( 'TM_PRO_URL', plugins_url( '/pro', TM_FILE ) ); |
| 92 |
define( 'TM_PRO_PUBLIC', TM_PRO_URL . '/public' ); |
| 93 |
// Load Composer autoloader before Core.php |
| 94 |
$wptm_autoload_path = dirname( __FILE__ ) . '/vendor/autoload.php'; |
| 95 |
if ( file_exists( $wptm_autoload_path ) ) { |
| 96 |
require_once $wptm_autoload_path; |
| 97 |
} else { |
| 98 |
add_action( 'admin_notices', function () { |
| 99 |
echo '<div class="notice notice-error"><p>'; |
| 100 |
echo esc_html__( 'The Dynamic Team Manager plugin is missing its Composer dependencies. Please run composer install.', 'wp-team-manager' ); |
| 101 |
echo '</p></div>'; |
| 102 |
} ); |
| 103 |
return; |
| 104 |
} |
| 105 |
$core_path = __DIR__ . '/Core.php'; |
| 106 |
if ( file_exists( $core_path ) ) { |
| 107 |
require_once $core_path; |
| 108 |
} |
| 109 |
register_activation_hook( __FILE__, 'wptm_activate_wp_team' ); |
| 110 |
/** |
| 111 |
* Plugin activation action. |
| 112 |
* |
| 113 |
* Plugin activation will not work after "plugins_loaded" hook |
| 114 |
* that's why activation hooks run here. |
| 115 |
*/ |
| 116 |
function wptm_activate_wp_team() { |
| 117 |
$activation = strtotime( 'now' ); |
| 118 |
add_option( 'wp_team_manager_activation_time', $activation ); |
| 119 |
update_option( 'wp_team_manager_version', TM_VERSION ); |
| 120 |
flush_rewrite_rules(); |
| 121 |
} |
| 122 |
|
| 123 |
add_action( 'admin_init', function () { |
| 124 |
$current_version = get_option( 'wp_team_manager_version' ); |
| 125 |
if ( version_compare( $current_version, TM_VERSION, '<' ) ) { |
| 126 |
flush_rewrite_rules(); |
| 127 |
update_option( 'wp_team_manager_version', TM_VERSION ); |
| 128 |
} |
| 129 |
} ); |
| 130 |
register_deactivation_hook( __FILE__, 'wptm_deactivate_wtp_team' ); |
| 131 |
/** |
| 132 |
* Plugin deactivation action. |
| 133 |
* |
| 134 |
* Plugin deactivation will not work after "plugins_loaded" hook |
| 135 |
* that's why deactivation hooks run here. |
| 136 |
*/ |
| 137 |
function wptm_deactivate_wtp_team() { |
| 138 |
flush_rewrite_rules(); |
| 139 |
} |
| 140 |
|
| 141 |
} |