first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

View File

@@ -0,0 +1,133 @@
<?php
/**
* Admin boot
*
* @author Webcraftic <wordpress.webraftic@gmail.com>
* @copyright Webcraftic 25.05.2017
* @version 1.0
*/
// Exit if accessed directly
if( !defined('ABSPATH') ) {
exit;
}
/**
* Печатает ошибки совместимости с похожими плагинами
*/
add_action('wbcr/factory/admin_notices', function ($notices, $plugin_name) {
if( $plugin_name != WHTM_Plugin::app()->getPluginName() ) {
return $notices;
}
if( is_plugin_active('autoptimize/autoptimize.php') ) {
$notice_text = __('Clearfy: Html minify component is not compatible with the Autoptimize plugin, please do not use them together to avoid conflicts. Please disable the Html minify component', 'html-minify');
if( class_exists('WCL_Plugin') ) {
$component_button = WCL_Plugin::app()->getInstallComponentsButton('internal', 'html_minify');
$notice_text .= ' ' . $component_button->getLink();
}
$notices[] = [
'id' => 'mac_plugin_compatibility',
'type' => 'error',
'classes' => ['wbcr-hide-after-action'],
'dismissible' => false,
'dismiss_expires' => 0,
'text' => '<p>' . $notice_text . '</p>'
];
}
return $notices;
}, 10, 2);
add_filter("wbcr_clearfy_group_options", function ($options) {
$options[] = [
'name' => 'html_optimize',
'title' => __('Optimize HTML Code?', 'html-minify'),
'tags' => ['optimize_performance', 'optimize_html', 'optimize_code', 'hide_my_wp'],
'values' => []
];
$options[] = [
'name' => 'html_keepcomments',
'title' => __('Keep HTML comments?', 'html-minify'),
'tags' => [],
'values' => []
];
return $options;
});
/**
* Adds a new mode to the Quick Setup page
*
* @param array $mods
*
* @return mixed
*/
add_filter("wbcr_clearfy_allow_quick_mods", function ($mods) {
if( !defined('WMAC_PLUGIN_ACTIVE') ) {
$title = __('One click optimize html code', 'html-minify');
} else {
$title = __('One click optimize html code and scripts', 'html-minify');
}
$mod['optimize_code'] = [
'title' => $title,
'icon' => 'dashicons-performance'
];
return $mod + $mods;
});
function wbcr_htm_settings_form_options()
{
$options = [];
$options[] = [
'type' => 'html',
'html' => '<div class="wbcr-factory-page-group-header"><strong>' . __('Minify Html code', 'html-minify') . '</strong><p>' . __('Ever look at the HTML markup of your website and notice how sloppy and amateurish it looks? The Minify HTML options cleans up sloppy looking markup and minifies, which also speeds up download.', 'html-minify') . '</p></div>'
];
// Переключатель
$options[] = [
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'html_optimize',
'title' => __('Optimize HTML Code?', 'html-minify'),
'layout' => ['hint-type' => 'icon', 'hint-icon-color' => 'green'],
'hint' => __('Minify html code.', 'html-minify'),
'default' => false,
];
// Переключатель
$options[] = [
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'html_keepcomments',
'title' => __('Keep HTML comments?', 'html-minify'),
'layout' => ['hint-type' => 'icon', 'hint-icon-color' => 'grey'],
'hint' => __('Enable this if you want HTML comments to remain in the page.', 'html-minify'),
'default' => false
];
return $options;
}
add_filter('wbcr_clr_code_clean_form_options', function ($form) {
if( empty($form) ) {
return $form;
}
$options = wbcr_htm_settings_form_options();
foreach(array_reverse($options) as $option) {
array_unshift($form[0]['items'], $option);
}
return $form;
});

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,99 @@
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* The page Settings.
*
* @since 1.0.0
*/
class WHTM_SettingsPage extends WBCR\Factory_Templates_134\Pages\PageBase {
/**
* {@inheritDoc}
*
* @var string
*/
public $id = "html_minify";
/**
* {@inheritDoc}
*
* @var string
*/
public $page_menu_dashicon = 'dashicons-testimonial';
/**
* {@inheritDoc}
*
* @var string
*/
public $page_parent_page = "performance";
/**
* {@inheritDoc}
*
* @var bool
*/
public $available_for_multisite = true;
/**
* {@inheritDoc}
*
* @since 1.1.0
* @var bool
*/
public $show_right_sidebar_in_options = true;
/**
* WHTM_SettingsPage constructor.
*
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
*
* @param \Wbcr_Factory480_Plugin $plugin
*/
public function __construct( Wbcr_Factory480_Plugin $plugin ) {
// Заголовок страницы
$this->menu_title = __( 'HTML Minify', 'html-minify' );
if ( ! defined( 'LOADING_HTML_MINIFY_AS_ADDON' ) ) {
$this->internal = false;
$this->menu_target = 'options-general.php';
$this->add_link_to_plugin_actions = true;
$this->page_parent_page = null;
}
parent::__construct( $plugin );
}
/**
* {@inheritDoc}
*
* @var string
*/
public function getMenuTitle() {
return defined( 'LOADING_HTML_MINIFY_AS_ADDON' ) ? __( 'HTML Minify', 'html-minify' ) : __( 'General', 'html-minify' );
}
/**
* {@inheritDoc}
*
* @since 1.0.0
* @return mixed[]
*/
public function getPageOptions() {
$options = wbcr_htm_settings_form_options();
$formOptions = [];
$formOptions[] = [
'type' => 'form-group',
'items' => $options,
//'cssClass' => 'postbox'
];
return apply_filters( 'wbcr_htm_settings_form_options', $formOptions );
}
}

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,52 @@
<?php
/**
* Этот файл инициализирует этот плагин, как аддон для плагина Clearfy.
*
* Файл будет подключен только в плагине Clearfy, используя особый вариант загрузки. Это более простое решение
* пришло на смену встроенной системы подключения аддонов в фреймворке.
*
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
* @copyright (c) 2018 Webraftic Ltd
*/
// Exit if accessed directly
if( !defined('ABSPATH') ) {
exit;
}
if( !defined('WHTM_PLUGIN_ACTIVE') ) {
define('WHTM_PLUGIN_VERSION', '1.1.3');
define('WHTM_TEXT_DOMAIN', 'html-minify');
define('WHTM_PLUGIN_ACTIVE', true);
// Этот плагин загружен, как аддон для плагина Clearfy
define('LOADING_HTML_MINIFY_AS_ADDON', true);
if( !defined('WHTM_PLUGIN_DIR') ) {
define('WHTM_PLUGIN_DIR', dirname(__FILE__));
}
if( !defined('WHTM_PLUGIN_BASE') ) {
define('WHTM_PLUGIN_BASE', plugin_basename(__FILE__));
}
if( !defined('WHTM_PLUGIN_URL') ) {
define('WHTM_PLUGIN_URL', plugins_url('', __FILE__));
}
try {
// Global scripts
require_once(WHTM_PLUGIN_DIR . '/includes/3rd-party/class-clearfy-plugin.php');
new WHTM_Plugin();
} catch( Exception $e ) {
$whtml_plugin_error_func = function () use ($e) {
$error = sprintf("The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Webcraftic Html minify', $e->getMessage(), $e->getCode());
echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
};
add_action('admin_notices', $whtml_plugin_error_func);
add_action('network_admin_notices', $whtml_plugin_error_func);
}
}

View File

@@ -0,0 +1,130 @@
<?php
/**
* Plugin Name: HTML Мinify
* Plugin URI: https://webcraftic.com
* Description: Ever look at the HTML markup of your website and notice how sloppy and amateurish it looks? The HTML Мinify options cleans up sloppy looking markup and minifies, which also speeds up download.
* Author: Webcraftic <wordpress.webraftic@gmail.com>
* Version: 1.1.3
* Text Domain: html-minify
* Domain Path: /languages/
* Author URI: https://webcraftic.com
* Framework Version: FACTORY_480_VERSION
*/
/*
* #### CREDITS ####
* This plugin is based on the plugin Autoptimize by the author Frank Goossens, we have finalized this code for our project and our goals.
* Many thanks to Frank Goossens for the quality solution for optimizing scripts in Wordpress.
*
* Public License is a GPLv2 compatible license allowing you to change and use this version of the plugin for free.
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* -----------------------------------------------------------------------------
* CHECK REQUIREMENTS
* Check compatibility with php and wp version of the user's site. As well as checking
* compatibility with other plugins from Webcraftic.
* -----------------------------------------------------------------------------
*/
require_once( dirname( __FILE__ ) . '/libs/factory/core/includes/class-factory-requirements.php' );
// @formatter:off
$whtml_plugin_info = array(
'prefix' => 'wbcr_htm_', // префикс для базы данных и полей формы
'plugin_name' => 'wbcr_html_minify', // имя плагина, как уникальный идентификатор
'plugin_title' => __( 'Webcraftic HTML Minify', 'html-minify' ), // заголовок плагина
// PLUGIN SUPPORT
'support_details' => array(
'url' => 'https://webcraftic.com',
'pages_map' => array(
'support' => 'support', // {site}/support
'docs' => 'docs' // {site}/docs
)
),
// PLUGIN ADVERTS
'render_adverts' => true,
'adverts_settings' => array(
'dashboard_widget' => true, // show dashboard widget (default: false)
'right_sidebar' => true, // show adverts sidebar (default: false)
'notice' => true, // show notice message (default: false)
),
// FRAMEWORK MODULES
'load_factory_modules' => array(
array( 'libs/factory/bootstrap', 'factory_bootstrap_482', 'admin' ),
array( 'libs/factory/forms', 'factory_forms_480', 'admin' ),
array( 'libs/factory/pages', 'factory_pages_480', 'admin' ),
array( 'libs/factory/clearfy', 'factory_templates_134', 'all' ),
array( 'libs/factory/adverts', 'factory_adverts_159', 'admin')
)
);
$whtml_compatibility = new Wbcr_Factory480_Requirements( __FILE__, array_merge( $whtml_plugin_info, array(
'plugin_already_activate' => defined( 'WHTM_PLUGIN_ACTIVE' ),
'required_php_version' => '5.4',
'required_wp_version' => '4.2.0',
'required_clearfy_check_component' => false
) ) );
/**
* If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
* and the user will throw a warning.
*/
if ( ! $whtml_compatibility->check() ) {
return;
}
/**
* -----------------------------------------------------------------------------
* CONSTANTS
* Install frequently used constants and constants for debugging, which will be
* removed after compiling the plugin.
* -----------------------------------------------------------------------------
*/
// This plugin is activated
define( 'WHTM_PLUGIN_ACTIVE', true );
define( 'WHTM_PLUGIN_VERSION', $whtml_compatibility->get_plugin_version() );
define( 'WHTM_PLUGIN_DIR', dirname( __FILE__ ) );
define( 'WHTM_PLUGIN_BASE', plugin_basename( __FILE__ ) );
define( 'WHTM_PLUGIN_URL', plugins_url( '', __FILE__ ) );
/**
* -----------------------------------------------------------------------------
* PLUGIN INIT
* -----------------------------------------------------------------------------
*/
require_once( WHTM_PLUGIN_DIR . '/libs/factory/core/boot.php' );
require_once( WHTM_PLUGIN_DIR . '/includes/class-plugin.php' );
try {
new WHTM_Plugin( __FILE__, array_merge( $whtml_plugin_info, array(
'plugin_version' => WHTM_PLUGIN_VERSION,
'plugin_text_domain' => $whtml_compatibility->get_text_domain(),
) ) );
} catch( Exception $e ) {
// Plugin wasn't initialized due to an error
define( 'WHTM_PLUGIN_THROW_ERROR', true );
$whtml_plugin_error_func = function () use ( $e ) {
$error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Webcraftic Html minify', $e->getMessage(), $e->getCode() );
echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
};
add_action( 'admin_notices', $whtml_plugin_error_func );
add_action( 'network_admin_notices', $whtml_plugin_error_func );
}
// @formatter:on

View File

@@ -0,0 +1,113 @@
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Disable comments
*
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
*
* @copyright (c) 2018 Webraftic Ltd
*/
class WHTM_Plugin {
/**
* @see self::app()
* @var WCL_Plugin
*/
private static $app;
/**
* Конструктор
*
* Применяет конструктор родительского класса и записывает экземпляр текущего класса в свойство $app.
* Подробнее о свойстве $app см. self::app()
*
* @param string $plugin_path
* @param array $data
*
* @throws Exception
*/
public function __construct() {
if ( ! class_exists( 'WCL_Plugin' ) ) {
throw new Exception( 'Plugin Clearfy is not installed!' );
}
self::$app = WCL_Plugin::app();
if ( is_admin() ) {
$this->admin_scripts();
}
add_action( 'plugins_loaded', [ $this, 'plugins_loaded' ] );
// Wordpress 6.7 fix
add_action( 'init', function () {
if ( is_admin() ) {
$this->register_pages();
}
} );
}
/**
* Статический метод для быстрого доступа к интерфейсу плагина.
*
* Позволяет разработчику глобально получить доступ к экземпляру класса плагина в любом месте
* плагина, но при этом разработчик не может вносить изменения в основной класс плагина.
*
* Используется для получения настроек плагина, информации о плагине, для доступа к вспомогательным
* классам.
*
* @return WCL_Plugin
*/
public static function app() {
return self::$app;
}
/**
* Выполнение действий после загрузки плагина
* Подключаем все классы оптимизации и запускаем процесс
*
* @throws \Exception
*/
public function plugins_loaded() {
require_once( WHTM_PLUGIN_DIR . '/includes/classes/class-base.php' );
require_once( WHTM_PLUGIN_DIR . '/includes/classes/class-html.php' );
require_once( WHTM_PLUGIN_DIR . '/includes/classes/class-main.php' );
require_once( WHTM_PLUGIN_DIR . '/includes/classes/ext/php/class-minify-html.php' );
$plugin = new WHTM_PluginMain();
$plugin->start();
}
/**
* Регистрирует классы страниц в плагине
*
* Мы указываем плагину, где найти файлы страниц и какое имя у их класса. Чтобы плагин
* выполнил подключение классов страниц. После регистрации, страницы будут доступные по url
* и в меню боковой панели администратора. Регистрируемые страницы будут связаны с текущим плагином
* все операции выполняемые внутри классов страниц, имеют отношение только текущему плагину.
*
* @throws \Exception
*/
private function register_pages() {
if ( defined( 'WMAC_PLUGIN_ACTIVE' ) ) {
return;
}
$admin_path = WHTM_PLUGIN_DIR . '/admin/pages';
// Пример основной страницы настроек
self::app()->registerPage( 'WHTM_SettingsPage', $admin_path . '/class-pages-settings.php' );
}
/**
* Подключаем функции бекенда
*/
private function admin_scripts() {
require( WHTM_PLUGIN_DIR . '/admin/boot.php' );
}
}

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,114 @@
<?php
/**
* Основной класс плагина
*
* @author Webcraftic <wordpress.webraftic@gmail.com>
* @copyright (c) 19.02.2018, Webcraftic
* @version 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class WHTM_Plugin extends Wbcr_Factory480_Plugin {
/**
* @see self::app()
* @var Wbcr_Factory480_Plugin
*/
private static $app;
/**
* Конструктор
*
* Применяет конструктор родительского класса и записывает экземпляр текущего класса в свойство $app.
* Подробнее о свойстве $app см. self::app()
*
* @param string $plugin_path
* @param array $data
*
* @throws Exception
*/
public function __construct( $plugin_path, $data ) {
parent::__construct( $plugin_path, $data );
self::$app = $this;
if ( is_admin() ) {
$this->admin_scripts();
}
add_action( 'plugins_loaded', [ $this, 'plugins_loaded' ] );
// Wordpress 6.7 fix
add_action( 'init', function () {
if ( is_admin() ) {
$this->register_pages();
}
} );
}
/**
* Статический метод для быстрого доступа к интерфейсу плагина.
*
* Позволяет разработчику глобально получить доступ к экземпляру класса плагина в любом месте
* плагина, но при этом разработчик не может вносить изменения в основной класс плагина.
*
* Используется для получения настроек плагина, информации о плагине, для доступа к вспомогательным
* классам.
*
* @return \Wbcr_Factory480_Plugin|\WCM_Plugin
*/
public static function app() {
return self::$app;
}
/**
* Выполнение действий после загрузки плагина
* Подключаем все классы оптимизации и запускаем процесс
*
* @throws \Exception
*/
public function plugins_loaded() {
require_once( WHTM_PLUGIN_DIR . '/includes/classes/class-base.php' );
require_once( WHTM_PLUGIN_DIR . '/includes/classes/class-html.php' );
require_once( WHTM_PLUGIN_DIR . '/includes/classes/class-main.php' );
require_once( WHTM_PLUGIN_DIR . '/includes/classes/ext/php/class-minify-html.php' );
$plugin = new WHTM_PluginMain();
$plugin->start();
}
/**
* Регистрирует классы страниц в плагине
*
* Мы указываем плагину, где найти файлы страниц и какое имя у их класса. Чтобы плагин
* выполнил подключение классов страниц. После регистрации, страницы будут доступные по url
* и в меню боковой панели администратора. Регистрируемые страницы будут связаны с текущим плагином
* все операции выполняемые внутри классов страниц, имеют отношение только текущему плагину.
*
* @throws \Exception
*/
private function register_pages() {
if ( defined( 'WMAC_PLUGIN_ACTIVE' ) ) {
return;
}
$admin_path = WHTM_PLUGIN_DIR . '/admin/pages';
// Пример основной страницы настроек
self::app()->registerPage( 'WHTM_SettingsPage', $admin_path . '/class-pages-settings.php' );
}
/**
* Подключаем функции бекенда
*/
private function admin_scripts() {
require( WHTM_PLUGIN_DIR . '/admin/boot.php' );
}
}

