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 +196 -51 3.4.4 → 4.0.0 View file →
@@ -1,19 +1,30 @@
1 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.4.4
7 -Requires PHP: 5.6
8 -Requires at least: 3.3
9 -Tested up to: 5.6
10 -Author: TaxoPress
11 -Author URI: https://taxopress.com
12 -Text Domain: simple-tags
13 2
14 -Copyright 2013-2021 TaxoPress
3 +/**
4 + * Plugin Name: PublishPress Taxonomies Free
5 + * Plugin URI: https://wordpress.org/plugins/simple-tags/
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
10 + * Text Domain: simple-tags
11 + * Domain Path: /languages
12 + * Requires at least: 6.7
13 + * Requires PHP: 7.4
14 + * License: GPLv3
15 + *
16 + * Copyright (c) 2022 PublishPress
17 + *
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/
23 + */
15 24
25 +######################################
26 +/*
16 27 This program is free software; you can redistribute it and/or modify
17 28 it under the terms of the GNU General Public License as published by
18 29 the Free Software Foundation; either version 2 of the License, or
19 30 (at your option) any later version.
@@ -22,17 +33,18 @@
22 33 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 34 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 35 GNU General Public License for more details.
25 36
26 -Contributors to the TaxoPress code include:
37 +Contributors to the PublishPress Taxonomies code include:
27 38 - Kevin Drouvin ([email protected] - http://inside-dev.net)
28 39 - Martin Modler ([email protected] - http://www.webformatik.com)
29 40 - Vladimir Kolesnikov ([email protected] - http://blog.sjinks.pro)
30 41
31 -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.
32 43
33 44 Credits Icons :
34 45 - famfamfam - http://www.famfamfam.com/lab/icons/silk/
46 +
35 47 */
36 48
37 49 // don't load directly
38 50 if (!defined('ABSPATH')) {
@@ -39,61 +51,194 @@
39 51 die('-1');
40 52 }
41 53
42 54 if (!defined('STAGS_VERSION')) {
43 -define('STAGS_VERSION', '3.4.4');
55 + define('STAGS_VERSION', '4.0.0');
44 56 }
45 57
58 +if (! defined('PUBLISHPRESS_TAXONOMIES_VERSION')) {
59 + define('PUBLISHPRESS_TAXONOMIES_VERSION', STAGS_VERSION);
60 +}
46 61
47 -$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 +}
48 66
49 -foreach ((array)get_option('active_plugins') as $plugin_file) {
50 - if (false !== strpos($plugin_file, 'taxopress-pro.php')) {
51 - $pro_active = true;
52 - 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;
53 112 }
54 113 }
55 114
56 -if (!$pro_active && is_multisite()) {
57 - foreach (array_keys((array)get_site_option('active_sitewide_plugins')) as $plugin_file) {
58 - if (false !== strpos($plugin_file, 'taxopress-pro.php')) {
59 - $pro_active = true;
60 - break;
61 - }
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 + });
62 152 }
153 +
154 + return;
63 155 }
64 156
65 -if ($pro_active) {
66 - add_filter(
67 - 'plugin_row_meta',
68 - function($links, $file)
69 - {
70 - if ($file == plugin_basename(__FILE__)) {
71 - $links[]= __('<strong>This plugin can be deleted.</strong>', 'simple-tags');
72 - }
157 +$includeFileRelativePath = '/publishpress/instance-protection/include.php';
73 158
74 - return $links;
75 - },
76 - 10, 2
77 - );
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;
78 163 }
79 164
80 -if (defined('TAXOPRESS_FILE') || $pro_active) {
81 - 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);
82 171 }
83 172
173 +$bundledTranslationsPath = '/publishpress/bundled-translations/core/include.php';
84 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 +}
85 180
86 -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 +}
87 188
88 -define('STAGS_MIN_PHP_VERSION', '5.6');
89 -define('STAGS_OPTIONS_NAME', 'simpletags'); // Option name for save settings
90 -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);
91 199
92 -define('STAGS_URL', plugins_url('', __FILE__));
93 -define('STAGS_DIR', rtrim(plugin_dir_path(__FILE__), '/'));
94 -define('TAXOPRESS_ABSPATH', __DIR__);
200 +$wordpressVersionNoticesPath = '/publishpress/wordpress-version-notices/src/include.php';
95 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 +
96 241 // Check PHP min version
97 242 if (version_compare(PHP_VERSION, STAGS_MIN_PHP_VERSION, '<')) {
98 243 require STAGS_DIR . '/inc/class.compatibility.php';
99 244
@@ -105,19 +250,19 @@
105 250 }
106 251
107 252 require STAGS_DIR . '/inc/loads.php';
108 253
109 -// Init TaxoPress
254 +// Init PublishPress Taxonomies
110 255 function init_free_simple_tags()
111 256 {
112 - if (is_admin() && !defined('TAXOPRESS_PRO_VERSION')) {
257 + if (is_admin() && ! defined('PUBLISHPRESS_TAXONOMIES_PRO_VERSION') && ! defined('TAXOPRESS_PRO_VERSION')) {
113 258 require_once(TAXOPRESS_ABSPATH . '/includes-core/TaxopressCoreAdmin.php');
114 259 new \PublishPress\Taxopress\TaxopressCoreAdmin();
115 260 }
116 261 }
117 -add_action('plugins_loaded', 'init_free_simple_tags');
262 +add_action('init', 'init_free_simple_tags', 0);
118 263
119 264 // Activation, uninstall
120 265 register_activation_hook(__FILE__, array('SimpleTags_Plugin', 'activation'));
121 266 register_deactivation_hook(__FILE__, array('SimpleTags_Plugin', 'deactivation'));
122 267
123 -add_action('plugins_loaded', 'init_simple_tags');
268 +add_action('init', 'init_simple_tags', 0);