' . esc_html__('This plugin can be deleted.', 'simple-tags') . '';
}
return $links;
},
10,
2
);
add_action('admin_init', function () {
if (! function_exists('deactivate_plugins')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
if (function_exists('is_plugin_active') && is_plugin_active(plugin_basename(__FILE__))) {
deactivate_plugins(plugin_basename(__FILE__));
set_transient('taxopress_free_deactivated_due_to_pro', 1, 30);
}
});
add_action('admin_notices', function () {
if (! get_transient('taxopress_free_deactivated_due_to_pro')) {
return;
}
delete_transient('taxopress_free_deactivated_due_to_pro');
echo '
'
. esc_html__('TaxoPress was not activated because TaxoPress Pro is already active. Please keep only TaxoPress Pro enabled.', 'simple-tags')
. '
';
});
}
return;
}
$includeFileRelativePath = '/publishpress/instance-protection/include.php';
if (file_exists(__DIR__ . '/lib/vendor' . $includeFileRelativePath)) {
require_once __DIR__ . '/lib/vendor' . $includeFileRelativePath;
} elseif (defined('STAGS_LIB_VENDOR_PATH') && file_exists(STAGS_LIB_VENDOR_PATH . $includeFileRelativePath)) {
require_once STAGS_LIB_VENDOR_PATH . $includeFileRelativePath;
}
if (class_exists('PublishPressInstanceProtection\\Config')) {
$pluginCheckerConfig = new PublishPressInstanceProtection\Config();
$pluginCheckerConfig->pluginSlug = 'simple-tags';
$pluginCheckerConfig->pluginName = 'TaxoPress';
$pluginChecker = new PublishPressInstanceProtection\InstanceChecker($pluginCheckerConfig);
}
$bundledTranslationsPath = '/publishpress/bundled-translations/core/include.php';
if (file_exists(__DIR__ . '/lib/vendor' . $bundledTranslationsPath)) {
require_once __DIR__ . '/lib/vendor' . $bundledTranslationsPath;
} elseif (defined('STAGS_LIB_VENDOR_PATH') && file_exists(STAGS_LIB_VENDOR_PATH . $bundledTranslationsPath)) {
require_once STAGS_LIB_VENDOR_PATH . $bundledTranslationsPath;
}
$autoloadPath = __DIR__ . '/lib/vendor/autoload.php';
if (!file_exists($autoloadPath)) {
$autoloadPath = __DIR__ . '/vendor/autoload.php';
}
if (file_exists($autoloadPath)) {
require_once $autoloadPath;
}
add_action('plugins_loaded', function () {
if (class_exists('PublishPress\BundledTranslations\BundledTranslations')) {
$bundledTranslations = new PublishPress\BundledTranslations\BundledTranslations(
'simple-tags',
__DIR__ . '/languages',
__FILE__
);
$bundledTranslations->init();
}
}, 10);
$wordpressVersionNoticesPath = '/publishpress/wordpress-version-notices/src/include.php';
if (file_exists(__DIR__ . '/lib/vendor' . $wordpressVersionNoticesPath)) {
require_once __DIR__ . '/lib/vendor' . $wordpressVersionNoticesPath;
} elseif (defined('STAGS_LIB_VENDOR_PATH') && file_exists(STAGS_LIB_VENDOR_PATH . $wordpressVersionNoticesPath)) {
require_once STAGS_LIB_VENDOR_PATH . $wordpressVersionNoticesPath;
}
if (! defined('TAXOPRESS_FILE')) {
define('TAXOPRESS_FILE', __FILE__);
}
if (! defined('STAGS_MIN_PHP_VERSION')) {
define('STAGS_MIN_PHP_VERSION', '7.4');
}
if (! defined('STAGS_OPTIONS_NAME')) {
define('STAGS_OPTIONS_NAME', 'simpletags'); // Option name for save settings
}
if (! defined('STAGS_OPTIONS_NAME_AUTO')) {
define('STAGS_OPTIONS_NAME_AUTO', 'simpletags-auto'); // Option name for save settings auto terms
}
if (! defined('STAGS_URL')) {
define('STAGS_URL', plugins_url('', __FILE__));
}
if (! defined('STAGS_DIR')) {
define('STAGS_DIR', rtrim(plugin_dir_path(__FILE__), '/'));
}
if (! defined('TAXOPRESS_ABSPATH')) {
define('TAXOPRESS_ABSPATH', __DIR__);
}
if (! defined('STAGS_LIB_VENDOR_PATH')) {
define('STAGS_LIB_VENDOR_PATH', __DIR__ . '/lib/vendor');
}
// Check PHP min version
if (version_compare(PHP_VERSION, STAGS_MIN_PHP_VERSION, '<')) {
require STAGS_DIR . '/inc/class.compatibility.php';
// possibly display a notice, trigger error
add_action('admin_init', array('SimpleTags_Compatibility', 'admin_init'));
// stop execution of this file
return;
}
require STAGS_DIR . '/inc/loads.php';
// Init TaxoPress
function init_free_simple_tags()
{
if (is_admin() && !defined('TAXOPRESS_PRO_VERSION')) {
require_once(TAXOPRESS_ABSPATH . '/includes-core/TaxopressCoreAdmin.php');
new \PublishPress\Taxopress\TaxopressCoreAdmin();
}
}
add_action('init', 'init_free_simple_tags', 0);
// Activation, uninstall
register_activation_hook(__FILE__, array('SimpleTags_Plugin', 'activation'));
register_deactivation_hook(__FILE__, array('SimpleTags_Plugin', 'deactivation'));
add_action('init', 'init_simple_tags', 0);