View File

@@ -0,0 +1,260 @@
<?php
/**
* Base class
* @author Webcraftic <wordpress.webraftic@gmail.com>
* @copyright (c) 2018 Webraftic Ltd
* @version 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class WHTM_PluginBase
*/
abstract class WHTM_PluginBase
{
/**
* Holds content being processed (html, scripts, styles)
*
* @var string
*/
protected $content = '';
/**
* Controls debug logging.
*
* @var bool
*/
public $debug_log = false;
/**
* WHTM_PluginBase constructor.
*
* @param $content
*/
public function __construct( $content )
{
$this->content = $content;
}
/**
* Reads the page and collects tags.
*
* @param array $options Options.
*
* @return bool
*/
abstract public function read( $options );
/**
* Joins and optimizes collected things.
*
* @return bool
*/
abstract public function minify();
/**
* Returns the content
*
* @return string
*/
abstract public function getContent();
/**
* Hides everything between noptimize-comment tags.
*
* @param string $markup Markup to process.
*
* @return string
*/
protected function hideNoptimize( $markup )
{
return $this->replaceContentsWithMarkerIfExists(
'NOPTIMIZE',
'/<!--\s?noptimize\s?-->/',
'#<!--\s?noptimize\s?-->.*?<!--\s?/\s?noptimize\s?-->#is',
$markup
);
}
/**
* Unhide noptimize-tags.
*
* @param string $markup Markup to process.
*
* @return string
*/
protected function restoreNoptimize( $markup )
{
return $this->restoreMarkedContent( 'NOPTIMIZE', $markup );
}
/**
* Hides "iehacks" content.
*
* @param string $markup Markup to process.
*
* @return string
*/
protected function hideIEhacks( $markup )
{
return $this->replaceContentsWithMarkerIfExists(
'IEHACK', // Marker name...
'<!--[if', // Invalid regex, will fallback to search using strpos()...
'#<!--\[if.*?\[endif\]-->#is', // Replacement regex...
$markup
);
}
/**
* Restores "hidden" iehacks content.
*
* @param string $markup Markup to process.
*
* @return string
*/
protected function restoreIEhacks( $markup )
{
return $this->restoreMarkedContent( 'IEHACK', $markup );
}
/**
* "Hides" content within HTML comments using a regex-based replacement
* if HTML comment markers are found.
* `<!--example-->` becomes `%%COMMENTS%%ZXhhbXBsZQ==%%COMMENTS%%`
*
* @param string $markup Markup to process.
*
* @return string
*/
protected function hideComments( $markup )
{
return $this->replaceContentsWithMarkerIfExists(
'COMMENTS',
'<!--',
'#<!--.*?-->#is',
$markup
);
}
/**
* Restores original HTML comment markers inside a string whose HTML
* comments have been "hidden" by using `hideComments()`.
*
* @param string $markup Markup to process.
*
* @return string
*/
protected function restoreComments( $markup )
{
return $this->restoreMarkedContent( 'COMMENTS', $markup );
}
/**
* Creates and returns a `%%`-style named marker which holds
* the base64 encoded `$data`.
* If `$hash` is provided, it's appended to the base64 encoded string
* using `|` as the separator (in order to support building the
* somewhat special/different INJECTLATER marker).
*
* @param string $name Marker name.
* @param string $data Marker data which will be base64-encoded.
* @param string|null $hash Optional.
*
* @return string
*/
public static function buildMarker( $name, $data, $hash = null )
{
// Start the marker, add the data.
$marker = '%%' . $name . WHTM_HASH . '%%' . base64_encode( $data );
// Add the hash if provided.
if ( null !== $hash ) {
$marker .= '|' . $hash;
}
// Close the marker.
$marker .= '%%' . $name . '%%';
return $marker;
}
/**
* Returns true if the string is a valid regex.
*
* @param string $string String, duh.
*
* @return bool
*/
protected function strIsValidRegex( $string )
{
set_error_handler( function() {}, E_WARNING );
$is_regex = ( false !== preg_match( $string, '' ) );
restore_error_handler();
return $is_regex;
}
/**
* Searches for `$search` in `$content` (using either `preg_match()`
* or `strpos()`, depending on whether `$search` is a valid regex pattern or not).
* If something is found, it replaces `$content` using `$re_replace_pattern`,
* effectively creating our named markers (`%%{$marker}%%`.
* These are then at some point replaced back to their actual/original/modified
* contents using `WHTM_PluginBase::restoreMarkedContent()`.
*
* @param string $marker Marker name (without percent characters).
* @param string $search A string or full blown regex pattern to search for in $content. Uses `strpos()` or `preg_match()`.
* @param string $re_replace_pattern Regex pattern to use when replacing contents.
* @param string $content Content to work on.
*
* @return string
*/
protected function replaceContentsWithMarkerIfExists( $marker, $search, $re_replace_pattern, $content )
{
$is_regex = $this->strIsValidRegex( $search );
if ( $is_regex ) {
$found = preg_match( $search, $content );
} else {
$found = ( false !== strpos( $content, $search ) );
}
if ( $found ) {
$content = preg_replace_callback(
$re_replace_pattern,
function( $matches ) use ( $marker ) {
return WHTM_PluginBase::buildMarker( $marker, $matches[0] );
},
$content
);
}
return $content;
}
/**
* Complements `WHTM_PluginBase::replaceContentsWithMarkerIfExists()`.
*
* @param string $marker Marker.
* @param string $content Markup.
*
* @return string
*/
protected function restoreMarkedContent( $marker, $content )
{
if ( false !== strpos( $content, $marker ) ) {
$content = preg_replace_callback(
'#%%' . $marker . WHTM_HASH . '%%(.*?)%%' . $marker . '%%#is',
function ( $matches ) {
return base64_decode( $matches[1] );
},
$content
);
}
return $content;
}
}

