| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: TaxoPress |
| 4 |
* Plugin URI: https://wordpress.org/plugins/simple-tags/ |
| 5 |
* Description: TaxoPress allows you to create and manage Tags, Categories, and all your WordPress taxonomy terms. |
| 6 |
* Version: 3.45.0 |
| 7 |
* Author: TaxoPress |
| 8 |
* Author URI: https://taxopress.com |
| 9 |
* Text Domain: simple-tags |
| 10 |
* Domain Path: /languages |
| 11 |
* Min WP Version: 4.9.7 |
| 12 |
* Requires PHP: 7.4 |
| 13 |
* License: GPLv3 |
| 14 |
* |
| 15 |
* Copyright (c) 2022 Taxopress |
| 16 |
* |
| 17 |
* @package simple-tags |
| 18 |
* @author TaxoPress |
| 19 |
* @copyright Copyright (c) 2022 Taxopress |
| 20 |
* @license GNU General Public License version 2 |
| 21 |
* @link https://TaxoPress.com/ |
| 22 |
*/ |
| 23 |
|
| 24 |
###################################### |
| 25 |
/* |
| 26 |
This program is free software; you can redistribute it and/or modify |
| 27 |
it under the terms of the GNU General Public License as published by |
| 28 |
the Free Software Foundation; either version 2 of the License, or |
| 29 |
(at your option) any later version. |
| 30 |
|
| 31 |
This program is distributed in the hope that it will be useful, |
| 32 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 33 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 34 |
GNU General Public License for more details. |
| 35 |
|
| 36 |
Contributors to the TaxoPress code include: |
| 37 |
- Kevin Drouvin (kevin.drouvin@gmail.com - http://inside-dev.net) |
| 38 |
- Martin Modler (modler@webformatik.com - http://www.webformatik.com) |
| 39 |
- Vladimir Kolesnikov (vladimir@extrememember.com - http://blog.sjinks.pro) |
| 40 |
|
| 41 |
Sections of the TaxoPress code are based on Custom Post Type UI by WebDevStudios. |
| 42 |
|
| 43 |
Credits Icons : |
| 44 |
- famfamfam - http://www.famfamfam.com/lab/icons/silk/ |
| 45 |
|
| 46 |
*/ |
| 47 |
|
| 48 |
// don't load directly |
| 49 |
if (!defined('ABSPATH')) { |
| 50 |
die('-1'); |
| 51 |
} |
| 52 |
|
| 53 |
if (!defined('STAGS_VERSION')) { |
| 54 |
define('STAGS_VERSION', '3.45.0'); |
| 55 |
} |
| 56 |
|
| 57 |
|
| 58 |
$pro_active = false; |
| 59 |
|
| 60 |
foreach ((array)get_option('active_plugins') as $plugin_file) { |
| 61 |
if (false !== strpos($plugin_file, 'taxopress-pro.php')) { |
| 62 |
$pro_active = true; |
| 63 |
break; |
| 64 |
} |
| 65 |
} |
| 66 |
|
| 67 |
if (!$pro_active && is_multisite()) { |
| 68 |
foreach (array_keys((array)get_site_option('active_sitewide_plugins')) as $plugin_file) { |
| 69 |
if (false !== strpos($plugin_file, 'taxopress-pro.php')) { |
| 70 |
$pro_active = true; |
| 71 |
break; |
| 72 |
} |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
if ($pro_active) { |
| 77 |
add_filter( |
| 78 |
'plugin_row_meta', |
| 79 |
function($links, $file) |
| 80 |
{ |
| 81 |
if ($file == plugin_basename(__FILE__)) { |
| 82 |
$links[]= __('<strong>This plugin can be deleted.</strong>', 'simple-tags'); |
| 83 |
} |
| 84 |
|
| 85 |
return $links; |
| 86 |
}, |
| 87 |
10, 2 |
| 88 |
); |
| 89 |
} |
| 90 |
|
| 91 |
if (defined('TAXOPRESS_FILE') || $pro_active) { |
| 92 |
if(!function_exists('deactivate_plugins')){ |
| 93 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 94 |
} |
| 95 |
//deactivate current plugin if pro is active |
| 96 |
deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 97 |
return; |
| 98 |
} |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
define ( 'TAXOPRESS_FILE', __FILE__ ); |
| 103 |
|
| 104 |
define('STAGS_MIN_PHP_VERSION', '7.4'); |
| 105 |
define('STAGS_OPTIONS_NAME', 'simpletags'); // Option name for save settings |
| 106 |
define('STAGS_OPTIONS_NAME_AUTO', 'simpletags-auto'); // Option name for save settings auto terms |
| 107 |
|
| 108 |
define('STAGS_URL', plugins_url('', __FILE__)); |
| 109 |
define('STAGS_DIR', rtrim(plugin_dir_path(__FILE__), '/')); |
| 110 |
define('TAXOPRESS_ABSPATH', __DIR__); |
| 111 |
|
| 112 |
// Check PHP min version |
| 113 |
if (version_compare(PHP_VERSION, STAGS_MIN_PHP_VERSION, '<')) { |
| 114 |
require STAGS_DIR . '/inc/class.compatibility.php'; |
| 115 |
|
| 116 |
// possibly display a notice, trigger error |
| 117 |
add_action('admin_init', array('SimpleTags_Compatibility', 'admin_init')); |
| 118 |
|
| 119 |
// stop execution of this file |
| 120 |
return; |
| 121 |
} |
| 122 |
|
| 123 |
require STAGS_DIR . '/inc/loads.php'; |
| 124 |
|
| 125 |
// Init TaxoPress |
| 126 |
function init_free_simple_tags() |
| 127 |
{ |
| 128 |
if (is_admin() && !defined('TAXOPRESS_PRO_VERSION')) { |
| 129 |
require_once(TAXOPRESS_ABSPATH . '/includes-core/TaxopressCoreAdmin.php'); |
| 130 |
new \PublishPress\Taxopress\TaxopressCoreAdmin(); |
| 131 |
} |
| 132 |
} |
| 133 |
add_action('init', 'init_free_simple_tags', 0); |
| 134 |
|
| 135 |
// Activation, uninstall |
| 136 |
register_activation_hook(__FILE__, array('SimpleTags_Plugin', 'activation')); |
| 137 |
register_deactivation_hook(__FILE__, array('SimpleTags_Plugin', 'deactivation')); |
| 138 |
|
| 139 |
add_action('init', 'init_simple_tags', 0); |
| 140 |
|