PluginProbe
PublishPress Taxonomies – Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms / 4.0.0
PublishPress Taxonomies – Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms v4.0.0
4.0.0 3.54.0 3.53.0 3.52.0 3.51.0 3.50.0 3.45.0 3.38.0 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.40.0 3.40.1 3.41.0 3.42.0 3.43.0 3.44.0 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 All 179 releases
← All changes | simple-tags.php +187 -64 3.6.0 → 4.0.0 View file →
@@ -1,35 +1,30 @@
1 1 <?php
2 +
2 3 /**
3 - * Plugin Name: TaxoPress
4 + * Plugin Name: PublishPress Taxonomies Free
4 5 * 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.0
7 - * Author: TaxoPress
8 - * Author URI: https://taxopress.com
6 + * Description: PublishPress Taxonomies allows you to create and manage Tags, Categories, and all your WordPress taxonomy terms.
7 + * Version: 4.0.0
8 + * Author: PublishPress
9 + * Author URI: https://publishpress.com
9 10 * Text Domain: simple-tags
10 11 * Domain Path: /languages
11 - * Min WP Version: 4.9.7
12 - * Requires PHP: 5.6
12 + * Requires at least: 6.7
13 + * Requires PHP: 7.4
13 14 * License: GPLv3
14 15 *
15 - * Copyright (c) 2022 Taxopress
16 + * Copyright (c) 2022 PublishPress
16 17 *
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/
18 + * @package simple-tags
19 + * @author PublishPress
20 + * @copyright Copyright (c) 2022 PublishPress
21 + * @license GNU General Public License version 2
22 + * @link https://publishpress.com/
28 23 */
29 24
30 25 ######################################
31 -/*
26 +/*
32 27 This program is free software; you can redistribute it and/or modify
33 28 it under the terms of the GNU General Public License as published by
34 29 the Free Software Foundation; either version 2 of the License, or
35 30 (at your option) any later version.
@@ -38,14 +33,14 @@
38 33 but WITHOUT ANY WARRANTY; without even the implied warranty of
39 34 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 35 GNU General Public License for more details.
41 36
42 -Contributors to the TaxoPress code include:
37 +Contributors to the PublishPress Taxonomies code include:
43 38 - Kevin Drouvin ([email protected] - http://inside-dev.net)
44 39 - Martin Modler ([email protected] - http://www.webformatik.com)
45 40 - Vladimir Kolesnikov ([email protected] - http://blog.sjinks.pro)
46 41
47 -Sections of the TaxoPress code are based on Custom Post Type UI by WebDevStudios.
42 +Sections of the PublishPress Taxonomies code are based on Custom Post Type UI by WebDevStudios.
48 43
49 44 Credits Icons :
50 45 - famfamfam - http://www.famfamfam.com/lab/icons/silk/
51 46
@@ -56,66 +51,194 @@
56 51 die('-1');
57 52 }
58 53
59 54 if (!defined('STAGS_VERSION')) {
60 -define('STAGS_VERSION', '3.6.0');
55 + define('STAGS_VERSION', '4.0.0');
61 56 }
62 57
58 +if (! defined('PUBLISHPRESS_TAXONOMIES_VERSION')) {
59 + define('PUBLISHPRESS_TAXONOMIES_VERSION', STAGS_VERSION);
60 +}
63 61
64 -$pro_active = false;
62 +// Preserve the legacy TaxoPress version alias for existing integrations.
63 +if (! defined('TAXOPRESS_VERSION')) {
64 + define('TAXOPRESS_VERSION', PUBLISHPRESS_TAXONOMIES_VERSION);
65 +}
65 66
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;
67 +if (! function_exists('taxopress_free_is_pro_active')) {
68 + function taxopress_free_is_pro_active()
69 + {
70 + // Recognize PublishPress Taxonomies Pro and legacy TaxoPress Pro identifiers.
71 + if (
72 + defined('PUBLISHPRESS_TAXONOMIES_PRO_FILE')
73 + || defined('PUBLISHPRESS_TAXONOMIES_PRO_VERSION')
74 + || defined('TAXOPRESS_PRO_FILE')
75 + || defined('TAXOPRESS_PRO_VERSION')
76 + ) {
77 + return true;
78 + }
79 +
80 + if (! function_exists('get_option')) {
81 + return false;
82 + }
83 +
84 + $pro_active = false;
85 +
86 + foreach ((array) get_option('active_plugins') as $plugin_file) {
87 + // Support the legacy entry point and both renamed-plugin transition paths.
88 + if (
89 + false !== strpos($plugin_file, 'taxopress-pro/taxopress-pro.php')
90 + || false !== strpos($plugin_file, 'publishpress-taxonomies-pro/taxopress-pro.php')
91 + || false !== strpos($plugin_file, 'publishpress-taxonomies-pro/publishpress-taxonomies-pro.php')
92 + ) {
93 + $pro_active = true;
94 + break;
95 + }
96 + }
97 +
98 + if (! $pro_active && function_exists('is_multisite') && is_multisite()) {
99 + foreach (array_keys((array) get_site_option('active_sitewide_plugins')) as $plugin_file) {
100 + if (
101 + false !== strpos($plugin_file, 'taxopress-pro/taxopress-pro.php')
102 + || false !== strpos($plugin_file, 'publishpress-taxonomies-pro/taxopress-pro.php')
103 + || false !== strpos($plugin_file, 'publishpress-taxonomies-pro/publishpress-taxonomies-pro.php')
104 + ) {
105 + $pro_active = true;
106 + break;
107 + }
108 + }
109 + }
110 +
111 + return $pro_active;
70 112 }
71 113 }
72 114
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 - }
115 +if (taxopress_free_is_pro_active()) {
116 + if (is_admin()) {
117 + add_filter(
118 + 'plugin_row_meta',
119 + function ($links, $file) {
120 + if ($file === plugin_basename(__FILE__)) {
121 + $links[] = '<strong>' . esc_html__('This plugin can be deleted.', 'simple-tags') . '</strong>';
122 + }
123 +
124 + return $links;
125 + },
126 + 10,
127 + 2
128 + );
129 +
130 + add_action('admin_init', function () {
131 + if (! function_exists('deactivate_plugins')) {
132 + require_once ABSPATH . 'wp-admin/includes/plugin.php';
133 + }
134 +
135 + if (function_exists('is_plugin_active') && is_plugin_active(plugin_basename(__FILE__))) {
136 + deactivate_plugins(plugin_basename(__FILE__));
137 + set_transient('taxopress_free_deactivated_due_to_pro', 1, 30);
138 + }
139 + });
140 +
141 + add_action('admin_notices', function () {
142 + if (! get_transient('taxopress_free_deactivated_due_to_pro')) {
143 + return;
144 + }
145 +
146 + delete_transient('taxopress_free_deactivated_due_to_pro');
147 +
148 + echo '<div class="notice notice-warning is-dismissible"><p>'
149 + . esc_html__('PublishPress Taxonomies was not activated because PublishPress Taxonomies Pro is already active. Please keep only PublishPress Taxonomies Pro enabled.', 'simple-tags')
150 + . '</p></div>';
151 + });
79 152 }
153 +
154 + return;
80 155 }
81 156
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 - }
157 +$includeFileRelativePath = '/publishpress/instance-protection/include.php';
90 158
91 - return $links;
92 - },
93 - 10, 2
94 - );
159 +if (file_exists(__DIR__ . '/lib/vendor' . $includeFileRelativePath)) {
160 + require_once __DIR__ . '/lib/vendor' . $includeFileRelativePath;
161 +} elseif (defined('STAGS_LIB_VENDOR_PATH') && file_exists(STAGS_LIB_VENDOR_PATH . $includeFileRelativePath)) {
162 + require_once STAGS_LIB_VENDOR_PATH . $includeFileRelativePath;
95 163 }
96 164
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;
165 +if (class_exists('PublishPressInstanceProtection\\Config')) {
166 + $pluginCheckerConfig = new PublishPressInstanceProtection\Config();
167 + $pluginCheckerConfig->pluginSlug = 'simple-tags';
168 + $pluginCheckerConfig->pluginName = 'PublishPress Taxonomies';
169 +
170 + $pluginChecker = new PublishPressInstanceProtection\InstanceChecker($pluginCheckerConfig);
104 171 }
105 172
173 +$bundledTranslationsPath = '/publishpress/bundled-translations/core/include.php';
106 174
175 +if (file_exists(__DIR__ . '/lib/vendor' . $bundledTranslationsPath)) {
176 + require_once __DIR__ . '/lib/vendor' . $bundledTranslationsPath;
177 +} elseif (defined('STAGS_LIB_VENDOR_PATH') && file_exists(STAGS_LIB_VENDOR_PATH . $bundledTranslationsPath)) {
178 + require_once STAGS_LIB_VENDOR_PATH . $bundledTranslationsPath;
179 +}
107 180
108 -define ( 'TAXOPRESS_FILE', __FILE__ );
181 +$autoloadPath = __DIR__ . '/lib/vendor/autoload.php';
182 +if (!file_exists($autoloadPath)) {
183 + $autoloadPath = __DIR__ . '/vendor/autoload.php';
184 +}
185 +if (file_exists($autoloadPath)) {
186 + require_once $autoloadPath;
187 +}
109 188
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
189 +add_action('plugins_loaded', function () {
190 + if (class_exists('PublishPress\BundledTranslations\BundledTranslations')) {
191 + $bundledTranslations = new PublishPress\BundledTranslations\BundledTranslations(
192 + 'simple-tags',
193 + __DIR__ . '/languages',
194 + __FILE__
195 + );
196 + $bundledTranslations->init();
197 + }
198 +}, 10);
113 199
114 -define('STAGS_URL', plugins_url('', __FILE__));
115 -define('STAGS_DIR', rtrim(plugin_dir_path(__FILE__), '/'));
116 -define('TAXOPRESS_ABSPATH', __DIR__);
200 +$wordpressVersionNoticesPath = '/publishpress/wordpress-version-notices/src/include.php';
117 201
202 +if (file_exists(__DIR__ . '/lib/vendor' . $wordpressVersionNoticesPath)) {
203 + require_once __DIR__ . '/lib/vendor' . $wordpressVersionNoticesPath;
204 +} elseif (defined('STAGS_LIB_VENDOR_PATH') && file_exists(STAGS_LIB_VENDOR_PATH . $wordpressVersionNoticesPath)) {
205 + require_once STAGS_LIB_VENDOR_PATH . $wordpressVersionNoticesPath;
206 +}
207 +
208 +
209 +if (! defined('TAXOPRESS_FILE')) {
210 + define('TAXOPRESS_FILE', __FILE__);
211 +}
212 +
213 +if (! defined('STAGS_MIN_PHP_VERSION')) {
214 + define('STAGS_MIN_PHP_VERSION', '7.4');
215 +}
216 +
217 +if (! defined('STAGS_OPTIONS_NAME')) {
218 + define('STAGS_OPTIONS_NAME', 'simpletags'); // Option name for save settings
219 +}
220 +
221 +if (! defined('STAGS_OPTIONS_NAME_AUTO')) {
222 + define('STAGS_OPTIONS_NAME_AUTO', 'simpletags-auto'); // Option name for save settings auto terms
223 +}
224 +
225 +if (! defined('STAGS_URL')) {
226 + define('STAGS_URL', plugins_url('', __FILE__));
227 +}
228 +
229 +if (! defined('STAGS_DIR')) {
230 + define('STAGS_DIR', rtrim(plugin_dir_path(__FILE__), '/'));
231 +}
232 +
233 +if (! defined('TAXOPRESS_ABSPATH')) {
234 + define('TAXOPRESS_ABSPATH', __DIR__);
235 +}
236 +
237 +if (! defined('STAGS_LIB_VENDOR_PATH')) {
238 + define('STAGS_LIB_VENDOR_PATH', __DIR__ . '/lib/vendor');
239 +}
240 +
118 241 // Check PHP min version
119 242 if (version_compare(PHP_VERSION, STAGS_MIN_PHP_VERSION, '<')) {
120 243 require STAGS_DIR . '/inc/class.compatibility.php';
121 244
@@ -127,19 +250,19 @@
127 250 }
128 251
129 252 require STAGS_DIR . '/inc/loads.php';
130 253
131 -// Init TaxoPress
254 +// Init PublishPress Taxonomies
132 255 function init_free_simple_tags()
133 256 {
134 - if (is_admin() && !defined('TAXOPRESS_PRO_VERSION')) {
257 + if (is_admin() && ! defined('PUBLISHPRESS_TAXONOMIES_PRO_VERSION') && ! defined('TAXOPRESS_PRO_VERSION')) {
135 258 require_once(TAXOPRESS_ABSPATH . '/includes-core/TaxopressCoreAdmin.php');
136 259 new \PublishPress\Taxopress\TaxopressCoreAdmin();
137 260 }
138 261 }
139 -add_action('plugins_loaded', 'init_free_simple_tags');
262 +add_action('init', 'init_free_simple_tags', 0);
140 263
141 264 // Activation, uninstall
142 265 register_activation_hook(__FILE__, array('SimpleTags_Plugin', 'activation'));
143 266 register_deactivation_hook(__FILE__, array('SimpleTags_Plugin', 'deactivation'));
144 267
145 -add_action('plugins_loaded', 'init_simple_tags');
268 +add_action('init', 'init_simple_tags', 0);