View File

@@ -0,0 +1,126 @@
<?php
/**
* Operations with HTML
*
* @author Webcraftic <wordpress.webraftic@gmail.com>
* @copyright (c) 2018 Webraftic Ltd
* @version 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class WHTM_PluginHTML
*/
class WHTM_PluginHTML extends WHTM_PluginBase
{
/**
* Force xhtml.
*
* @var bool
*/
private $forcexhtml = false;
/**
* Whether HTML comments are kept.
*
* @var bool
*/
private $keepcomments = false;
/**
* Things to exclude from being minifed.
*
* @var array
*/
private $exclude = array(
'<!-- ngg_resource_manager_marker -->',
'<!--noindex-->',
'<!--/noindex-->',
);
public function read( $options )
{
// Remove the HTML comments?
$this->keepcomments = (bool) $options['keepcomments'];
// Filter to force xhtml.
$this->forcexhtml = (bool) apply_filters( 'whm_filter_html_forcexhtml', false );
// Filterable strings to be excluded from HTML minification.
$exclude = apply_filters( 'whm_filter_html_exclude', '' );
if ( '' !== $exclude ) {
$exclude_arr = array_filter( array_map( 'trim', explode( ',', $exclude ) ) );
$this->exclude = array_merge( $exclude_arr, $this->exclude );
}
return true;
}
/**
* Minifies HTML.
*
* @return bool
*/
public function minify()
{
$noptimize = apply_filters( 'whm_filter_html_noptimize', false, $this->content );
if ( $noptimize ) {
return false;
}
// Wrap the to-be-excluded strings in no optimize tags.
foreach ( $this->exclude as $str ) {
if ( false !== strpos( $this->content, $str ) ) {
$replacement = '<!--noptimize-->' . $str . '<!--/noptimize-->';
$this->content = str_replace( $str, $replacement, $this->content );
}
}
// No optimize.
$this->content = $this->hideNoptimize( $this->content );
// Preparing options for WHTM_Minify_HTML.
$options = array( 'keepComments' => $this->keepcomments );
if ( $this->forcexhtml ) {
$options['xhtml'] = true;
}
$tmp_content = WHTM_Minify_HTML::minify( $this->content, $options );
if ( ! empty( $tmp_content ) ) {
$this->content = $tmp_content;
unset( $tmp_content );
}
// Restore no optimize.
$this->content = $this->restoreNoptimize( $this->content );
// Remove the noptimize-wrapper from around the excluded strings.
foreach ( $this->exclude as $str ) {
$replacement = '<!--noptimize-->' . $str . '<!--/noptimize-->';
if ( false !== strpos( $this->content, $replacement ) ) {
$this->content = str_replace( $replacement, $str, $this->content );
}
}
// Revslider data attribs somehow suffer from HTML optimization, this fixes that!
if ( class_exists( 'RevSlider' ) && apply_filters( 'whm_filter_html_dataattrib_cleanup', false ) ) {
$this->content = preg_replace( '#\n(data-.*$)\n#Um', ' $1 ', $this->content );
$this->content = preg_replace( '#<[^>]*(=\"[^"\'<>\s]*\")(\w)#', '$1 $2', $this->content );
}
return true;
}
/**
* Returns the HTML markup.
*
* @return string
*/
public function getContent()
{
return $this->content;
}
}

