/**
* Plugin Name: Disable Comments
* Plugin URI: https://wordpress.org/plugins/disable-comments/
* Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. You could bulk delete comments using Tools.
* Version: 2.5.2
* Author: WPDeveloper
* Author URI: https://wpdeveloper.com
* License: GPL-3.0+
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: disable-comments
* Domain Path: /languages/
*
* @package Disable_Comments
*/
if (!defined('ABSPATH')) {
exit;
}
class Disable_Comments {
const DB_VERSION = 7;
private static $instance = null;
private $options;
public $networkactive;
public $tracker;
public $is_CLI;
public $sitewide_settings;
public $setup_notice_flag;
private $modified_types = array();
public static function get_instance() {
if (is_null(self::$instance)) {
self::$instance = new self;
}
return self::$instance;
}
function __construct() {
define('DC_VERSION', '2.5.2');
define('DC_PLUGIN_SLUG', 'disable_comments_settings');
define('DC_PLUGIN_ROOT_PATH', dirname(__FILE__));
define('DC_PLUGIN_VIEWS_PATH', DC_PLUGIN_ROOT_PATH . '/views/');
define('DC_PLUGIN_ROOT_URI', plugins_url("/", __FILE__));
define('DC_ASSETS_URI', DC_PLUGIN_ROOT_URI . 'assets/');
// save settings
add_action('wp_ajax_disable_comments_save_settings', array($this, 'disable_comments_settings'));
add_action('wp_ajax_disable_comments_delete_comments', array($this, 'delete_comments_settings'));
add_action('wp_ajax_get_sub_sites', array($this, 'get_sub_sites'));
// Including cli.php
if (defined('WP_CLI') && WP_CLI) {
add_action('init', array($this, 'enable_cli'), 9999);
}
// are we network activated?
$this->networkactive = (is_multisite() && array_key_exists(plugin_basename(__FILE__), (array) get_site_option('active_sitewide_plugins')));
$this->is_CLI = defined('WP_CLI') && WP_CLI;
$this->sitewide_settings = get_site_option('disable_comments_sitewide_settings', false);
// Load options.
if ($this->networkactive && ($this->is_network_admin() || $this->sitewide_settings !== '1')) {
$this->options = get_site_option('disable_comments_options', array());
$this->options['disabled_sites'] = $this->get_disabled_sites();
$blog_id = get_current_blog_id();
if (
!$this->is_network_admin() && (
empty($this->options['disabled_sites']) ||
// if site disabled
empty($this->options['disabled_sites']["site_$blog_id"])
)
) {
$this->options = [
'remove_everywhere' => false,
'disabled_post_types' => array(),
'extra_post_types' => array(),
'disabled_sites' => array(),
'remove_xmlrpc_comments' => 0,
'remove_rest_API_comments' => 0,
'settings_saved' => true,
'db_version' => $this->options['db_version']
];
}
} else {
$this->options = get_option('disable_comments_options', array());
$not_configured = empty($this->options) || empty($this->options['settings_saved']);
if (is_multisite() && $not_configured && $this->sitewide_settings == '1') {
$this->options = get_site_option('disable_comments_options', array());
$this->options['is_network_options'] = true;
}
}
// If it looks like first run, check compat.
if (empty($this->options)) {
$this->check_compatibility();
}
$this->options['sitewide_settings'] = ($this->sitewide_settings == '1');
// Upgrade DB if necessary.
$this->check_db_upgrades();
$this->check_upgrades();
add_action('plugins_loaded', [$this, 'init_filters']);
add_action('wp_loaded', [$this, 'start_plugin_usage_tracking']);
}
public function is_network_admin() {
$sanitized_referer = isset($_SERVER['HTTP_REFERER']) ? sanitize_text_field( wp_unslash($_SERVER['HTTP_REFERER']) ) : '';
if (is_network_admin() || !empty($sanitized_referer) && defined('DOING_AJAX') && DOING_AJAX && is_multisite() && preg_match('#^' . network_admin_url() . '#i', $sanitized_referer)) {
return true;
}
return false;
}
/**
* Enable CLI
* @since 2.0.0
*/
public function enable_cli() {
require_once DC_PLUGIN_ROOT_PATH . "/includes/cli.php";
new Disable_Comment_Command($this);
}
public function admin_notice() {
if ($this->tracker instanceof DisableComments_Plugin_Tracker) {
if (isset($this->setup_notice_flag) && $this->setup_notice_flag === true) {
return;
}
$current_screen = get_current_screen()->id;
$has_caps = $this->networkactive && is_network_admin() ? current_user_can('manage_network_plugins') : current_user_can('manage_options');
// if( ! in_array( $current_screen, ['settings_page_disable_comments_settings', 'settings_page_disable_comments_settings-network']) && $has_caps ) {
if ($has_caps && in_array($current_screen, ['dashboard-network', 'dashboard'])) {
$this->tracker->notice();
}
}
}
public function start_plugin_usage_tracking() {
if ($this->networkactive && !$this->options['sitewide_settings']) {
$this->tracker = null;
return;
}
if (!class_exists('DisableComments_Plugin_Tracker')) {
include_once(DC_PLUGIN_ROOT_PATH . '/includes/class-plugin-usage-tracker.php');
}
$tracker = $this->tracker = DisableComments_Plugin_Tracker::get_instance(__FILE__, [
'opt_in' => true,
'goodbye_form' => true,
'item_id' => 'b0112c9030af6ba53de4'
]);
$tracker->set_notice_options(array(
'notice' => __('Want to help make Disable Comments even better?', 'disable-comments'),
'extra_notice' => __('We collect non-sensitive diagnostic data and plugin usage information. Your site URL, WordPress & PHP version, plugins & themes and email address to send you the discount coupon. This data lets us make sure this plugin always stays compatible with the most popular plugins and themes. No spam, I promise.', 'disable-comments'),
));
$tracker->init();
}
private function check_compatibility() {
if (version_compare($GLOBALS['wp_version'], '4.7', '<')) {
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
deactivate_plugins(__FILE__);
// @phpcs:ignore WordPress.Security.NonceVerification.Recommended
if (isset($_GET['action']) && ($_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape')) {
// translators: %s: WordPress version no.
exit(sprintf(esc_html__('Disable Comments requires WordPress version %s or greater.', 'disable-comments'), '4.7'));
}
}
}
private function check_db_upgrades() {
$old_ver = isset($this->options['db_version']) ? $this->options['db_version'] : 0;
if ($old_ver < self::DB_VERSION) {
if ($this->networkactive) {
$this->options['is_network_admin'] = true;
}
if ($old_ver < 2) {
// upgrade options from version 0.2.1 or earlier to 0.3.
$this->options['disabled_post_types'] = get_option('disable_comments_post_types', array());
delete_option('disable_comments_post_types');
}
if ($old_ver < 5) {
// simple is beautiful - remove multiple settings in favour of one.
$this->options['remove_everywhere'] = isset($this->options['remove_admin_menu_comments']) ? $this->options['remove_admin_menu_comments'] : false;
foreach (array('remove_admin_menu_comments', 'remove_admin_bar_comments', 'remove_recent_comments', 'remove_discussion', 'remove_rc_widget') as $v) {
unset($this->options[$v]);
}
}
if ($old_ver < 7 && function_exists('get_sites')) {
$this->options['disabled_sites'] = [];
$dc_options = get_site_option('disable_comments_options', array());
foreach (get_sites(['number' => 0, 'fields' => 'ids']) as $blog_id) {
if (isset($dc_options['disabled_sites'])) {
$this->options['disabled_sites']["site_$blog_id"] = in_array($blog_id, $dc_options['disabled_sites']);
} else {
$this->options['disabled_sites']["site_$blog_id"] = true;
}
}
$this->options['disabled_sites'] = $this->get_disabled_sites();
}
foreach (array('remove_everywhere', 'extra_post_types') as $v) {
if (!isset($this->options[$v])) {
$this->options[$v] = false;
}
}
$this->options['db_version'] = self::DB_VERSION;
$this->update_options();
}
}
public function check_upgrades() {
$dc_version = get_option('disable_comment_version');
if (version_compare($dc_version, '2.3.1', '<')) {
if ($this->is_remove_everywhere()) {
update_option('show_avatars', true);
}
}
if (!$dc_version || $dc_version != DC_VERSION) {
update_option('disable_comment_version', DC_VERSION);
}
}
private function update_options() {
if ($this->networkactive && !empty($this->options['is_network_admin']) && $this->options['is_network_admin']) {
unset($this->options['is_network_admin']);
update_site_option('disable_comments_options', $this->options);
} else {
update_option('disable_comments_options', $this->options);
}
}
public function get_disabled_sites($default = false) {
$disabled_sites = ['all' => true];
foreach (get_sites(['number' => 0, 'fields' => 'ids']) as $blog_id) {
$disabled_sites["site_{$blog_id}"] = true;
}
if ($default) {
return $disabled_sites;
}
$this->options['disabled_sites'] = isset($this->options['disabled_sites']) ? $this->options['disabled_sites'] : [];
$this->options['disabled_sites'] = wp_parse_args($this->options['disabled_sites'], $disabled_sites);
$disabled_sites = $this->options['disabled_sites'];
unset($disabled_sites['all']);
if (in_array(false, $disabled_sites)) {
$this->options['disabled_sites']['all'] = false;
} else {
$this->options['disabled_sites']['all'] = true;
}
return $this->options['disabled_sites'];
}
// public function get_disabled_count(){
// $disabled_sites = isset($this->options['disabled_sites']) ? $this->options['disabled_sites'] : [];
// unset($disabled_sites['all']);
// return array_sum($disabled_sites);
// }
/**
* Get an array of disabled post type.
*/
public function get_disabled_post_types() {
$types = $this->options['disabled_post_types'];
// Not all extra_post_types might be registered on this particular site.
if ($this->networkactive && !empty($this->options['extra_post_types'])) {
foreach ((array) $this->options['extra_post_types'] as $extra) {
if (post_type_exists($extra)) {
$types[] = $extra;
}
}
}
return $types;
}
/**
* Check whether comments have been disabled on a given post type.
*/
private function is_exclude_by_role() {
if (!empty($this->options['enable_exclude_by_role']) && !empty($this->options['exclude_by_role'])) {
if (is_user_logged_in()) {
$user = wp_get_current_user();
$roles = (array) $user->roles;
$diff = array_intersect($this->options['exclude_by_role'], $roles);
if (count($diff) || (in_array("administrator", $this->options['exclude_by_role']) && is_super_admin())) {
return true;
}
} else if (in_array('logged-out-users', $this->options['exclude_by_role'])) {
return true;
}
}
return false;
}
private function is_remove_everywhere() {
if ($this->is_exclude_by_role()) {
return false;
}
if (isset($this->options['remove_everywhere'])) {
return $this->options['remove_everywhere'];
}
return false;
}
/**
* Check whether comments have been disabled on a given post type.
*/
private function is_post_type_disabled($type) {
if ($this->is_exclude_by_role()) {
return false;
}
return $type && in_array($type, $this->get_disabled_post_types());
}
public function init_filters() {
// These need to happen now.
if ($this->is_remove_everywhere()) {
add_action('widgets_init', array($this, 'disable_rc_widget'));
add_filter('wp_headers', array($this, 'filter_wp_headers'));
add_action('template_redirect', array($this, 'filter_query'), 9); // before redirect_canonical.
// Admin bar filtering has to happen here since WP 3.6.
add_action('template_redirect', array($this, 'filter_admin_bar'));
add_action('admin_init', array($this, 'filter_admin_bar'));
// Disable Comments REST API Endpoint
add_filter('rest_endpoints', array($this, 'filter_rest_endpoints'));
}
// remove create comment via xmlrpc
if (isset($this->options['remove_xmlrpc_comments']) && intval($this->options['remove_xmlrpc_comments']) === 1) {
add_filter('xmlrpc_methods', array($this, 'disable_xmlrc_comments'));
}
// rest API Comment Block
if (isset($this->options['remove_rest_API_comments']) && intval($this->options['remove_rest_API_comments']) === 1) {
add_filter('rest_endpoints', array($this, 'filter_rest_endpoints'));
add_filter('rest_pre_insert_comment', array($this, 'disable_rest_API_comments'), 10, 2);
}
// These can happen later.
$this->register_text_domain();
// add_action('plugins_loaded', array($this, 'register_text_domain'));
add_action('wp_loaded', array($this, 'init_wploaded_filters'));
// Disable "Latest comments" block in Gutenberg.
add_action('enqueue_block_editor_assets', array($this, 'filter_gutenberg_blocks'));
// settings page assets
add_action('admin_enqueue_scripts', array($this, 'settings_page_assets'));
if (!$this->networkactive || $this->options['sitewide_settings']) {
add_filter('comment_status_links', function ($status_links) {
$status_links['disable_comments'] = sprintf("%s", __("Disable Comments", 'disable-comments'));
return $status_links;
});
}
}
public function register_text_domain() {
load_plugin_textdomain('disable-comments', false, dirname(plugin_basename(__FILE__)) . '/languages');
}
public function init_wploaded_filters() {
$disabled_post_types = $this->get_disabled_post_types();
if (!empty($disabled_post_types) && !$this->is_exclude_by_role()) {
foreach ($disabled_post_types as $type) {
// we need to know what native support was for later.
if (post_type_supports($type, 'comments')) {
$this->modified_types[] = $type;
remove_post_type_support($type, 'comments');
remove_post_type_support($type, 'trackbacks');
}
}
} elseif (is_admin() && !$this->is_configured()) {
/**
* It is possible that $disabled_post_types is empty if other
* plugins have disabled comments. Hence we also check for
* remove_everywhere. If you still get a warning you probably
* shouldn't be using this plugin.
*/
add_action('all_admin_notices', array($this, 'setup_notice'));
}
if ($this->is_remove_everywhere() || (!empty($disabled_post_types) && !$this->is_exclude_by_role())) {
add_filter('comments_array', array($this, 'filter_existing_comments'), 20, 2);
add_filter('comments_open', array($this, 'filter_comment_status'), 20, 2);
add_filter('pings_open', array($this, 'filter_comment_status'), 20, 2);
add_filter('get_comments_number', array($this, 'filter_comments_number'), 20, 2);
}
// Filters for the admin only.
if (is_admin()) {
add_action('all_admin_notices', array($this, 'admin_notice'));
if ($this->networkactive && is_network_admin()) {
add_action('network_admin_menu', array($this, 'settings_menu'));
add_action('network_admin_menu', array($this, 'tools_menu'));
add_filter('network_admin_plugin_action_links', array($this, 'plugin_actions_links'), 10, 2);
} elseif (!$this->networkactive || $this->options['sitewide_settings']) {
add_action('admin_menu', array($this, 'settings_menu'));
add_action('admin_menu', array($this, 'tools_menu'));
add_filter('plugin_action_links', array($this, 'plugin_actions_links'), 10, 2);
if (is_multisite()) { // We're on a multisite setup, but the plugin isn't network activated.
register_deactivation_hook(__FILE__, array($this, 'single_site_deactivate'));
}
}
add_action('admin_notices', array($this, 'discussion_notice'));
add_filter('plugin_row_meta', array($this, 'set_plugin_meta'), 10, 2);
if ($this->is_remove_everywhere()) {
add_action('admin_menu', array($this, 'filter_admin_menu'), 9999); // do this as late as possible.
add_action('admin_print_styles-index.php', array($this, 'admin_css'));
add_action('admin_print_styles-profile.php', array($this, 'admin_css'));
add_action('wp_dashboard_setup', array($this, 'filter_dashboard'));
add_filter('pre_option_default_pingback_flag', '__return_zero');
}
}
// Filters for front end only.
else {
add_action('template_redirect', array($this, 'check_comment_template'));
if ($this->is_remove_everywhere()) {
add_filter('feed_links_show_comments_feed', '__return_false');
}
}
}
// public function get_option( $key, $default = false ){
// return $this->networkactive ? get_site_option( $key, $default ) : get_option( $key, $default );
// }
// public function update_option( $option, $value ){
// return $this->networkactive ? update_site_option( $option, $value ) : update_option( $option, $value );
// }
// public function delete_option( $option ){
// return $this->networkactive ? delete_site_option( $option ) : delete_option( $option );
// }
/**
* Replace the theme's comment template with a blank one.
* To prevent this, define DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE
* and set it to True
*/
public function check_comment_template() {
if (is_singular() && ($this->is_remove_everywhere() || $this->is_post_type_disabled(get_post_type()))) {
if (!defined('DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE') || DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE == true) {
// Kill the comments template.
add_filter('comments_template', array($this, 'dummy_comments_template'), 20);
}
// Remove comment-reply script for themes that include it indiscriminately.
wp_deregister_script('comment-reply');
// feed_links_extra inserts a comments RSS link.
remove_action('wp_head', 'feed_links_extra', 3);
}
}
public function dummy_comments_template() {
return dirname(__FILE__) . '/views/comments.php';
}
public function is_xmlrpc_rest() {
// remove create comment via xmlrpc
if (isset($this->options['remove_xmlrpc_comments']) && intval($this->options['remove_xmlrpc_comments']) === 1) {
return true;
}
// rest API Comment Block
if (isset($this->options['remove_rest_API_comments']) && intval($this->options['remove_rest_API_comments']) === 1) {
return true;
}
return false;
}
/**
* Remove the X-Pingback HTTP header
*/
public function filter_wp_headers($headers) {
unset($headers['X-Pingback']);
return $headers;
}
/**
* remove method wp.newComment
*/
public function disable_xmlrc_comments($methods) {
unset($methods['wp.newComment']);
return $methods;
}
public function disable_rest_API_comments($prepared_comment, $request) {
return;
}
/**
* Issue a 403 for all comment feed requests.
*/
public function filter_query() {
if (is_comment_feed()) {
wp_die(esc_html__('Comments are closed.', 'disable-comments'), '', array('response' => 403));
}
}
/**
* Remove comment links from the admin bar.
*/
public function filter_admin_bar() {
if (is_admin_bar_showing()) {
// Remove comments links from admin bar.
remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
if (is_multisite()) {
add_action('admin_bar_menu', array($this, 'remove_network_comment_links'), 500);
}
}
}
/**
* Remove the comments endpoint for the REST API
*/
public function filter_rest_endpoints($endpoints) {
if (isset($endpoints['comments'])) {
unset($endpoints['comments']);
}
if (isset($endpoints['/wp/v2/comments'])) {
unset($endpoints['/wp/v2/comments']);
}
if (isset($endpoints['/wp/v2/comments/(?P[\d]+)'])) {
unset($endpoints['/wp/v2/comments/(?P[\d]+)']);
}
return $endpoints;
}
/**
* Determines if scripts should be enqueued
*/
public function filter_gutenberg_blocks($hook) {
global $post;
if ($this->is_remove_everywhere() || (isset($post->post_type) && $this->is_post_type_disabled($post->post_type))) {
return $this->disable_comments_script();
}
}
/**
* Enqueues scripts
*/
public function disable_comments_script() {
wp_enqueue_script('disable-comments-gutenberg', plugin_dir_url(__FILE__) . 'assets/js/disable-comments.js', array(), DC_VERSION, true);
}
/**
* Enqueues Scripts for Settings Page
*/
public function settings_page_assets($hook_suffix) {
if (
$hook_suffix === 'settings_page_' . DC_PLUGIN_SLUG ||
$hook_suffix === 'options-general_' . DC_PLUGIN_SLUG
) {
// css
wp_enqueue_style('sweetalert2', DC_ASSETS_URI . 'css/sweetalert2.min.css', [], DC_VERSION);
// wp_enqueue_style('pagination', DC_ASSETS_URI . 'css/pagination.css', [], false);
wp_enqueue_style('disable-comments-style', DC_ASSETS_URI . 'css/style.css', [], DC_VERSION);
wp_enqueue_style('select2', DC_ASSETS_URI . 'css/select2.min.css', [], DC_VERSION);
// js
wp_enqueue_script('sweetalert2', DC_ASSETS_URI . 'js/sweetalert2.all.min.js', array('jquery'), DC_VERSION, true);
wp_enqueue_script('pagination', DC_ASSETS_URI . 'js/pagination.min.js', array('jquery'), DC_VERSION, true);
wp_enqueue_script('select2', DC_ASSETS_URI . 'js/select2.min.js', array('jquery'), DC_VERSION, true);
wp_enqueue_script('disable-comments-scripts', DC_ASSETS_URI . 'js/disable-comments-settings-scripts.js', array('jquery', 'select2', 'pagination', 'sweetalert2', 'wp-i18n'), DC_VERSION, true);
wp_localize_script(
'disable-comments-scripts',
'disableCommentsObj',
array(
'save_action' => 'disable_comments_save_settings',
'delete_action' => 'disable_comments_delete_comments',
'settings_URI' => $this->settings_page_url(),
'_nonce' => wp_create_nonce('disable_comments_save_settings')
)
);
wp_set_script_translations('disable-comments-scripts', 'disable-comments');
} else {
// notice css
wp_enqueue_style('disable-comments-notice', DC_ASSETS_URI . 'css/notice.css', [], DC_VERSION);
}
}
/**
* Remove comment links from the admin bar in a multisite network.
*/
public function remove_network_comment_links($wp_admin_bar) {
if ($this->networkactive && is_user_logged_in()) {
foreach ((array) $wp_admin_bar->user->blogs as $blog) {
$wp_admin_bar->remove_menu('blog-' . $blog->userblog_id . '-c');
}
} else {
// We have no way to know whether the plugin is active on other sites, so only remove this one.
$wp_admin_bar->remove_menu('blog-' . get_current_blog_id() . '-c');
}
}
public function discussion_notice() {
$disabled_post_types = $this->get_disabled_post_types();
if (get_current_screen()->id == 'options-discussion' && !empty($disabled_post_types)) {
$names_escaped = array();
foreach ($disabled_post_types as $type) {
$names_escaped[$type] = esc_html(get_post_type_object($type)->labels->name);
}
// translators: %s: disabled post types.
echo '
' . sprintf(esc_html__('Note: The Disable Comments plugin is currently active, and comments are completely disabled on: %s. Many of the settings below will not be applicable for those post types.', 'disable-comments'), implode(esc_html__(', ', 'disable-comments'), $names_escaped)) . '
';
}
}
/**
* Return context-aware settings page URL
*/
private function settings_page_url() {
$base = $this->networkactive && is_network_admin() ? network_admin_url('settings.php') : admin_url('options-general.php');
return add_query_arg('page', DC_PLUGIN_SLUG, $base);
}
/**
* Return context-aware tools page URL
*/
private function tools_page_url() {
$base = $this->networkactive && is_network_admin() ? network_admin_url('settings.php') : admin_url('tools.php');
return add_query_arg('page', 'disable_comments_tools', $base);
}
public function setup_notice() {
$current_screen = get_current_screen()->id;
if (!in_array($current_screen, ['dashboard-network', 'dashboard'])) {
return;
}
$hascaps = $this->networkactive && is_network_admin() ? current_user_can('manage_network_plugins') : current_user_can('manage_options');
if ($this->networkactive && !is_network_admin() && !$this->options['sitewide_settings']) {
$hascaps = false;
}
if ($hascaps) {
$this->setup_notice_flag = true;
// translators: %s: URL to Disabled Comment settings page.
$html = sprintf(__('The Disable Comments plugin is active, but isn\'t configured to do anything yet. Visit the configuration page to choose which post types to disable comments on.', 'disable-comments'), esc_attr($this->settings_page_url()));
// phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage
echo wp_kses_post('
' . $html . '
');
}
}
public function filter_admin_menu() {
global $pagenow;
if ($pagenow == 'comment.php' || $pagenow == 'edit-comments.php') {
wp_die(esc_html__('Comments are closed.', 'disable-comments'), '', array('response' => 403));
}
remove_menu_page('edit-comments.php');
if (!$this->discussion_settings_allowed()) {
if ($pagenow == 'options-discussion.php') {
wp_die(esc_html__('Comments are closed.', 'disable-comments'), '', array('response' => 403));
}
remove_submenu_page('options-general.php', 'options-discussion.php');
}
}
public function filter_dashboard() {
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
}
public function admin_css() {
echo '';
}
public function filter_existing_comments($comments, $post_id) {
$post_type = get_post_type($post_id);
return ($this->is_remove_everywhere() || $this->is_post_type_disabled($post_type) ? array() : $comments);
}
public function filter_comment_status($open, $post_id) {
$post_type = get_post_type($post_id);
return ($this->is_remove_everywhere() || $this->is_post_type_disabled($post_type) ? false : $open);
}
public function filter_comments_number($count, $post_id) {
$post_type = get_post_type($post_id);
return ($this->is_remove_everywhere() || $this->is_post_type_disabled($post_type) ? 0 : $count);
}
public function disable_rc_widget() {
unregister_widget('WP_Widget_Recent_Comments');
/**
* The widget has added a style action when it was constructed - which will
* still fire even if we now unregister the widget... so filter that out
*/
add_filter('show_recent_comments_widget_style', '__return_false');
}
public function set_plugin_meta($links, $file) {
static $plugin;
$plugin = plugin_basename(__FILE__);
if ($file == $plugin) {
$links[] = 'GitHub';
}
return $links;
}
/**
* Add links to Settings page
*/
public function plugin_actions_links($links, $file) {
static $plugin;
$plugin = plugin_basename(__FILE__);
if ($file == $plugin && current_user_can('manage_options')) {
array_unshift(
$links,
sprintf('%s', esc_attr($this->settings_page_url()), __('Settings', 'disable-comments')),
sprintf('%s', esc_attr($this->tools_page_url()), __('Tools', 'disable-comments'))
);
}
return $links;
}
public function settings_menu() {
$title = _x('Disable Comments', 'settings menu title', 'disable-comments');
if ($this->networkactive && is_network_admin()) {
add_submenu_page('settings.php', $title, $title, 'manage_network_plugins', DC_PLUGIN_SLUG, array($this, 'settings_page'));
} elseif (!$this->networkactive || $this->options['sitewide_settings']) {
add_submenu_page('options-general.php', $title, $title, 'manage_options', DC_PLUGIN_SLUG, array($this, 'settings_page'));
}
}
public function tools_menu() {
$title = __('Delete Comments', 'disable-comments');
$hook = '';
if ($this->networkactive && is_network_admin()) {
$hook = add_submenu_page('settings.php', $title, $title, 'manage_network_plugins', 'disable_comments_tools', array($this, 'tools_page'));
} elseif (!$this->networkactive || $this->options['sitewide_settings']) {
$hook = add_submenu_page('tools.php', $title, $title, 'manage_options', 'disable_comments_tools', array($this, 'tools_page'));
}
add_action('load-' . $hook, array($this, 'redirectToMainSettingsPage'));
}
public function redirectToMainSettingsPage() {
wp_safe_redirect($this->settings_page_url() . '#delete');
exit;
}
public function get_all_comments_number() {
global $wpdb;
if (is_network_admin() && function_exists('get_sites') && class_exists('WP_Site_Query')) {
$count = 0;
$sites = get_sites([
'number' => 0,
'fields' => 'ids',
]);
foreach ($sites as $blog_id) {
switch_to_blog($blog_id);
$count += $this->__get_comment_count();
restore_current_blog();
}
return $count;
} else {
return $this->__get_comment_count();
}
}
public function get_all_comment_types() {
if ($this->networkactive && is_network_admin() && function_exists('get_sites')) {
$comment_types = [];
$sites = get_sites([
'number' => 0,
'fields' => 'ids',
]);
foreach ($sites as $blog_id) {
switch_to_blog($blog_id);
$comment_types = array_merge($this->_get_all_comment_types(), $comment_types);
restore_current_blog();
}
return $comment_types;
} else {
return $this->_get_all_comment_types();
}
}
public function _get_all_comment_types() {
global $wpdb;
$commenttypes = array();
// we need fresh data in every call.
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery -- We need to count comments across multiple sites
$commenttypes_query = $wpdb->get_results("SELECT DISTINCT comment_type FROM $wpdb->comments", ARRAY_A);
if (!empty($commenttypes_query) && is_array($commenttypes_query)) {
foreach ($commenttypes_query as $entry) {
$value = $entry['comment_type'];
if ('' === $value) {
$commenttypes['default'] = __('Default (no type)', 'disable-comments');
} else {
$commenttypes[$value] = ucwords(str_replace('_', ' ', $value)) . ' (' . $value . ')';
}
}
}
return $commenttypes;
}
public function get_all_post_types($network = false) {
$typeargs = array('public' => true);
if ($network || $this->networkactive && is_network_admin()) {
$typeargs['_builtin'] = true; // stick to known types for network.
}
$types = get_post_types($typeargs, 'objects');
foreach (array_keys($types) as $type) {
if (!in_array($type, $this->modified_types) && !post_type_supports($type, 'comments')) { // the type doesn't support comments anyway.
unset($types[$type]);
}
}
return $types;
}
public function get_roles($selected) {
$roles = [
[
"id" => 'logged-out-users',
"text" => __('Logged out users', 'disable-comments'),
"selected" => in_array('logged-out-users', (array) $selected),
]
];
$editable_roles = array_reverse(get_editable_roles());
foreach ($editable_roles as $role => $details) {
$roles[] = [
"id" => esc_attr($role),
"text" => translate_user_role($details['name']),
"selected" => in_array($role, (array) $selected),
];
}
return $roles;
}
public function tools_page() {
return;
}
public function settings_page() {
// if( isset( $_GET['cancel'] ) && trim( $_GET['cancel'] ) === 'setup' ){
// $this->update_option('dc_setup_screen_seen', true);
// }
$avatar_status = '-1';
if ($this->is_network_admin()) {
$show_avatars = [];
$sites = get_sites([
'number' => 0,
'fields' => 'ids',
]);
foreach ($sites as $blog_id) {
switch_to_blog($blog_id);
$show_avatars[] = (int) get_option('show_avatars', '0');
restore_current_blog();
}
if (count($show_avatars) == array_sum($show_avatars)) {
$avatar_status = '0';
} elseif (0 == array_sum($show_avatars)) {
$avatar_status = '1';
}
}
include_once DC_PLUGIN_VIEWS_PATH . 'settings.php';
}
public function get_sub_sites() {
$nonce = (isset($_REQUEST['nonce']) ? sanitize_text_field(wp_unslash($_REQUEST['nonce'])) : '');
if (!wp_verify_nonce($nonce, 'disable_comments_save_settings')) {
wp_send_json(['data' => [], 'totalNumber' => 0]);
}
$_sub_sites = [];
$type = isset($_GET['type']) ? sanitize_text_field(wp_unslash($_GET['type'])) : 'disabled';
$search = isset($_GET['search']) ? sanitize_text_field(wp_unslash($_GET['search'])) : '';
$pageSize = isset($_GET['pageSize']) ? sanitize_text_field(wp_unslash($_GET['pageSize'])) : 50;
$pageNumber = isset($_GET['pageNumber']) ? sanitize_text_field(wp_unslash($_GET['pageNumber'])) : 1;
$offset = ($pageNumber - 1) * $pageSize;
$sub_sites = get_sites([
'number' => $pageSize,
'offset' => $offset,
'search' => $search,
'fields' => 'ids',
]);
$totalNumber = get_sites([
// 'number' => $pageSize,
// 'offset' => $offset,
'search' => $search,
'count' => true,
]);
if ($type == 'disabled') {
$disabled_site_options = isset($this->options['disabled_sites']) ? $this->options['disabled_sites'] : [];
} else { // if($type == 'delete')
$disabled_site_options = $this->get_disabled_sites(true);
}
foreach ($sub_sites as $sub_site_id) {
$blog = get_blog_details($sub_site_id);
$is_checked = checked(!empty($disabled_site_options["site_$sub_site_id"]), true, false);
$_sub_sites[] = [
'site_id' => $sub_site_id,
'is_checked' => $is_checked,
'blogname' => $blog->blogname,
];
}
wp_send_json(['data' => $_sub_sites, 'totalNumber' => $totalNumber]);
}
public function get_form_array_escaped($_args = array()) {
$formArray = [];
if (!empty($_args)) {
$formArray = wp_parse_args($_args);
}
// nonce is verified in the calling function
// phpcs:ignore WordPress.Security.NonceVerification.Missing
else if(isset($_POST['data'])){
// need to use wp_parse_args before map_deep sanitize_text_field
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
$formArray = map_deep(wp_parse_args(wp_unslash($_POST['data'])), 'sanitize_text_field');
}
return $formArray;
}
public function disable_comments_settings($_args = array()) {
$nonce = (isset($_POST['nonce']) ? sanitize_text_field(wp_unslash($_POST['nonce'])) : '');
if (($this->is_CLI && !empty($_args)) || wp_verify_nonce($nonce, 'disable_comments_save_settings')) {
$formArray = $this->get_form_array_escaped($_args);
$old_options = $this->options;
$this->options = [];
if ($this->is_CLI) {
$this->options = $old_options;
}
$this->options['is_network_admin'] = isset($formArray['is_network_admin']) && $formArray['is_network_admin'] == '1' ? true : false;
if (!empty($this->options['is_network_admin']) && function_exists('get_sites') && empty($formArray['sitewide_settings'])) {
$formArray['disabled_sites'] = isset($formArray['disabled_sites']) ? $formArray['disabled_sites'] : [];
$this->options['disabled_sites'] = isset($old_options['disabled_sites']) ? $old_options['disabled_sites'] : [];
$this->options['disabled_sites'] = array_merge($this->options['disabled_sites'], $formArray['disabled_sites']);
} elseif (!empty($this->options['is_network_admin']) && !empty($formArray['sitewide_settings'])) {
$this->options['disabled_sites'] = $old_options['disabled_sites'];
}
if (isset($formArray['mode'])) {
$this->options['remove_everywhere'] = (sanitize_text_field($formArray['mode']) == 'remove_everywhere');
}
$post_types = $this->get_all_post_types($this->options['is_network_admin']);
if ($this->options['remove_everywhere']) {
$disabled_post_types = array_keys($post_types);
} else {
$disabled_post_types = (isset($formArray['disabled_types']) ? array_map('sanitize_key', (array) $formArray['disabled_types']) : ($this->is_CLI && isset($this->options['disabled_post_types']) ? $this->options['disabled_post_types'] : []));
}
$disabled_post_types = array_intersect($disabled_post_types, array_keys($post_types));
$this->options['disabled_post_types'] = $disabled_post_types;
// Extra custom post types.
if ($this->networkactive && isset($formArray['extra_post_types'])) {
$extra_post_types = array_filter(array_map('sanitize_key', explode(',', $formArray['extra_post_types'])));
$this->options['extra_post_types'] = array_diff($extra_post_types, array_keys($post_types)); // Make sure we don't double up builtins.
}
if (isset($formArray['sitewide_settings'])) {
update_site_option('disable_comments_sitewide_settings', $formArray['sitewide_settings']);
}
if (isset($formArray['disable_avatar'])) {
if ($this->is_network_admin()) {
if ($formArray['disable_avatar'] == '0' || $formArray['disable_avatar'] == '1') {
$sites = get_sites([
'number' => 0,
'fields' => 'ids',
]);
foreach ($sites as $blog_id) {
switch_to_blog($blog_id);
update_option('show_avatars', (bool) !$formArray['disable_avatar']);
restore_current_blog();
}
}
} else {
update_option('show_avatars', (bool) !$formArray['disable_avatar']);
}
}
if (isset($formArray['enable_exclude_by_role'])) {
$this->options['enable_exclude_by_role'] = $formArray['enable_exclude_by_role'];
}
if (isset($formArray['exclude_by_role'])) {
$this->options['exclude_by_role'] = $formArray['exclude_by_role'];
}
// xml rpc
$this->options['remove_xmlrpc_comments'] = (isset($formArray['remove_xmlrpc_comments']) ? intval($formArray['remove_xmlrpc_comments']) : ($this->is_CLI && isset($this->options['remove_xmlrpc_comments']) ? $this->options['remove_xmlrpc_comments'] : 0));
// rest api comments
$this->options['remove_rest_API_comments'] = (isset($formArray['remove_rest_API_comments']) ? intval($formArray['remove_rest_API_comments']) : ($this->is_CLI && isset($this->options['remove_rest_API_comments']) ? $this->options['remove_rest_API_comments'] : 0));
$this->options['db_version'] = self::DB_VERSION;
$this->options['settings_saved'] = true;
// save settings
$this->update_options();
}
if (!$this->is_CLI) {
wp_send_json_success(array('message' => __('Saved', 'disable-comments')));
wp_die();
}
}
public function is_configured() {
$disabled_post_types = $this->get_disabled_post_types();
if (empty($disabled_post_types) && empty($this->options['remove_everywhere']) && empty($this->options['remove_rest_API_comments']) && empty($this->options['remove_xmlrpc_comments'])) {
return false;
}
return true;
}
public function delete_comments_settings($_args = array()) {
global $deletedPostTypeNames;
$log = '';
$nonce = (isset($_POST['nonce']) ? sanitize_text_field(wp_unslash($_POST['nonce'])) : '');
if (($this->is_CLI && !empty($_args)) || wp_verify_nonce($nonce, 'disable_comments_save_settings')) {
$formArray = $this->get_form_array_escaped($_args);
if (!empty($formArray['is_network_admin']) && function_exists('get_sites') && class_exists('WP_Site_Query')) {
$sites = get_sites([
'number' => 0,
'fields' => 'ids',
]);
foreach ($sites as $blog_id) {
// $formArray['disabled_sites'] ids don't include "site_" prefix.
if (!empty($formArray['disabled_sites']) && !empty($formArray['disabled_sites']["site_$blog_id"])) {
switch_to_blog($blog_id);
$log = $this->delete_comments($_args);
restore_current_blog();
}
}
} else {
$log = $this->delete_comments($_args);
}
}
// message
$deletedPostTypeNames = array_unique((array) $deletedPostTypeNames);
$message = (count($deletedPostTypeNames) == 0 ? $log . '.' : $log . ' for ' . implode(", ", $deletedPostTypeNames) . '.');
if (!$this->is_CLI) {
wp_send_json_success(array('message' => $message));
wp_die();
} else {
return $log;
}
}
private function delete_comments($_args) {
global $wpdb;
global $deletedPostTypeNames;
$formArray = $this->get_form_array_escaped($_args);
$types = $this->get_all_post_types(!empty($formArray['is_network_admin']));
$commenttypes = $this->get_all_comment_types();
$log = "";
// comments delete
if (isset($formArray['delete_mode'])) {
if ($formArray['delete_mode'] == 'delete_everywhere') {
if ($this->truncate_table($wpdb->commentmeta) != false) {
if ($this->truncate_table($wpdb->comments) != false) {
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query("UPDATE $wpdb->posts SET comment_count = 0");
$this->optimize_table($wpdb->commentmeta);
$this->optimize_table($wpdb->comments);
$log = __('All comments have been deleted', 'disable-comments');
} else {
wp_send_json_error(array('message' => __('Internal error occured. Please try again later.', 'disable-comments')));
wp_die();
}
} else {
wp_send_json_error(array('message' => __('Internal error occured. Please try again later.', 'disable-comments')));
wp_die();
}
} elseif ($formArray['delete_mode'] == 'selected_delete_types') {
$delete_post_types = empty($formArray['delete_types']) ? array() : (array) $formArray['delete_types'];
$delete_post_types = array_intersect($delete_post_types, array_keys($types));
// Extra custom post types.
if ($this->networkactive && !empty($formArray['delete_extra_post_types'])) {
$delete_extra_post_types = array_filter(array_map('sanitize_key', explode(',', $formArray['delete_extra_post_types'])));
$delete_extra_post_types = array_diff($delete_extra_post_types, array_keys($types)); // Make sure we don't double up builtins.
$delete_post_types = array_merge($delete_post_types, $delete_extra_post_types);
}
if (!empty($delete_post_types)) {
// Loop through post_types and remove comments/meta and set posts comment_count to 0.
foreach ($delete_post_types as $delete_post_type) {
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query($wpdb->prepare("DELETE cmeta FROM $wpdb->commentmeta cmeta INNER JOIN $wpdb->comments comments ON cmeta.comment_id=comments.comment_ID INNER JOIN $wpdb->posts posts ON comments.comment_post_ID=posts.ID WHERE posts.post_type = %s", $delete_post_type));
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query($wpdb->prepare("DELETE comments FROM $wpdb->comments comments INNER JOIN $wpdb->posts posts ON comments.comment_post_ID=posts.ID WHERE posts.post_type = %s", $delete_post_type));
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query($wpdb->prepare("UPDATE $wpdb->posts SET comment_count = 0 WHERE post_author != 0 AND post_type = %s", $delete_post_type));
$post_type_object = get_post_type_object($delete_post_type);
$post_type_label = $post_type_object ? $post_type_object->labels->name : $delete_post_type;
$deletedPostTypeNames[] = $post_type_label;
}
$this->optimize_table($wpdb->commentmeta);
$this->optimize_table($wpdb->comments);
$log = __('All comments have been deleted', 'disable-comments');
}
} elseif ($formArray['delete_mode'] == 'selected_delete_comment_types') {
$delete_comment_types = empty($formArray['delete_comment_types']) ? array() : (array) $formArray['delete_comment_types'];
$delete_comment_types = array_intersect($delete_comment_types, array_keys($commenttypes));
if (!empty($delete_comment_types)) {
// Loop through comment_types and remove comments/meta and set posts comment_count to 0.
foreach ($delete_comment_types as $delete_comment_type) {
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query($wpdb->prepare("DELETE cmeta FROM $wpdb->commentmeta cmeta INNER JOIN $wpdb->comments comments ON cmeta.comment_id=comments.comment_ID WHERE comments.comment_type = %s", $delete_comment_type));
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query($wpdb->prepare("DELETE comments FROM $wpdb->comments comments WHERE comments.comment_type = %s", $delete_comment_type));
$deletedPostTypeNames[] = $commenttypes[$delete_comment_type];
}
// Update comment_count on post_types
foreach ($types as $key => $value) {
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$comment_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(comments.comment_ID) FROM $wpdb->comments comments INNER JOIN $wpdb->posts posts ON comments.comment_post_ID=posts.ID WHERE posts.post_type = %s", $key));
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query($wpdb->prepare("UPDATE $wpdb->posts SET comment_count = %d WHERE post_author != 0 AND post_type = %s", $comment_count, $key));
}
$this->optimize_table($wpdb->commentmeta);
$this->optimize_table($wpdb->comments);
$log = __('All comments have been deleted', 'disable-comments');
}
} elseif ($formArray['delete_mode'] == 'delete_spam') {
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query("DELETE cmeta FROM $wpdb->commentmeta cmeta INNER JOIN $wpdb->comments comments ON cmeta.comment_id=comments.comment_ID WHERE comments.comment_approved = 'spam'");
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query("DELETE comments FROM $wpdb->comments comments WHERE comments.comment_approved = 'spam'");
$this->optimize_table($wpdb->commentmeta);
$this->optimize_table($wpdb->comments);
$log = __('All spam comments have been deleted.', 'disable-comments');
}
}
delete_transient('wc_count_comments');
return $log;
}
private function discussion_settings_allowed() {
if (defined('DISABLE_COMMENTS_ALLOW_DISCUSSION_SETTINGS') && DISABLE_COMMENTS_ALLOW_DISCUSSION_SETTINGS == true) {
return true;
}
}
public function single_site_deactivate() {
// for single sites, delete the options upon deactivation, not uninstall.
delete_option('disable_comments_options');
}
/**
* We need fresh data in every call. Called after switching to blog in loop.
*
* @return int The number of comments.
*/
protected function __get_comment_count() {
global $wpdb;
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
return $wpdb->get_var("SELECT COUNT(comment_id) FROM $wpdb->comments");
}
/**
* Optimize a given table in the WordPress database.
*
* @param string $table_name The name of the table to optimize.
*/
protected function optimize_table($table_name) {
global $wpdb;
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
return $wpdb->query( "OPTIMIZE TABLE " . esc_sql( $table_name ) );
}
/**
* Truncate a given table in the WordPress database.
*
* @param string $table_name The name of the table to truncate.
*/
protected function truncate_table($table_name) {
global $wpdb;
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
return $wpdb->query( "TRUNCATE TABLE " . esc_sql( $table_name ) );
}
}
Disable_Comments::get_instance();
/*
* jQuery Numerator Plugin 0.2.1
* https://github.com/garethdn/jquery-numerator
*
* Copyright 2015, Gareth Nolan
* http://ie.linkedin.com/in/garethnolan/
* Based on jQuery Boilerplate by Zeno Rocha with the help of Addy Osmani
* http://jqueryboilerplate.com
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
;(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// AMD is used - Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
factory(require('jquery'));
} else {
// Neither AMD nor CommonJS used. Use global variables.
if (typeof jQuery === 'undefined') {
throw 'jquery-numerator requires jQuery to be loaded first';
}
factory(jQuery);
}
}(function ($) {
var pluginName = "numerator",
defaults = {
easing: 'swing',
duration: 500,
delimiter: undefined,
rounding: 0,
toValue: undefined,
fromValue: undefined,
queue: false,
onStart: function(){},
onStep: function(){},
onProgress: function(){},
onComplete: function(){}
};
function Plugin ( element, options ) {
this.element = element;
this.settings = $.extend( {}, defaults, options );
this._defaults = defaults;
this._name = pluginName;
this.init();
}
Plugin.prototype = {
init: function () {
this.parseElement();
this.setValue();
},
parseElement: function () {
var elText = $.trim($(this.element).text());
this.settings.fromValue = this.settings.fromValue || this.format(elText);
},
setValue: function() {
var self = this;
$({value: self.settings.fromValue}).animate({value: self.settings.toValue}, {
duration: parseInt(self.settings.duration, 10),
easing: self.settings.easing,
start: self.settings.onStart,
step: function(now, fx) {
$(self.element).text(self.format(now));
// accepts two params - (now, fx)
self.settings.onStep(now, fx);
},
// accepts three params - (animation object, progress ratio, time remaining(ms))
progress: self.settings.onProgress,
complete: self.settings.onComplete
});
},
format: function(value){
var self = this;
if ( parseInt(this.settings.rounding ) < 1) {
value = parseInt(value, 10);
} else {
value = parseFloat(value).toFixed( parseInt(this.settings.rounding) );
}
if (self.settings.delimiter) {
return this.delimit(value)
} else {
return value;
}
},
// TODO: Add comments to this function
delimit: function(value){
var self = this;
value = value.toString();
if (self.settings.rounding && parseInt(self.settings.rounding, 10) > 0) {
var decimals = value.substring( (value.length - (self.settings.rounding + 1)), value.length ),
wholeValue = value.substring( 0, (value.length - (self.settings.rounding + 1)));
return self.addDelimiter(wholeValue) + decimals;
} else {
return self.addDelimiter(value);
}
},
addDelimiter: function(value){
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, this.settings.delimiter);
}
};
$.fn[ pluginName ] = function ( options ) {
return this.each(function() {
if ( $.data( this, "plugin_" + pluginName ) ) {
$.data(this, 'plugin_' + pluginName, null);
}
$.data( this, "plugin_" + pluginName, new Plugin( this, options ) );
});
};
}));__( 'Not Found', 'elementor' );
__( 'Not Found', 'elementor' );
__( 'Something went wrong.', 'elementor' );
__( 'Continue', 'elementor' );
__( 'Go Back', 'elementor' );
__( 'First, enable unfiltered file uploads.', 'elementor' );
__( 'Enable', 'elementor' );
__( 'Skip', 'elementor' );
__( 'App could not be loaded', 'elementor' );
__( 'We’re sorry, but something went wrong. Click on ‘Learn more’ and follow each of the steps to quickly solve it.', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'Go Back', 'elementor' );
__( 'This file type is not allowed', 'elementor' );
__( 'This file type is not allowed', 'elementor' );
__( 'Select File', 'elementor' );
__( 'Upgrade Now', 'elementor' );
__( 'Loading', 'elementor' );
__( 'Back to dashboard', 'elementor' );
__( 'Close', 'elementor' );
__( 'Elementor', 'elementor' );
__( 'Header', 'elementor' );
__( 'What is a Header Template?', 'elementor' );
__( 'The header template allows you to easily design and edit custom WordPress headers so you are no longer constrained by your theme’s header design limitations.', 'elementor' );
__( 'You can create multiple headers, and assign each to different areas of your site.', 'elementor' );
__( 'Footer', 'elementor' );
__( 'What is a Footer Template?', 'elementor' );
__( 'The footer template allows you to easily design and edit custom WordPress footers without the limits of your theme’s footer design constraints', 'elementor' );
__( 'You can create multiple footers, and assign each to different areas of your site.', 'elementor' );
__( 'Single Page', 'elementor' );
__( 'What is a Single Page Template?', 'elementor' );
__( 'A single page template allows you to easily create the layout and style of pages, ensuring design consistency across all the pages of your site.', 'elementor' );
__( 'You can create multiple single page templates, and assign each to different areas of your site.', 'elementor' );
__( 'Single Post', 'elementor' );
__( 'What is a Single Post Template?', 'elementor' );
__( 'A single post template allows you to easily design the layout and style of posts, ensuring a design consistency throughout all your blog posts, for example.', 'elementor' );
__( 'You can create multiple single post templates, and assign each to a different category.', 'elementor' );
__( 'Archive', 'elementor' );
__( 'What is an Archive Template?', 'elementor' );
__( 'An archive template allows you to easily design the layout and style of archive pages - those pages that show a list of posts (e.g. a blog’s list of recent posts), which may be filtered by terms such as authors, categories, tags, search results, etc.', 'elementor' );
__( 'If you’d like a different style for a specific category, it’s easy to create a separate archive template whose condition is to only display when users are viewing that category’s list of posts.', 'elementor' );
__( 'search results page', 'elementor' );
__( 'What is a Search Results Template?', 'elementor' );
__( 'You can easily control the layout and design of the Search Results page with the Search Results template, which is simply a special archive template just for displaying search results.', 'elementor' );
__( 'You can customize the message if there are no results for the search term.', 'elementor' );
__( 'Product', 'elementor' );
__( 'What is a Single Product Template?', 'elementor' );
__( 'A single product template allows you to easily design the layout and style of WooCommerce single product pages, and apply that template to various conditions that you assign.', 'elementor' );
__( 'You can create multiple single product templates, and assign each to different types of products, enabling a custom design for each group of similar products.', 'elementor' );
__( 'Products Archive', 'elementor' );
__( 'What is a Products Archive Template?', 'elementor' );
__( 'A products archive template allows you to easily design the layout and style of your WooCommerce shop page or other product archive pages - those pages that show a list of products, which may be filtered by terms such as categories, tags, etc.', 'elementor' );
__( 'You can create multiple archive product templates, and assign each to different categories of products. This gives you the freedom to customize the appearance for each type of product being shown.', 'elementor' );
__( '404 page', 'elementor' );
__( 'What is a 404 Page Template?', 'elementor' );
__( 'A 404 page template allows you to easily design the layout and style of the page that is displayed when a visitor arrives at a page that does not exist.', 'elementor' );
__( 'Keep your site\'s visitors happy when they get lost by displaying your recent posts, a search bar, or any information that might help the user find what they were looking for.', 'elementor' );
__( 'Are you sure?', 'elementor' );
__( 'Removing %s will permanently delete changes made to the Websites Template\'s content and site settings', 'elementor' );
__( 'Delete', 'elementor' );
__( 'Cancel', 'elementor' );
__( 'Try a different Website Template or build your site from scratch.', 'elementor' );
__( 'OK', 'elementor' );
__( 'Library', 'elementor' );
__( 'You\'re ready to apply a new Kit!', 'elementor' );
__( 'Continue to new Kit', 'elementor' );
__( 'Close', 'elementor' );
__( '%s was successfully deleted', 'elementor' );
__( 'Your Kit', 'elementor' );
__( 'Add New', 'elementor' );
__( 'Close', 'elementor' );
__( 'Tip', 'elementor' );
__( 'Close', 'elementor' );
__( 'Theme Builder', 'elementor' );
__( 'Upgrade', 'elementor' );
__( 'Customize every part of your site', 'elementor' );
__( 'Get total control, consistency and a faster workflow by designing the recurring parts that make up a complete website like the Header & Footer, Archive, 404, WooCommerce pages and more.', 'elementor' );
__( 'Upgrade Now', 'elementor' );
__( 'Theme Builder could not be loaded', 'elementor' );
__( 'We’re sorry, but something went wrong. Click on ‘Learn more’ and follow each of the steps to quickly solve it.', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'Go Back', 'elementor' );
__( 'Info', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'Tip', 'elementor' );
__( 'Watch Video', 'elementor' );
__( 'Upgrade Now', 'elementor' );
__( 'Site Parts', 'elementor' );
__( 'All Parts', 'elementor' );
__( 'Error:', 'elementor' );
__( 'Loading', 'elementor' );
__( 'Templates & Theme Builder', 'elementor' );
__( 'WooCommerce Builder', 'elementor' );
__( 'Lead Collection & Form Builder', 'elementor' );
__( 'Dynamic Content', 'elementor' );
__( 'Popup Builder', 'elementor' );
__( 'Custom Code & CSS', 'elementor' );
__( 'Motion Effects & Animations', 'elementor' );
__( 'Notes & Collaboration', 'elementor' );
__( 'Theme Builder', 'elementor' );
__( 'AI for code, images, & layouts', 'elementor' );
__( 'Lead Collection', 'elementor' );
__( 'Image optimization', 'elementor' );
__( 'Custom Code & CSS', 'elementor' );
__( 'Accessibility scans and fixes', 'elementor' );
__( 'Email deliverability', 'elementor' );
__( 'WooCommerce Builder', 'elementor' );
__( 'Upload and Install Elementor Pro', 'elementor' );
__( 'Uploading', 'elementor' );
__( 'Import your Elementor Pro plugin file', 'elementor' );
__( 'Drag & Drop your .zip file here', 'elementor' );
__( 'or', 'elementor' );
__( 'Browse', 'elementor' );
__( 'Don\'t know where to get the file from?', 'elementor' );
__( 'Click here', 'elementor' );
__( 'Next', 'elementor' );
__( 'Skip', 'elementor' );
__( 'Sorry, the name wasn\'t saved. Try again, or skip for now.', 'elementor' );
__( 'Now, let\'s give your site a name.', 'elementor' );
__( 'This is what your site is called on the WP dashboard, and can be changed later from the general settings - it\'s not your website\'s URL.', 'elementor' );
__( 'Skip', 'elementor' );
__( 'Next', 'elementor' );
__( 'Have a logo? Add it here.', 'elementor' );
__( 'Otherwise, you can skip this and add one later.', 'elementor' );
__( 'Potential Site Logo', 'elementor' );
__( 'Drop image here', 'elementor' );
__( 'or', 'elementor' );
__( 'Open Media Library', 'elementor' );
__( 'This file type is not supported. Try a different type of file', 'elementor' );
__( 'This allows Elementor to scan your SVGs for malicious content. If you do not wish to allow this, use a different image format.', 'elementor' );
__( 'There was a problem with enabling SVG uploads. Try again, or use another image format.', 'elementor' );
__( 'Next', 'elementor' );
__( 'Install Hello Biz', 'elementor' );
__( 'Select theme', 'elementor' );
__( 'Continue with Hello Biz Theme', 'elementor' );
__( 'Your site\'s got Hello theme. High-five!', 'elementor' );
__( 'Next', 'elementor' );
__( 'There was a problem installing Hello Biz Theme.', 'elementor' );
__( 'Skip', 'elementor' );
__( 'Hold on, this can take a minute...', 'elementor' );
__( 'Okay, now we\'re really close...', 'elementor' );
__( 'There was a problem activating Hello Biz Theme.', 'elementor' );
__( 'You can switch your theme anytime', 'elementor' );
__( 'You can switch your theme later on', 'elementor' );
__( 'Continue with blank canvas', 'elementor' );
__( 'Skip', 'elementor' );
__( 'One', 'elementor' );
__( 'Advanced', 'elementor' );
__( 'Essential', 'elementor' );
__( 'Upgrade Now', 'elementor' );
__( 'Skip', 'elementor' );
__( 'Skip setup', 'elementor' );
__( 'To get the most out of Elementor, we\'ll help you take your', 'elementor' );
__( 'first steps:', 'elementor' );
__( 'Set your site\'s theme', 'elementor' );
__( 'Choose additional features', 'elementor' );
__( 'Choose how to start creating', 'elementor' );
__( 'Set your site\'s theme', 'elementor' );
__( 'Give your site a name & logo', 'elementor' );
__( 'Choose how to start creating', 'elementor' );
__( 'To get the most of Elementor, we\'ll connect your account.', 'elementor' );
__( 'Then you can:', 'elementor' );
__( 'Access dozens of professionally designed templates', 'elementor' );
__( 'Manage all your sites from the My Elementor dashboard', 'elementor' );
__( 'Unlock tools that streamline your workflow and site setup', 'elementor' );
__( 'To get the most out of Elementor, we\'ll connect your account.', 'elementor' );
__( 'Then you can:', 'elementor' );
__( 'Choose from countless professional templates', 'elementor' );
__( 'Manage your site with our handy dashboard', 'elementor' );
__( 'Take part in the community forum, share & grow together', 'elementor' );
__( 'Let\'s do it', 'elementor' );
__( 'Start setup', 'elementor' );
__( 'Oops, the connection failed. Try again.', 'elementor' );
__( 'Already have an account?', 'elementor' );
__( 'Click here to connect', 'elementor' );
__( 'Header and footer templates', 'elementor' );
__( 'Build a branded look with ready-to-use headers and footers', 'elementor' );
__( 'Business-focused widgets', 'elementor' );
__( 'Add contact forms, CTAs, and hero sections with one click', 'elementor' );
__( 'Optimized performance', 'elementor' );
__( 'Loads fast and looks great on any device', 'elementor' );
__( 'Start with Hello Biz', 'elementor' );
__( 'Some of the features you get with Hello Biz theme:', 'elementor' );
__( 'Hello Theme', 'elementor' );
__( 'Build without limits', 'elementor' );
__( 'A minimal theme combining speed, flexibility, and control', 'elementor' );
__( 'Hello Biz', 'elementor' );
__( 'Instant online presence', 'elementor' );
__( 'A business-first theme offering smart layouts, templates, and site parts', 'elementor' );
__( 'Choose the right theme for your website', 'elementor' );
__( 'Hello themes provide a lightweight, Elementor-ready foundation for your site.', 'elementor' );
__( 'You can switch your theme anytime.', 'elementor' );
__( 'Every site starts with a theme.', 'elementor' );
__( 'Hello Biz by Elementor helps you launch your professional business website - fast.', 'elementor' );
__( 'Here\'s why:', 'elementor' );
__( 'Get online faster', 'elementor' );
__( 'Lightweight and fast loading', 'elementor' );
__( 'Great for SEO', 'elementor' );
__( 'Blank Canvas', 'elementor' );
__( 'Blank Canvas', 'elementor' );
__( 'Blank Canvas', 'elementor' );
__( 'Create New Elementor Page', 'elementor' );
__( 'Based on the features you chose, we recommend the %s plan, or higher', 'elementor' );
__( 'How would you like to create your website?', 'elementor' );
__( 'Click here to go to Elementor\'s Website Templates', 'elementor' );
__( 'Choose a professionally-designed template or import your own', 'elementor' );
__( 'Click here to go to Elementor\'s Site Planner', 'elementor' );
__( 'Create a professional site in minutes using AI', 'elementor' );
__( 'All set! Choose how to start', 'elementor' );
__( 'Click here to create a new page and open it in Elementor Editor', 'elementor' );
__( 'Blank Canvas', 'elementor' );
__( 'Start from scratch with the Elementor Editor', 'elementor' );
__( 'Click here to go to Elementor\'s Website Templates', 'elementor' );
__( 'Website Templates', 'elementor' );
__( 'Choose professionally-designed templates or import your own', 'elementor' );
__( 'Click here to go to Elementor\'s Site Planner', 'elementor' );
__( 'AI Site Planner', 'elementor' );
__( 'Get a head start with AI-powered site planning', 'elementor' );
__( 'You can switch your method anytime', 'elementor' );
__( 'Welcome aboard! What\'s next?', 'elementor' );
__( 'That\'s a wrap! What\'s next?', 'elementor' );
__( 'There are three ways to get started with Elementor:', 'elementor' );
__( 'Click here to create a new page and open it in Elementor Editor', 'elementor' );
__( 'Edit a blank canvas with the Elementor Editor', 'elementor' );
__( 'Click here to go to Elementor\'s Website Templates', 'elementor' );
__( 'Choose a professionally-designed template or import your own', 'elementor' );
__( 'Click here to go to Elementor\'s Site Planner', 'elementor' );
__( 'Create a professional site in minutes using AI', 'elementor' );
__( 'Pro is now active! You can continue.', 'elementor' );
__( 'Upgrade now', 'elementor' );
__( 'Upgrade Now', 'elementor' );
__( 'Ready to Get Elementor Pro?', 'elementor' );
__( '90+ Basic & Pro widgets', 'elementor' );
__( '300+ Basic & Pro templates', 'elementor' );
__( 'Premium Support', 'elementor' );
__( 'And so much more!', 'elementor' );
__( 'Already have Elementor Pro?', 'elementor' );
__( 'Welcome!', 'elementor' );
__( 'Connect your account to enable your full creative workspace', 'elementor' );
__( 'Access beautiful templates, ready-made blocks, and a single dashboard to manage all your sites in one place', 'elementor' );
__( 'Connect your account', 'elementor' );
__( 'Continue as a guest', 'elementor' );
__( 'You\'re here!', 'elementor' );
__( 'You\'re here! Let\'s set things up.', 'elementor' );
__( ' Let\'s get connected.', 'elementor' );
__( 'Categories', 'elementor' );
__( 'Tags', 'elementor' );
__( 'Features', 'elementor' );
__( 'Plan', 'elementor' );
__( 'Free', 'elementor' );
__( 'Pro', 'elementor' );
__( 'Advanced', 'elementor' );
__( 'Expert', 'elementor' );
__( 'Agency', 'elementor' );
__( 'Free', 'elementor' );
__( 'Essential', 'elementor' );
__( 'Advanced & Higher', 'elementor' );
__( 'Free', 'elementor' );
__( 'Essential', 'elementor' );
__( 'Advanced', 'elementor' );
__( 'My Website Templates', 'elementor' );
__( 'My Website Templates', 'elementor' );
__( 'Connect', 'elementor' );
__( 'My Website Templates', 'elementor' );
__( 'Upgrade', 'elementor' );
__( 'All Website Templates', 'elementor' );
__( 'Favorites', 'elementor' );
__( 'Pages', 'elementor' );
__( 'Site Parts', 'elementor' );
__( 'Popups', 'elementor' );
__( 'Search %s...', 'elementor' );
__( 'No Results Found', 'elementor' );
__( 'Sort Descending', 'elementor' );
__( 'Sort Ascending', 'elementor' );
__( 'Clear', 'elementor' );
__( 'Website template storage is full.', 'elementor' );
__( 'Get more space ', 'elementor' );
__( 'Upgrade now', 'elementor' );
__( 'Website template storage is %1$s%% full.', 'elementor' );
__( 'Get more space ', 'elementor' );
__( 'Upgrade now', 'elementor' );
__( 'or', 'elementor' );
__( 'Dismiss notification', 'elementor' );
__( 'of', 'elementor' );
__( 'To get more space', 'elementor' );
__( 'Upgrade now', 'elementor' );
__( 'Upgrade', 'elementor' );
__( 'View Demo', 'elementor' );
__( 'Delete', 'elementor' );
__( 'Your library is currently over the new quota. Upgrade your plan within 90 days to keep all website templates', 'elementor' );
__( 'Actions', 'elementor' );
__( 'Your library is currently over the new quota. Upgrade your plan within 90 days to keep all website templates', 'elementor' );
__( 'Apply', 'elementor' );
__( 'Delete this Website Template?', 'elementor' );
__( 'Removing "%s" will permanently delete this website template from your library.', 'elementor' );
__( 'Cancel', 'elementor' );
__( 'Delete', 'elementor' );
__( 'You\'ve already applied a Website Templates.', 'elementor' );
__( 'Applying two Website Templates on the same website will mix global styles and colors and hurt your site\'s performance.', 'elementor' );
__( 'Remove the existing Website Template before applying a new one.', 'elementor' );
__( 'Remove existing', 'elementor' );
__( 'Apply anyway', 'elementor' );
__( 'Apply', 'elementor' );
__( 'Apply', 'elementor' );
__( 'Something went wrong.', 'elementor' );
__( 'Something went wrong.', 'elementor' );
__( 'Download Website', 'elementor' );
__( 'Download Website ZIP', 'elementor' );
__(
'Go to the pages screen to make sure your kit pages have been imported successfully. If not, try again.',
'elementor',
) }
approveButtonText={ __( 'Go to pages', 'elementor' );
__( 'Got it', 'elementor' );
_n( 'Showing %s result for', 'Showing %s results for', props.resultCount, 'elementor' );
__( 'no', 'elementor' );
__( 'Remove', 'elementor' );
__( 'Clear all', 'elementor' );
__( 'Remove from Favorites', 'elementor' );
__( 'Add to Favorites', 'elementor' );
__( 'Looking for more Website Templates?', 'elementor' );
__( 'Check out Elementor Website Templates on ThemeForest', 'elementor' );
__( 'Unable to connect', 'elementor' );
__( 'Connect to Template Library', 'elementor' );
__( 'Access this template and our entire library by creating a free personal account', 'elementor' );
__( 'Get Started', 'elementor' );
__( 'Cancel', 'elementor' );
__( 'Apply %s?', 'elementor' );
__( 'You can use everything in this kit, or Customize to only include some items.', 'elementor' );
__( 'By applying the entire kit, you\'ll override any styles, settings or content already on your site.', 'elementor' );
__( 'Apply All', 'elementor' );
__( 'Customize', 'elementor' );
__( 'No import sessions available to revert.', 'elementor' );
__( 'Are you sure?', 'elementor' );
__(
"Removing %s will permanently delete changes made to the Website Template's content and site settings",
'elementor',
).replace( '%s', activeKitName ),
strings: {
confirm: __( 'Delete', 'elementor' );
__( 'Cancel', 'elementor' );
__( '%s was successfully deleted', 'elementor' );
__(
'Try a different Website Template or build your site from scratch.',
'elementor',
),
strings: {
confirm: __( 'OK', 'elementor' );
__( 'Library', 'elementor' );
__( "You're ready to apply a new Kit!", 'elementor' );
__( 'Continue to new Kit', 'elementor' );
__( 'Close', 'elementor' );
__( 'Your Kit', 'elementor' );
__( 'Your Kit', 'elementor' );
__( 'Content', 'elementor' );
__( 'Elementor Pages', 'elementor' );
__( 'Elementor Posts', 'elementor' );
__( 'WP Pages', 'elementor' );
__( 'WP Posts', 'elementor' );
__( 'WP Menus', 'elementor' );
__( 'Custom Post Types', 'elementor' );
__( 'Templates', 'elementor' );
__( 'Saved Templates', 'elementor' );
__( 'Headers', 'elementor' );
__( 'Footers', 'elementor' );
__( 'Archives', 'elementor' );
__( 'Single Posts', 'elementor' );
__( 'Single Pages', 'elementor' );
__( 'Search Results', 'elementor' );
__( '404 Error Page', 'elementor' );
__( 'Popups', 'elementor' );
__( 'Global widgets', 'elementor' );
__( 'To import or export these components, you’ll need Elementor Pro.', 'elementor' );
__( 'Settings & configurations', 'elementor' );
__( 'Global Colors', 'elementor' );
__( 'Global Fonts', 'elementor' );
__( 'Theme Style Settings', 'elementor' );
__( 'Layout Settings', 'elementor' );
__( 'Lightbox Settings', 'elementor' );
__( 'Background Settings', 'elementor' );
__( 'Custom Fonts', 'elementor' );
__( 'Icons', 'elementor' );
__( 'Code', 'elementor' );
__( 'Plugins', 'elementor' );
__( 'All plugins are required for this website templates to work', 'elementor' );
__( 'Import', 'elementor' );
__( 'Export', 'elementor' );
__( 'Elementor Account', 'elementor' );
__( 'Choose Theme', 'elementor' );
__( 'Hello Biz Theme', 'elementor' );
__( 'Choose Features', 'elementor' );
__( 'Site Name', 'elementor' );
__( 'Site Logo', 'elementor' );
__( 'Start Creating Site', 'elementor' );
__( 'Good to Go', 'elementor' );
__( 'Create Account', 'elementor' );
__( 'My Elementor', 'elementor' );
__( 'Upgrade', 'elementor' );
__( 'Getting Started', 'elementor' );
__( 'Elementor Logo', 'elementor' );
__( 'Desktop', 'elementor' );
__( 'Tablet', 'elementor' );
__( 'Mobile', 'elementor' );
__( 'Overview', 'elementor' );
__( 'Kit Library', 'elementor' );
__( 'Loading...', 'elementor' );
__( 'View Demo', 'elementor' );
__( 'Kit Library', 'elementor' );
__( 'Loading...', 'elementor' );
__( 'WHAT\'S INSIDE', 'elementor' );
__( 'View Demo', 'elementor' );
__( 'Website Templates', 'elementor' );
__( 'Featured', 'elementor' );
__( 'New', 'elementor' );
__( 'Popular', 'elementor' );
__( 'Trending', 'elementor' );
__( 'Search all Website Templates...', 'elementor' );
__( 'Something went wrong.', 'elementor' );
__( 'Nothing to worry about, use 🔄 on the top corner to try again. If the problem continues, head over to the Help Center.', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'No results matched your search.', 'elementor' );
__( 'Try different keywords or ', 'elementor' );
__( 'Continue browsing.', 'elementor' );
__( 'Info', 'elementor' );
__( 'Refetch', 'elementor' );
__( 'Import', 'elementor' );
__( 'Import Website Template', 'elementor' );
__( 'Welcome to the Library', 'elementor' );
__( 'What\'s a Website Template?', 'elementor' );
__( 'A Website Template is full, ready-made design that you can apply to your site. It includes all the pages, parts, settings and content that you\'d expect in a fully functional website.', 'elementor' );
__( 'What\'s going on in the Website Templates Library?', 'elementor' );
__( 'Search & filter for website templates by category and tags, or browse through individual website templates to see what\'s inside.', 'elementor' );
__( 'Once you\'ve picked a winner, apply it to your site!', 'elementor' );
__( 'Happy browsing!', 'elementor' );
__( 'Learn more', 'elementor' );
__( 'about using templates', 'elementor' );
__( 'No favorites here yet...', 'elementor' );
__( 'Use the heart icon to save Website Templates that inspire you. You\'ll be able to find them here.', 'elementor' );
__( 'Continue browsing.', 'elementor' );
__( 'Access Website Templates with a plan upgrade', 'elementor' );
__( 'Your current plan doesn\'t include saving and importing Website Templates. Upgrade to the Advanced plan or higher to use this feature.', 'elementor' );
__( 'Compare plans', 'elementor' );
__( 'It\'s time to level up', 'elementor' );
__( 'Upgrade to Elementor Pro to import your own website template and save templates that you can reuse on any of your connected websites.', 'elementor' );
__( 'Upgrade now', 'elementor' );
__( 'Your library has been deactivated', 'elementor' );
__( 'Your subscription is currently deactivated, but you still have a 90 day window to keep all your templates safe. Upgrade within this time to continue enjoying them without interruption.', 'elementor' );
__( 'Upgrade now', 'elementor' );
__( 'Website Templates', 'elementor' );
__( 'Search my Website Templates...', 'elementor' );
__( 'Something went wrong.', 'elementor' );
__( 'Nothing to worry about, use 🔄 on the top corner to try again. If the problem continues, head over to the Help Center.', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'No Website Templates found for your search', 'elementor' );
__( 'Try different keywords or ', 'elementor' );
__( 'Continue browsing.', 'elementor' );
__( 'No Website Templates to show here yet', 'elementor' );
__( "Once you export a Website to the cloud, you'll find it here and be able to use it on all your sites.", 'elementor' );
__( 'Export this site', 'elementor' );
__( 'Website Templates', 'elementor' );
__( 'Back to Library', 'elementor' );
__( 'You’re using an older Elementor version. Update for full customization.', 'elementor' );
__( 'Update version', 'elementor' );
__( 'This website template was exported from an older version of Elementor. If possible, re-export it with the latest version for better capabilities.', 'elementor' );
__( 'Learn more', 'elementor' );
__( 'Edit settings & configurations', 'elementor' );
__( 'Theme', 'elementor' );
__( 'Theme', 'elementor' );
__( 'Only public WordPress themes are supported', 'elementor' );
__( 'Version', 'elementor' );
__( 'Version', 'elementor' );
__( 'Edit plugins', 'elementor' );
__( 'Plugin name and version', 'elementor' );
__( 'All plugins', 'elementor' );
__( 'Cancel', 'elementor' );
__( 'Save changes', 'elementor' );
__( 'This feature requires Elementor Pro', 'elementor' );
__( 'Upgrade', 'elementor' );
__( 'Edit', 'elementor' );
__( 'Edit', 'elementor' );
__( 'Not exported', 'elementor' );
__( 'Cancel', 'elementor' );
__( 'Save changes', 'elementor' );
__( 'Link to media', 'elementor' );
__( 'Stores only the URLs. The export stays light, but files load only while the original site is online.', 'elementor' );
__( 'Save media to the cloud', 'elementor' );
__( 'All images and files are stored with the template. Keeps everything intact, but the file is larger.', 'elementor' );
__( 'Media format', 'elementor' );
__( 'Note:', 'elementor' );
__( 'The media will be uploaded automatically, just as it was saved during export', 'elementor' );
__( 'Select how do you want to save & export the media files.', 'elementor' );
__( 'Media format', 'elementor' );
__( 'Note:', 'elementor' );
__( 'To export a ZIP, go to Edit Content, choose \'Link to Media\', then Export as ZIP.', 'elementor' );
__( 'Or, save this template to the cloud instead.', 'elementor' );
__( 'Edit content', 'elementor' );
__( 'Custom post types', 'elementor' );
__( 'Custom post types', 'elementor' );
__( 'Not exported', 'elementor' );
__( 'All', 'elementor-pro' );
__( 'Show less', 'elementor' );
__( 'Show more', 'elementor' );
__( 'What\'s included:', 'elementor' );
__( 'Import', 'elementor' );
__( 'Settings up your website templates...', 'elementor' );
__( 'This usually take a few moments.', 'elementor' );
__( 'Don\'t close this window until the process is finished.', 'elementor' );
__( 'Import', 'elementor' );
__( 'Import a website template', 'elementor' );
__( 'Upload a file with templates, site settings, content, etc., and apply them to your site ', 'elementor' );
__( 'Learn more', 'elementor' );
__( 'Import', 'elementor' );
__( 'Back', 'elementor' );
__( 'Import and apply', 'elementor' );
__( 'Select which parts you want to apply', 'elementor' );
__( 'These are the templates, content and site settings that come with your website templates.', 'elementor' );
__( 'All items are already selected by default. Uncheck the ones you don\'t want.', 'elementor' );
__( 'No templates imported', 'elementor' );
__( 'No templates imported', 'elementor' );
__( 'No content imported', 'elementor' );
__( 'Taxonomies', 'elementor' );
__( 'Taxonomy', 'elementor' );
__( 'Menus', 'elementor' );
__( 'Menu', 'elementor' );
__( 'No content imported', 'elementor' );
__( 'No plugins imported', 'elementor' );
__( 'No settings imported', 'elementor' );
__( 'No settings imported', 'elementor' );
__( 'Content', 'elementor' );
__( 'Templates', 'elementor' );
__( 'Site settings', 'elementor' );
__( 'Plugins', 'elementor' );
__( 'See it Live', 'elementor' );
__( 'Close', 'elementor' );
__( 'Import', 'elementor' );
__( 'Kit is live illustration', 'elementor' );
__( 'Your website templates is now live on your site!', 'elementor' );
__( 'You\'ve imported and applied the following to your site:', 'elementor' );
__( 'Build sites faster with Website Templates.', 'elementor' );
__( 'Show me how', 'elementor' );
__( 'This file type is not allowed', 'elementor' );
__( 'This file type is not allowed', 'elementor' );
__( 'Activating plugins:', 'elementor' );
__( 'Try Again', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'Upload a .zip file', 'elementor' );
__( 'Click to upload', 'elementor' );
__( 'or drag and drop', 'elementor' );
__( 'Must add a website template name', 'elementor' );
__( 'Use characters only', 'elementor' );
__( 'Description exceeds 300 characters', 'elementor' );
__( 'Setting up your website template...', 'elementor' );
__( 'Processing media files...', 'elementor' );
__( 'Export failed', 'elementor' );
__( 'Export', 'elementor' );
__( 'Export', 'elementor' );
__( 'View in Library', 'elementor' );
__( 'Done', 'elementor' );
__( 'Export', 'elementor' );
__( 'No templates exported', 'elementor' );
__( 'No templates exported', 'elementor' );
__( 'No content exported', 'elementor' );
__( 'Taxonomies', 'elementor' );
__( 'No content exported', 'elementor' );
__( 'No plugins exported', 'elementor' );
__( 'No settings exported', 'elementor' );
__( 'No settings exported', 'elementor' );
__( 'Content', 'elementor' );
__( 'Templates', 'elementor' );
__( 'Site settings', 'elementor' );
__( 'Plugins', 'elementor' );
__( 'Your website template is now saved to the library!', 'elementor' );
__( 'Your .zip file is ready', 'elementor' );
__( 'You can find it in the My Website Templates tab.', 'elementor' );
__( 'Once the download is complete, you can upload it to be used for other sites.', 'elementor' );
__( 'Take me there', 'elementor' );
__( 'Is the automatic download not starting?', 'elementor' );
__( 'Download manually', 'elementor' );
__( 'Website template name', 'elementor' );
__( 'Type name here...', 'elementor' );
__( 'Description (Optional)', 'elementor' );
__( 'Type description here...', 'elementor' );
__( 'characters', 'elementor' );
__( 'This usually takes a few moments.', 'elementor' );
__( 'Don\'t close this window until the process is finished.', 'elementor' );
__( 'Save to library', 'elementor' );
__( 'Save to library', 'elementor' );
__( 'Save to library', 'elementor' );
__( 'Save to library', 'elementor' );
__( 'Export as .zip', 'elementor' );
__( 'Export a Website template?', 'elementor' );
__( 'Choose which Elementor components - templates, content and site settings - to include in your website templates file. By default, all of your components will be exported.', 'elementor' );
__( 'Learn more', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'We couldn’t download the Website Template due to technical difficulties on our part. Try again and if the problem persists contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Couldn’t handle the Website Template', 'elementor' );
__( 'Seems like your server is missing the PHP zip module. Install it on your server or contact your site host for further instructions.', 'elementor' );
__( 'Couldn’t use the .zip file', 'elementor' );
__( 'Seems like there is a problem with the zip’s files. Try installing again and if the problem persists contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'It took too much time to download your Website Template and we were unable to complete the process. If all the Website Template’s parts don’t appear in ', 'elementor' );
__( 'Pages', 'elementor' );
__( ', try again and if the problem persists contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'We couldn’t download the Website Template due to technical difficulty on our part. Try again in a few minutes and if the problem persists contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Couldn’t access the file', 'elementor' );
__( 'Seems like Elementor isn’t authorized to access relevant files for installing this Website Template. Contact your site host to get permission.', 'elementor' );
__( 'Couldn’t install the Website Template', 'elementor' );
__( 'The Website Template includes plugins you don’t have permission to install. Contact your site admin to change your permissions.', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'This is due to a conflict with one or more third-party plugins already active on your site. Try disabling them, and then give the download another go.', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'This download requires the \'DOMDocument\' PHP extension, which we couldn’t detect on your server. Enable this extension, or get in touch with your hosting service for support, and then give the download another go.', 'elementor' );
__( 'Couldn’t Export the Website Template', 'elementor' );
__( 'The export failed because it will pass the maximum Website Templates you can export.', 'elementor' );
__( 'Couldn’t fetch quota', 'elementor' );
__( 'Failed to fetch quota.', 'elementor' );
__( 'Couldn’t Export the Website Template', 'elementor' );
__( 'The export failed because it will pass the maximum Website Templates storage you have available.', 'elementor' );
__( 'Try Again', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'Close', 'elementor' );
__( 'Templates', 'elementor' );
__( 'Saved Templates', 'elementor' );
__( 'Headers', 'elementor' );
__( 'Footers', 'elementor' );
__( 'Archives', 'elementor' );
__( 'Single Posts', 'elementor' );
__( 'Single Pages', 'elementor' );
__( 'Search Results', 'elementor' );
__( '404 Error Page', 'elementor' );
__( 'Popups', 'elementor' );
__( 'Global widgets', 'elementor' );
__( 'To import or export these components, you’ll need Elementor Pro.', 'elementor' );
__( 'Content', 'elementor' );
__( 'Elementor Pages', 'elementor' );
__( 'Landing Pages', 'elementor' );
__( 'Elementor Posts', 'elementor' );
__( 'WP Pages', 'elementor' );
__( 'WP Posts', 'elementor' );
__( 'WP Menus', 'elementor' );
__( 'Custom Post Types', 'elementor' );
__( 'Site Settings', 'elementor' );
__( 'Global Colors', 'elementor' );
__( 'Global Fonts', 'elementor' );
__( 'Theme Style settings', 'elementor' );
__( 'Layout Settings', 'elementor' );
__( 'Lightbox Settings', 'elementor' );
__( 'Background Settings', 'elementor' );
__( 'Site Area', 'elementor' );
__( 'Included', 'elementor' );
__( 'Elementor Templates', 'elementor' );
__( 'Site Settings', 'elementor' );
__( 'Content', 'elementor' );
__( 'Plugins', 'elementor' );
__( 'Kit Info', 'elementor' );
__( 'Import a Website Template', 'elementor' );
__( 'What’s a Website Template?', 'elementor' );
__( 'A Website Template is a .zip file that contains all the parts of a complete site. It’s an easy way to get a site up and running quickly.', 'elementor' );
__( ' Learn more about Website Templates', 'elementor' );
__( 'How does importing work?', 'elementor' );
__( 'Start by uploading the file and selecting the parts and plugins you want to apply. If there are any overlaps between the kit and your current design, you’ll be able to choose which imported parts you want to apply or ignore. Once the file is ready, the kit will be applied to your site and you’ll be able to see it live.', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'Export a Website Kit', 'elementor' );
__( 'What’s a Website Kit?', 'elementor' );
__( 'A Website Kit is a .zip file that contains all the parts of a complete site. It’s an easy way to get a site up and running quickly.', 'elementor' );
__( ' Learn more about Website Kits', 'elementor' );
__( 'How does exporting work?', 'elementor' );
__( 'To turn your site into a Website Kit, select the templates, content, settings and plugins you want to include. Once it’s ready, you’ll get a .zip file that you can import to other sites.', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'Setting up your website template...', 'elementor' );
__( 'This usually takes a few moments.', 'elementor' );
__( "Don't close this window until the process is finished.", 'elementor' );
__( 'Custom Post Type', 'elementor' );
__( 'Click to select custom post types', 'elementor' );
__( 'No custom post types in your site...', 'elementor' );
__( 'Add the custom posts types to export. The latest 20 items from each type will be included.', 'elementor' );
__( 'Export', 'elementor' );
__( 'Close', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'We couldn’t download the Website Template due to technical difficulties on our part. Try again and if the problem persists contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Couldn’t handle the Website Template', 'elementor' );
__( 'Seems like your server is missing the PHP zip module. Install it on your server or contact your site host for further instructions.', 'elementor' );
__( 'Couldn’t use the .zip file', 'elementor' );
__( 'Seems like there is a problem with the zip’s files. Try installing again and if the problem persists contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'It took too much time to download your Website Template and we were unable to complete the process. If all the Website Template’s parts don’t appear in ', 'elementor' );
__( 'Pages', 'elementor' );
__( ', try again and if the problem persists contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'We couldn’t download the Website Template due to technical difficulty on our part. Try again in a few minutes and if the problem persists contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Couldn’t access the file', 'elementor' );
__( 'Seems like Elementor isn’t authorized to access relevant files for installing this Website Template. Contact your site host to get permission.', 'elementor' );
__( 'Couldn’t install the Website Template', 'elementor' );
__( 'The Website Template includes plugins you don’t have permission to install. Contact your site admin to change your permissions.', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'This is due to a conflict with one or more third-party plugins already active on your site. Try disabling them, and then give the download another go.', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'This download requires the \'DOMDocument\' PHP extension, which we couldn’t detect on your server. Enable this extension, or get in touch with your hosting service for support, and then give the download another go.', 'elementor' );
__( 'Couldn’t Export the Website Template', 'elementor' );
__( 'The export failed because it will pass the maximum Website Templates you can export. ', 'elementor' );
__( 'Learn more', 'elementor' );
__( 'Couldn’t fetch quota', 'elementor' );
__( 'Failed to fetch quota, please try again. If the problem continues, contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Learn more', 'elementor' );
__( 'Couldn’t Upload to Library', 'elementor' );
__( 'We couldn’t add your export to the library. Try again. ', 'elementor' );
__( 'Learn more', 'elementor' );
__( 'Unable to download the Website Template', 'elementor' );
__( 'We couldn’t download the Website Template due to technical difficulties on our part. Try again and if the problem persists contact ', 'elementor' );
__( 'Support', 'elementor' );
__( 'Learn more', 'elementor' );
__( 'Couldn’t save media files to the cloud', 'elementor' );
__( 'We ran into a problem while saving your media files to the cloud. Please try again. If the issue persists, edit the Content section and choose "Link to media" to save it as a reference. ', 'elementor' );
__( 'Learn more', 'elementor' );
__( 'Your library is full', 'elementor' );
__( 'This file', 'elementor' );
__( '%s exceeds the library size limit', 'elementor' );
__( 'The maximum website template library size is %s GB. To save this file, you can either export it locally as a .zip file or get more storage by ', 'elementor' );
__( 'Upgrade now', 'elementor' );
__( 'Cancel', 'elementor' );
__( 'Export as .zip', 'elementor' );
__( 'Try Again', 'elementor' );
__( 'Version' ) } ${ cellLinkProps.text }` }
);
const getHeaders = () => {
if ( ! withHeader ) {
return [];
}
const headers = [ 'Plugin Name', 'Version' ];
if ( withStatus ) {
headers.splice( 1, 0, 'Status' );
__( 'Learn More', 'elementor' );
__( 'Select which plugins to export', 'elementor' );
__( 'Your Website Template may not work as expected if key plugins are missing.', 'elementor' );
__( 'By default, we’ll include everything in your file. Uncheck the items you don\'t want.', 'elementor' );
__( 'Next', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'Select which items to export', 'elementor' );
__( 'You can export the content, site settings, and templates as a Website Template to be reused in the future.', 'elementor' );
__( 'Uncheck the items you don\'t want to include.', 'elementor' );
__( 'Open library', 'elementor' );
__( 'Done', 'elementor' );
__( 'Download manually', 'elementor' );
__( 'Show me how', 'elementor' );
__( 'Take me there', 'elementor' );
__( 'Your website template is now saved to the library!', 'elementor' );
__( 'Your .zip file is ready', 'elementor' );
__( 'You can find it in the My Website Templates tab.', 'elementor' );
__( 'Once the download is complete, you can upload it to be used for other sites.', 'elementor' );
__( 'Build sites faster with Website Templates.', 'elementor' );
__( 'Is the automatic download not starting?', 'elementor' );
__( 'Activating plugins:', 'elementor' );
__( 'Select which plugins to include', 'elementor' );
__( 'All items are already selected by default. Uncheck the ones you don\'t want.', 'elementor' );
__( ' Recommended:', 'elementor' );
__( 'Head over to Updates and make sure that your plugins are updated to the latest version.', 'elementor' );
__( 'Take me there', 'elementor' );
__( 'Learn More', 'elementor' );
__( 'Back to Website Templates', 'elementor' );
__( 'Import a Website Template', 'elementor' );
__( 'Upload a .zip file with style, site settings, content, etc. Then, we’ll apply them to your site.', 'elementor' );
__( 'Heads up!', 'elementor' );
__( 'Before applying a new template, we recommend backing up your site so you can roll back any undesired changes.', 'elementor' );
__( 'Choose a file to import', 'elementor' );
__( 'Drag & drop the .zip file with your website template', 'elementor' );
__( 'Import from files' ) }
/>
{ dialog.isOpen &&
' . $html . '