Files
dostavka_vodi/wp-content/plugins/!clearfy/admin/pages/class-page.php
User A0264400 a766acdc90 first commit
2026-04-01 23:20:16 +03:00

83 lines
3.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* Default page
*
* @author Webcraftic <wordpress.webraftic@gmail.com>, Alexander Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 17.08.2019, Webcraftic
* @version 1.0
*/
class WCL_Page extends WBCR\Factory_Templates_134\Pages\PageBase {
/**
* Requests assets (js and css) for the page.
*
* @return void
* @since 1.0.0
* @see FactoryPages480_AdminPage
*
*/
public function assets($scripts, $styles)
{
parent::assets($scripts, $styles);
$this->styles->add(WCL_PLUGIN_URL . '/admin/assets/css/components.css');
/**
* Подгружаем стили для вижета оптимизации изображений, если не установли плагин оптимизации изображений
*/
if( !defined('WIO_PLUGIN_ACTIVE') ) {
$this->styles->add(WCL_PLUGIN_URL . '/admin/assets/css/base-statistic.css');
}
$this->styles->add(WCL_PLUGIN_URL . '/admin/assets/css/general.css');
$this->scripts->add(WCL_PLUGIN_URL . '/admin/assets/js/general.js', [], 'wclearfy-general');
$params = array(
//'ajaxurl' => admin_url('admin-ajax.php'),
'flush_cache_url' => $this->getActionUrl('flush-cache-and-rules', array('_wpnonce' => wp_create_nonce('wbcr_factory_' . $this->getResultId() . '_flush_action'))),
'ajax_nonce' => wp_create_nonce('wbcr_clearfy_ajax_quick_start_nonce'),
'import_options_nonce' => wp_create_nonce('wbcr_clearfy_import_options'),
'i18n' => array(
'success_update_settings' => __('Settings successfully updated!', 'clearfy'),
'unknown_error' => __('During the setup, an unknown error occurred, please try again or contact the plugin support.', 'clearfy')
)
);
$this->scripts->localize('wbcr_clearfy_ajax', $params);
}
/**
* Действие выполняется для всех страниц Clearfy и его компонентах.
* Это простое предложение перейти на PRO версию.
*/
public function multisiteProAction()
{
if( is_multisite() && $this->plugin->isNetworkActive() ) {
$license_page_url = $this->getBaseUrl('clearfy_license');
$upgrade_url = $this->plugin->get_support()->get_pricing_url(true, 'multisite_save_settings');
$html = '<div class="wbcr-factory-templates-134-multisite-suggetion">';
$html .= '<div class="wbcr-factory-inner-contanier">';
$html .= '<h3>' . __('Upgrade to Clearfy Business', 'wbcr_factory_templates_134') . '</h3>';
$html .= '<p>' . __('Oops... Sorry for the inconvenience caused!', 'wbcr_factory_templates_134') . '</p>';
$html .= '<p>' . __('Complete multisite support is available in Clearfy Business and Clearfy Business Revolution packages only!', 'wbcr_factory_templates_134') . '</p>';
$html .= '<p>' . __('You can activate the plugin on each website and use it with zero limitations. But you cant save the plugins settings under the Super Administrator role!', 'wbcr_factory_templates_134') . '</p>';
$html .= '<p style="margin-top:20px">';
$html .= '<a href="' . $license_page_url . '" class="wbcr-factory-activate-premium" rel="noopener">' . __('Activate license ', 'wbcr_factory_templates_134') . '</a> ';
$html .= '<a href="' . $upgrade_url . '" class="wbcr-factory-purchase-premium" target="_blank" rel="noopener">' . __('Upgrade to Clearfy Business', 'wbcr_factory_templates_134') . '</a>';
$html .= '</p>';
$html .= '</div>';
$html .= '</div>';
$this->showPage($html);
return;
}
$this->redirectToAction('index');
}
}