View File

@@ -0,0 +1,296 @@
<?php
/**
* Main class
* @author Webcraftic <wordpress.webraftic@gmail.com>
* @copyright (c) 2018 Webraftic Ltd
* @version 1.0
*/
if( !defined('ABSPATH') ) {
exit;
}
/**
* Class WHTM_PluginMain
*/
class WHTM_PluginMain {
const INIT_EARLIER_PRIORITY = -1;
const DEFAULT_HOOK_PRIORITY = 2;
/**
* Constructor.
*/
public function __construct()
{
}
/**
* Start processing
*/
public function start()
{
$this->setup();
$this->hook();
$this->run();
}
/**
* Initialization hooks
*/
public function hook()
{
if( WHTM_Plugin::app()->getPopulateOption('html_optimize') ) {
add_action('wp_loaded', array($this, 'removeCacheMessage'));
}
}
/**
* Setting the parameters
*/
public function setup()
{
// These can be overridden by specifying them in wp-config.php or such.
if( !defined('WHTM_WP_CONTENT_NAME') ) {
define('WHTM_WP_CONTENT_NAME', '/' . wp_basename(WP_CONTENT_DIR));
}
define('WHTM_ROOT_DIR', substr(WP_CONTENT_DIR, 0, strlen(WP_CONTENT_DIR) - strlen(WHTM_WP_CONTENT_NAME)));
if( !defined('WHTM_WP_SITE_URL') ) {
// domain_mapping_siteurl функция из плагина, который позволяет задавать свой домен для подсайта
if( function_exists('domain_mapping_siteurl') ) {
define('WHTM_WP_SITE_URL', domain_mapping_siteurl(get_current_blog_id()));
} else {
define('WHTM_WP_SITE_URL', site_url());
}
}
if( !defined('WHTM_WP_CONTENT_URL') ) {
// get_original_url функция из плагина, который позволяет задавать свой домен для подсайта
if( function_exists('get_original_url') ) {
define('WHTM_WP_CONTENT_URL', str_replace(get_original_url(WHTM_WP_SITE_URL), WHTM_WP_SITE_URL, content_url()));
} else {
define('WHTM_WP_CONTENT_URL', content_url());
}
}
if( !defined('WHTM_WP_ROOT_URL') ) {
define('WHTM_WP_ROOT_URL', str_replace(WHTM_WP_CONTENT_NAME, '', WHTM_WP_CONTENT_URL));
}
if( !defined('WHTM_HASH') ) {
define('WHTM_HASH', wp_hash(time()));
}
}
/**
* Run
*/
public function run()
{
if( WHTM_Plugin::app()->getPopulateOption('html_optimize') ) {
// Hook into WordPress frontend.
if( defined('WHTM_INIT_EARLIER') ) {
add_action('init', array($this, 'startBuffering'), self::INIT_EARLIER_PRIORITY);
} else {
if( !defined('WHTM_HOOK_INTO') ) {
define('WHTM_HOOK_INTO', 'template_redirect');
}
add_action(constant('WHTM_HOOK_INTO'), array($this, 'startBuffering'), self::DEFAULT_HOOK_PRIORITY);
}
}
}
/**
* Setup output buffering if needed.
*
* @return void
*/
public function startBuffering()
{
if( $this->shouldBuffer() ) {
if( apply_filters('whm_filter_obkiller', false) ) {
while( ob_get_level() > 0 ) {
ob_end_clean();
}
}
// Now, start the real thing!
ob_start(array($this, 'endBuffering'));
}
}
/**
* Returns true if all the conditions to start output buffering are satisfied.
*
* @param bool $doing_tests Allows overriding the optimization of only
* deciding once per request (for use in tests).
* @return bool
*/
public function shouldBuffer($doing_tests = false)
{
static $do_buffering = null;
// Only check once in case we're called multiple times by others but
// still allows multiple calls when doing tests.
if( null === $do_buffering || $doing_tests ) {
$whm_noptimize = false;
// Checking for DONOTMINIFY constant as used by e.g. WooCommerce POS.
if( defined('DONOTMINIFY') && (constant('DONOTMINIFY') === true || constant('DONOTMINIFY') === 'true') ) {
$whm_noptimize = true;
}
// Skip checking query strings if they're disabled.
if( apply_filters('whm_filter_honor_qs_noptimize', true) ) {
// Check for `whm_noptimize` (and other) keys in the query string
// to get non-optimized page for debugging.
$keys = array(
'whm_noptimize',
'whm_noptirocket',
);
foreach($keys as $key) {
if( array_key_exists($key, $_GET) && '1' === $_GET[$key] ) {
$whm_noptimize = true;
break;
}
}
}
// Allows blocking of auto optimization on your own terms regardless of above decisions.
$whm_noptimize = (bool)apply_filters('whm_filter_noptimize', $whm_noptimize);
// Check for site being previewed in the Customizer (available since WP 4.0).
$is_customize_preview = false;
if( function_exists('is_customize_preview') && is_customize_preview() ) {
$is_customize_preview = is_customize_preview();
}
/**
* We only buffer the frontend requests (and then only if not a feed
* and not turned off explicitly and not when being previewed in Customizer)!
* NOTE: Tests throw a notice here due to is_feed() being called
* while the main query hasn't been ran yet. Thats why we use
* WHTM_INIT_EARLIER in tests.
*/
$do_buffering = (!is_admin() && !is_feed() && !$whm_noptimize && !$is_customize_preview);
}
return $do_buffering;
}
/**
* Returns true if given markup is considered valid/processable/optimizable.
*
* @param string $content Markup.
*
* @return bool
*/
public function isValidBuffer($content)
{
// Defaults to true.
$valid = true;
$has_no_html_tag = (false === stripos($content, '<html'));
$has_xsl_stylesheet = (false !== stripos($content, '<xsl:stylesheet'));
$has_html5_doctype = (preg_match('/^<!DOCTYPE.+html>/i', $content) > 0);
if( $has_no_html_tag ) {
// Can't be valid amp markup without an html tag preceding it.
$is_amp_markup = false;
} else {
$is_amp_markup = self::isAmpMarkup($content);
}
// If it's not html, or if it's amp or contains xsl stylesheets we don't touch it.
if( $has_no_html_tag && !$has_html5_doctype || $is_amp_markup || $has_xsl_stylesheet ) {
$valid = false;
}
return $valid;
}
/**
* Returns true if given $content is considered to be AMP markup.
* This is far from actual validation against AMP spec, but it'll do for now.
*
* @param string $content Markup to check.
*
* @return bool
*/
public static function isAmpMarkup($content)
{
$is_amp_markup = preg_match('/<html[^>]*(?:amp|⚡)/i', $content);
return (bool)$is_amp_markup;
}
/**
* Processes/optimizes the output-buffered content and returns it.
* If the content is not processable, it is returned unmodified.
*
* @param string $content Buffered content.
*
* @return string
*/
public function endBuffering($content)
{
// Bail early without modifying anything if we can't handle the content.
if( !$this->isValidBuffer($content) ) {
return $content;
}
// Determine what needs to be ran.
$classes = array();
if( WHTM_Plugin::app()->getPopulateOption('html_optimize') ) {
$classes[] = 'WHTM_PluginHTML';
}
$classoptions = array(
'WHTM_PluginHTML' => array(
'keepcomments' => WHTM_Plugin::app()->getPopulateOption('html_keepcomments'),
),
);
$content = apply_filters('whm_filter_html_before_minify', $content);
// Run the classes!
foreach($classes as $name) {
$instance = new $name($content);
if( $instance->read($classoptions[$name]) ) {
$instance->minify();
$content = $instance->getContent();
}
unset($instance);
}
$content = apply_filters('whm_html_after_minify', $content);
return $content;
}
/**
* Remove Cache Status Messages
*/
public function removeCacheMessage()
{
// For WP Super Cache
if( file_exists(WP_CONTENT_DIR . '/wp-cache-config.php') && function_exists('prune_super_cache') ) {
global $wp_super_cache_comments;
$wp_super_cache_comments = 0;
}
// For WP Fastest Cache
if( class_exists('WpFastestCache') ) {
define('WPFC_REMOVE_FOOTER_COMMENT', true);
}
// For WP Total Cache
if( function_exists('w3tc_pgcache_flush') ) {
add_filter('w3tc_footer_comment', '__return_empty_array');
}
}
}

