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