View File

@@ -0,0 +1,270 @@
<?php
/**
* Class WHTM_Minify_HTML
* @package Minify
*/
/**
* Compress HTML
*
* This is a heavy regex-based removal of whitespace, unnecessary comments and
* tokens. IE conditional comments are preserved. There are also options to have
* STYLE and SCRIPT blocks compressed by callback functions.
*
* A test suite is available.
*
* @package Minify
* @author Stephen Clay <steve@mrclay.org>
*/
class WHTM_Minify_HTML {
protected $_html;
/**
* "Minify" an HTML page
*
* @param string $html
*
* @param array $options
*
* 'cssMinifier' : (optional) callback function to process content of STYLE
* elements.
*
* 'jsMinifier' : (optional) callback function to process content of SCRIPT
* elements. Note: the type attribute is ignored.
*
* 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
* unset, minify will sniff for an XHTML doctype.
*
* 'keepComments' : (optional boolean) should the HTML comments be kept
* in the HTML Code?
*
* @return string
*/
public static function minify($html, $options = array()) {
$min = new WHTM_Minify_HTML($html, $options);
return $min->process();
}
/**
* Create a minifier object
*
* @param string $html
*
* @param array $options
*
* 'cssMinifier' : (optional) callback function to process content of STYLE
* elements.
*
* 'jsMinifier' : (optional) callback function to process content of SCRIPT
* elements. Note: the type attribute is ignored.
*
* 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
* unset, minify will sniff for an XHTML doctype.
*
* 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
* unset, minify will sniff for an XHTML doctype.
*/
public function __construct($html, $options = array())
{
$this->_html = str_replace("\r\n", "\n", trim($html));
if (isset($options['xhtml'])) {
$this->_isXhtml = (bool)$options['xhtml'];
}
if (isset($options['cssMinifier'])) {
$this->_cssMinifier = $options['cssMinifier'];
}
if (isset($options['jsMinifier'])) {
$this->_jsMinifier = $options['jsMinifier'];
}
if (isset($options['keepComments'])) {
$this->_keepComments = $options['keepComments'];
}
}
/**
* Minify the markeup given in the constructor
*
* @return string
*/
public function process()
{
if ($this->_isXhtml === null) {
$this->_isXhtml = (false !== strpos($this->_html, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML'));
}
$this->_replacementHash = 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']);
$this->_placeholders = array();
// replace SCRIPTs (and minify) with placeholders
$this->_html = preg_replace_callback(
'/(\\s*)(<script\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i'
,array($this, '_removeScriptCB')
,$this->_html);
// replace STYLEs (and minify) with placeholders
$this->_html = preg_replace_callback(
'/\\s*(<style\\b[^>]*?>)([\\s\\S]*?)<\\/style>\\s*/i'
,array($this, '_removeStyleCB')
,$this->_html);
// remove HTML comments (not containing IE conditional comments).
if ($this->_keepComments == false) {
$this->_html = preg_replace_callback(
'/<!--([\\s\\S]*?)-->/'
,array($this, '_commentCB')
,$this->_html);
}
// replace PREs with placeholders
$this->_html = preg_replace_callback('/\\s*(<pre\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i'
,array($this, '_removePreCB')
,$this->_html);
// replace TEXTAREAs with placeholders
$this->_html = preg_replace_callback(
'/\\s*(<textarea\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i'
,array($this, '_removeTextareaCB')
,$this->_html);
// replace data: URIs with placeholders
$this->_html = preg_replace_callback(
'/(=("|\')data:.*\\2)/Ui'
,array($this, '_removeDataURICB')
,$this->_html);
// trim each line.
// replace by space instead of '' to avoid newline after opening tag getting zapped
$this->_html = preg_replace('/^\s+|\s+$/m', ' ', $this->_html);
// remove ws around block/undisplayed elements
$this->_html = preg_replace('/\\s+(<\\/?(?:area|article|aside|base(?:font)?|blockquote|body'
.'|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form'
.'|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav'
.'|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)'
.'|ul|video)\\b[^>]*>)/i', '$1', $this->_html);
// remove ws outside of all elements
$this->_html = preg_replace_callback(
'/>([^<]+)</'
,array($this, '_outsideTagCB')
,$this->_html);
// use newlines before 1st attribute in open tags (to limit line lengths)
//$this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $this->_html);
// fill placeholders
$this->_html = str_replace(
array_keys($this->_placeholders)
,array_values($this->_placeholders)
,$this->_html
);
return $this->_html;
}
protected function _commentCB($m)
{
return (0 === strpos($m[1], '[') || false !== strpos($m[1], '<!['))
? $m[0]
: '';
}
protected function _reservePlace($content)
{
$placeholder = '%' . $this->_replacementHash . count($this->_placeholders) . '%';
$this->_placeholders[$placeholder] = $content;
return $placeholder;
}
protected $_isXhtml = null;
protected $_replacementHash = null;
protected $_placeholders = array();
protected $_cssMinifier = null;
protected $_jsMinifier = null;
protected $_keepComments = false;
protected function _outsideTagCB($m)
{
return '>' . preg_replace('/^\\s+|\\s+$/', ' ', $m[1]) . '<';
}
protected function _removePreCB($m)
{
return $this->_reservePlace($m[1]);
}
protected function _removeTextareaCB($m)
{
return $this->_reservePlace($m[1]);
}
protected function _removeDataURICB($m)
{
return $this->_reservePlace($m[1]);
}
protected function _removeStyleCB($m)
{
$openStyle = $m[1];
$css = $m[2];
// remove HTML comments
$css = preg_replace('/(?:^\\s*<!--|-->\\s*$)/', '', $css);
// remove CDATA section markers
$css = $this->_removeCdata($css);
// minify
$minifier = $this->_cssMinifier
? $this->_cssMinifier
: 'trim';
$css = call_user_func($minifier, $css);
return $this->_reservePlace($this->_needsCdata($css)
? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>"
: "{$openStyle}{$css}</style>"
);
}
protected function _removeScriptCB($m)
{
$openScript = $m[2];
$js = $m[3];
// whitespace surrounding? preserve at least one space
$ws1 = ($m[1] === '') ? '' : ' ';
$ws2 = ($m[4] === '') ? '' : ' ';
if ($this->_keepComments == false) {
// remove HTML comments (and ending "//" if present)
$js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
// remove CDATA section markers
$js = $this->_removeCdata($js);
}
// minify
$minifier = $this->_jsMinifier
? $this->_jsMinifier
: 'trim';
$js = call_user_func($minifier, $js);
return $this->_reservePlace($this->_needsCdata($js)
? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
: "{$ws1}{$openScript}{$js}</script>{$ws2}"
);
}
protected function _removeCdata($str)
{
return (false !== strpos($str, '<![CDATA['))
? str_replace(array('/* <![CDATA[ */','/* ]]> */','/*<![CDATA[*/','/*]]>*/','<![CDATA[', ']]>'), '', $str)
: $str;
}
protected function _needsCdata($str)
{
return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str));
}
}

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,83 @@
# Translation of Plugins - Clearfy in Spanish (Spain)
# This file is distributed under the same license as the Plugins - Clearfy WordPress optimization plugin and disable ultimate tweaker - Development (trunk) package.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2019-04-28 06:28+0300\n"
"PO-Revision-Date: 2019-04-28 06:28+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Poedit 2.1.1\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Poedit 2.1.1\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: libs\n"
"X-Poedit-SearchPathExcluded-1: components\n"
"X-Poedit-SearchPathExcluded-2: cache\n"
#: admin/boot.php:23
msgid ""
"Clearfy: Html minify component is not compatible with the Autoptimize "
"plugin, please do not use them together to avoid conflicts. Please disable "
"the Html minify component"
msgstr ""
"Clearfy: el componente html minify no es compatible con el plugin "
"( Autoptimize ), no los use juntos para evitar conflictos. Por favor "
"deshabilite el componente html minify"
#: admin/boot.php:46 admin/boot.php:96
msgid "Optimize HTML Code?"
msgstr "¿Optimizar código HTML?"
#: admin/boot.php:52 admin/boot.php:106
msgid "Keep HTML comments?"
msgstr "¿Mantener los comentarios HTML?"
#: admin/boot.php:69
msgid "One click optimize html code"
msgstr "Optimizar html con un Click"
#: admin/boot.php:71
msgid "One click optimize html code and scripts"
msgstr "Optimizar html y scripts con un Click"
#: admin/boot.php:88
msgid "HTML Options"
msgstr "Opciones HTML"
#: admin/boot.php:88
msgid ""
"Ever look at the HTML markup of your website and notice how sloppy and "
"amateurish it looks? The Minify HTML options cleans up sloppy looking markup "
"and minifies, which also speeds up download."
msgstr ""
"¿Alguna vez has mirado el código HTML de tu sitio web y has notado lo "
"descuidado y extraño que se ve? Las opciones Minify HTML solventan ese "
"inconveniente y minimizan, acelerando la carga de su Web."
#: admin/boot.php:108
msgid "Enable this if you want HTML comments to remain in the page."
msgstr ""
"Habilita esto si quieres que los comentarios HTML permanezcan en la página."
#: admin/pages/settings.php:40 admin/pages/settings.php:63
msgid "HTML Minify"
msgstr "Minificar HTML"
#: admin/pages/settings.php:64
msgid "General"
msgstr "General"
#: html-minify.php:102
msgid "Webcraftic HTML Minify"
msgstr "Webcraftic HTML Minify"

View File

@@ -0,0 +1,417 @@
msgid ""
msgstr ""
"Project-Id-Version: clearfy\n"
"POT-Creation-Date: 2018-08-19 03:46+0300\n"
"PO-Revision-Date: 2018-08-19 03:48+0300\n"
"Last-Translator: alex.kovalevv@gmail.com <alex.kovalevv@gmail.com>\n"
"Language-Team: Alex Kovalev <alex.kovalevv@gmail.com>\n"
"Language: ru_RU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.1.1\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: libs\n"
#: admin/boot.php:23
msgid ""
"Clearfy: Html minify component is not compatible with the Autoptimize "
"plugin, please do not use them together to avoid conflicts. Please disable "
"the Html minify component"
msgstr ""
"Clearfy: Компонент HTML сжатие не совместим с плагином Autoptimize, "
"пожалуйста, не используйте их вместе, чтобы избежать конфликтов. Отключите "
"компонент HTML сжатие"
#: admin/boot.php:46 admin/pages/settings.php:101
msgid "Optimize HTML Code?"
msgstr "Оптимизировать HTML код?"
#: admin/boot.php:52 admin/pages/settings.php:111
msgid "Keep HTML comments?"
msgstr "Оставлять HTML комментарии?"
#: admin/boot.php:69
msgid "One click optimize html code"
msgstr "Оптимизировать html код одним нажатием"
#: admin/boot.php:71
msgid "One click optimize html code and scripts"
msgstr "Оптимизировать html код и скрипты одним нажатием"
#: admin/pages/settings.php:35 admin/pages/settings.php:58
msgid "HTML Minify"
msgstr "HTML сжатие"
#: admin/pages/settings.php:59
msgid "General"
msgstr "Основные"
#: admin/pages/settings.php:93
msgid "HTML Options"
msgstr "Настройки HTML сжатия"
#: admin/pages/settings.php:93
msgid ""
"Ever look at the HTML markup of your website and notice how sloppy and "
"amateurish it looks? The Minify HTML options cleans up sloppy looking markup "
"and minifies, which also speeds up download."
msgstr ""
"Вы когда-нибудь видели HTML разметку на своем веб-сайте, замечали насколько "
"она неаккуратна и раздута? Настройки HTML сжатия позволят грамотно "
"установить правила формирования html разметки, а также регулировать вес "
"ваших страниц."
#: admin/pages/settings.php:113
msgid "Enable this if you want HTML comments to remain in the page."
msgstr ""
"Включите эту опцию, если хотите, чтобы при сжатии страницы, не удалялясь "
"Html комментарии."
#: html-minify.php:34
msgid ""
"The job of the component \"Html minify\" component has been suspended! You "
"are using the old version of PHP. Please update the PHP version to 5.4 or "
"later to continue to use this component!"
msgstr ""
"Работа компонента «Скрыть мой wp» была приостановлена! Вы используете старую "
"версию PHP. Обновите версию PHP до версии 5.4 или новее, чтобы продолжить "
"использование этого компонента!"
#: html-minify.php:52
msgid ""
"We found that you have the \"Clearfy - wordpress optimization plugin\" "
"plugin installed, this plugin already has Html minify functions, so you can "
"deactivate plugin \"Html minify\"!"
msgstr ""
"Мы обнаружили, что у вас установлен плагин «Clearfy - wordpress optimization "
"plugin», этот плагин уже имеет функции Html minify, поэтому вы можете "
"отключить плагин «Html minify»!"
#: html-minify.php:129
msgid "Webcraftic HTML Minify"
msgstr "Webcraftic HTML сжатие"
#~ msgid "Comments are closed."
#~ msgstr "Комментарии Закрыты."
#~ msgid ""
#~ "Note: The <em>%s</em> plugin is currently active, and comments are "
#~ "completely disabled on: %s. Many of the settings below will not be "
#~ "applicable for those post types."
#~ msgstr ""
#~ "Примечание. Плагин <em>%s</em> в настоящий момент активен, и комментарии "
#~ "полностью отключены: %s. Многие из приведенных ниже настроек не будут "
#~ "применяться для этих типов сообщений."
#~ msgid "Disable comments on the entire site"
#~ msgstr "Отключить комментарии на всем сайте"
#~ msgid "Select post types"
#~ msgstr "Выбрать тип записи"
#~ msgid "Replace external links in comments on the JavaScript code"
#~ msgstr "Заменить внешние ссылки в комментариях на JavaScript код"
#~ msgid "Replace external links from comment authors on the JavaScript code"
#~ msgstr "Заменить внешние ссылки от авторов комментариев на код JavaScript"
#~ msgid "Disable X-Pingback"
#~ msgstr "Убрать ссылку на X-Pingback и возможность спамить pingback-ами"
#~ msgid "Remove field \"site\" in comment form"
#~ msgstr "Удаляет поле \"Сайт\" в форме комментариев"
#~ msgid "One click disable all comments"
#~ msgstr "Отключить все комментарии в один клик"
#~ msgid "Get ultimate plugin free"
#~ msgstr "Получите полную версию плагина бесплатно"
#~ msgid "Disable comments"
#~ msgstr "Отключить комментарии"
#~ msgid "Comments"
#~ msgstr "Комментарии"
#~ msgid "Global disabling of comments"
#~ msgstr "Глобальное отключение комментариев"
#~ msgid ""
#~ "What is the difference between these and native WordPress functions? "
#~ "WordPress disables comments only for new posts! Using the functions "
#~ "below, you can disable comments globally, even for old posts, and you can "
#~ "choose which post types comments to disable. The plugin also disables the "
#~ "comment functionality itself, which creates a certain load on the site."
#~ msgstr ""
#~ "Чем отличается эти функции от нативных функций Wordpress? Wordpress "
#~ "отключает комментарии только для новых записей! С помощью функций ниже, "
#~ "вы можете отключить комментарии глобально, даже для старых записей, "
#~ "причем вы можете выбрать для каких типов записей нужно отключить "
#~ "комментарии. Плагин также отключает сам функционал комментариев, который "
#~ "создает определенную нагрузку на сайт."
#~ msgid "Not disable"
#~ msgstr "Не отключать"
#~ msgid "Everywhere"
#~ msgstr "Повсюду"
#~ msgid ""
#~ "You can delete all comments in the database by clicking on this link (<a "
#~ "href=\"%s\">cleaning comments in database</a>)."
#~ msgstr ""
#~ "Вы можете удалить все комментарии в базе данных, нажав на эту ссылку ( <a "
#~ "href=\"%s\">очистка комментариев в базе данных</a> )."
#~ msgid "On certain post types"
#~ msgstr "Только выбранные типы записей"
#~ msgid ""
#~ "You can delete all comments for the selected post types. Select the post "
#~ "types below and save the settings. After that, click the link (<a href="
#~ "\"%s\">delete all comments for the selected post types in database</a>)."
#~ msgstr ""
#~ "Вы можете удалить все комментарии для выбранных типов записей. Выберите "
#~ "типы записей ниже и сохраните настройки. После этого нажмите ссылку ( <a "
#~ "href=\"%s\">удалите все комментарии для выбранных типов записей в базе "
#~ "данных</a> )."
#~ msgid ""
#~ "Everywhere - Warning: This option is global and will affect your entire "
#~ "site. Use it only if you want to disable comments everywhere. A complete "
#~ "description of what this option does is available here"
#~ msgstr ""
#~ "Повсюду - предупреждение: этот параметр является глобальным и повлияет на "
#~ "весь ваш сайт. Используйте его только в том случае, если вы хотите "
#~ "отключить комментарии повсюду. "
#~ msgid ""
#~ "On certain post types - Disabling comments will also disable trackbacks "
#~ "and pingbacks. All comment-related fields will also be hidden from the "
#~ "edit/quick-edit screens of the affected posts. These settings cannot be "
#~ "overridden for individual posts."
#~ msgstr ""
#~ "В некоторых типах сообщений - отключение комментариев также отключает "
#~ "трекбэки и pingback. Все поля, связанные с комментариями, также будут "
#~ "скрыты от экранов редактирования / быстрого редактирования затронутых "
#~ "сообщений. Эти настройки нельзя переопределять для отдельных сообщений."
#~ msgid "Select the post types for which comments will be disabled"
#~ msgstr "Выберите типы записей, для которых комментарии будут отключены."
#~ msgid "General settings for comments"
#~ msgstr "Общие настройки комментариев"
#~ msgid ""
#~ "These settings will help you improve SEO and reduce the amount of spam."
#~ msgstr ""
#~ "Эти настройки помогут вам улучшить SEO и уменьшить количество спама."
#~ msgid ""
#~ "Tired of spam in the comments? Do visitors leave \"blank\" comments for "
#~ "the sake of a link to their site?"
#~ msgstr ""
#~ "Надоел спам в комментариях? Посетители оставляют «пустые» комментарии "
#~ "ради ссылки на свой сайт?"
#~ msgid "Removes the \"Site\" field from the comment form."
#~ msgstr "Убирает поле «Сайт» из формы комментирования."
#~ msgid ""
#~ "Works with the standard comment form, if the form is manually written in "
#~ "your theme-it probably will not work!"
#~ msgstr ""
#~ "Работает со стандартной формой комментирования, если в Вашей теме форма "
#~ "прописана вручную - скорей всего не сработает!"
#~ msgid ""
#~ "Superfluous external links from comments, which can be typed from a dozen "
#~ "and more for one article, do not bring anything good for promotion."
#~ msgstr ""
#~ "Внешние ссылки в комментариях, которых может быть десятки или больше на "
#~ "одной странице, могут ухудшить продвижение вашего сайта."
#~ msgid "Replaces the links of this kind of %s, on links of this kind %s"
#~ msgstr ""
#~ "Заменяет ссылки %s, на span тег и устанавливает переход с помощью "
#~ "JavaScript %s"
#~ msgid ""
#~ "Up to 90 percent of comments in the blog can be left for the sake of an "
#~ "external link. Even nofollow from page weight loss here does not help."
#~ msgstr ""
#~ "До 90 процентов комментариев в блоге оставляют ради внешней ссылки. Не "
#~ "поможет даже nofollow от потери веса страницы."
#~ msgid ""
#~ "Replaces the links of the authors of comments on the JavaScript code, it "
#~ "is impossible to distinguish it from usual links."
#~ msgstr ""
#~ "Заменяет ссылки авторов комментариев на JavaScript код, его невозможно "
#~ "отличить от обычной ссылки."
#~ msgid "In some Wordpress topics this may not work."
#~ msgstr "В некоторых темах Wordpress это может не сработать."
#~ msgid "Disable XML-RPC"
#~ msgstr "Отключить XML-RPC"
#~ msgid ""
#~ "A pingback is basically an automated comment that gets created when "
#~ "another blog links to you. A self-pingback is created when you link to an "
#~ "article within your own blog. Pingbacks are essentially nothing more than "
#~ "spam and simply waste resources."
#~ msgstr ""
#~ "Pingback по-существу автоматизированных комментарий, который создается, "
#~ "когда другой блог ссылается на вас. Self-pingback создается, когда вы "
#~ "оставили ссылку на статью в своем блоге. Pingbacks по существу являются "
#~ "не более чем спам и пустая трата ресурсов вашего сайта."
#~ msgid "Removes the server responses a reference to the xmlrpc file."
#~ msgstr "Удаляет ссылку на xmlrpc-файл и ответ сервера."
#~ msgid "Comments cleaner"
#~ msgstr "Очистка комментариев"
#~ msgid "All comments have been deleted."
#~ msgstr "Все комментарии были удалены."
#~ msgid ""
#~ "An error occurred while trying to delete comments. Internal error "
#~ "occured. Please try again later."
#~ msgstr ""
#~ "При попытке удалить комментарии произошла ошибка. Пожалуйста, повторите "
#~ "попытку позже."
#~ msgid ""
#~ "Are you sure you want to delete comments from the database without "
#~ "restoring?"
#~ msgstr ""
#~ "Вы уверены, что вы хотите удалить комментарии из базы данных без "
#~ "восстановления?"
#~ msgid "Comments clearing tools"
#~ msgstr "Комментарии очищающие инструменты"
#~ msgid ""
#~ "These functions can be useful for global disabling comments or bulk "
#~ "cleaning spam comments."
#~ msgstr ""
#~ "Эти функции могут быть полезны для глобальных отключений комментариев или "
#~ "массовой очистки спама комментариев."
#~ msgid "Remove all comments"
#~ msgstr "Удалить все комментарии"
#~ msgid "You can delete all comments in your database with one click."
#~ msgstr ""
#~ "Вы можете удалить все комментарии в базе данных с одним щелчком мыши."
#~ msgid "Choose post types"
#~ msgstr "Выберите типы записей"
#~ msgid "Select all"
#~ msgstr "Выбрать все"
#~ msgid "Delete Woocommerce order notices? (%d)"
#~ msgstr "Удалять заметки от заказов Woocommerce? (%d)"
#~ msgid "Delete (%d)"
#~ msgstr "Удалить (%d)"
#~ msgid "Remove spam comments"
#~ msgstr "Удалить спам комментарии"
#~ msgid "You can remove only spam comments from the database with one click."
#~ msgstr ""
#~ "Вы можете одним нажатием удалить только спам комментарии из базы данных."
#~ msgid "Remove unapproved comments"
#~ msgstr "Удалить неподтвержденные комментарии"
#~ msgid ""
#~ "You can remove only unapproved comments from the database with one click."
#~ msgstr ""
#~ "Вы можете одним нажатием удалить только не подтвержденные комментарии из "
#~ "базы данных."
#~ msgid "Remove trashed comments"
#~ msgstr "Удалить комментарии из корзины"
#~ msgid ""
#~ "You can remove only trashed comments from the database with one click."
#~ msgstr "Вы можете одним нажатием удалить только комментарии из корзины."
#~ msgid ""
#~ "We found that you have the \"Clearfy - disable unused features\" plugin "
#~ "installed, this plugin already has disable comments functions, so you can "
#~ "deactivate plugin \"Disable comments\"!"
#~ msgstr ""
#~ "Мы обнаружили, что у вас установлен плагин «Clearfy - отключить "
#~ "неиспользуемые функции», этот плагин уже имеет функции отключения "
#~ "комментариев, поэтому вы можете отключить плагин «Отключить комментарии»!"
#~ msgid "Webcraftic Disable comments"
#~ msgstr "Webcraftic отключить комментарии"
#~ msgid "Recommended"
#~ msgstr "Рекомендовано"
#~ msgid "You are not allowed to view this page."
#~ msgstr "Вам не разрешено просматривать эту страницу."
#~ msgid "You do not have the selected post types!"
#~ msgstr "Вы не выбрали еще ни одного типа записей!"
#~ msgid "No comments available for deletion."
#~ msgstr "Нет комментариев для удаления."
#~ msgid ""
#~ "Are you sure that you desire to delete all comments from the database?"
#~ msgstr "Вы уверены, что хотите удалить все комментарии из базы данных?"
#~ msgid ""
#~ "Deleting comments will remove existing comment entries in the database "
#~ "and cannot be reverted without a database backup."
#~ msgstr ""
#~ "При удалении комментариев удаляются существующие записи комментариев в "
#~ "базе данных, они не могут быть восстановлены без резервного копирования "
#~ "базы данных."
#~ msgid "You have %s comments"
#~ msgstr "У вас есть %s комментариев"
#~ msgid "Yes, I'm sure"
#~ msgstr "Да, я уверен"
#~ msgid "No, return back"
#~ msgstr "Нет, вернуться"
#~ msgid ""
#~ "Are you sure that you desire to delete all comments from the database for "
#~ "the selected post types (%s)?"
#~ msgstr ""
#~ "Вы уверены, что хотите удалить все комментарии из базы данных для "
#~ "выбранных типов записей (%s)?"
#~ msgid "Webcraftic comments tweaks"
#~ msgstr "Webcraftic инструменты комментариев"
#~ msgid ""
#~ "We found that you have the \"Clearfy - disable unused features\" plugin "
#~ "installed, this plugin already has disable comments functions, so you can "
#~ "deactivate plugin \"Comments tweaks\"!"
#~ msgstr ""
#~ "Мы обнаружили, что у вас установлен плагин «Clearfy - отключить "
#~ "неиспользуемые функции», этот плагин уже имеет функции отключения "
#~ "комментариев, поэтому вы можете отключить плагин «Инструменты "
#~ "комментариев»!"
#~ msgid "Disable all comments"
#~ msgstr "Отключить все комментарии"

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,24 @@
<?php
// if uninstall.php is not called by WordPress, die
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
die;
}
// remove plugin options
global $wpdb;
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
if ( is_multisite() ) {
$wpdb->query( "DELETE FROM {$wpdb->sitemeta} WHERE meta_key LIKE 'wbcr_htm_%';" );
}
$wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wbcr_htm_%';" );