Файловый менеджер - Редактировать - /var/www/xthruster/html/wp-content/uploads/flags/conflicts.tar
Назад
w3_total_cache_cdn.php 0000644 00000002625 14717655160 0011001 0 ustar 00 <?php /** * Class Optml_w3_total_cache_cdn * * External css/js needs to be added to a list in order to be processed by w3 total cache. */ class Optml_w3_total_cache_cdn extends Optml_Abstract_Conflict { /** * Optml_Jetpack_Lazyload constructor. */ public function __construct() { $this->severity = self::SEVERITY_MEDIUM; parent::__construct(); } /** * Set the message property * * @since 2.0.6 * @access public */ public function define_message() { /* translators: 1 is new line tag, 2 is the starting anchor tag, 3 is the ending anchor tag and 4 is the domain name of Optimole */ $this->message = sprintf( __( 'It seems your are using W3 Total Cache. %1$s If you are using the CSS or JavaScript minify/combine option from %2$sW3 Total Cache -> Performance -> Minify page %3$s %1$s add this line: %4$s to Include external files/libraries and check Use regular expressions for file matching checkbox.', 'optimole-wp' ), '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=w3tc_minify' ) . '">', '</a>', 'https://' . Optml_Main::instance()->admin->settings->get_cdn_url() . '/*' ); } /** * Determine if conflict is applicable. * * @return bool * @since 2.0.6 * @access public */ public function is_conflict_valid() { return Optml_Main::instance()->admin->settings->get( 'cdn' ) === 'enabled' && is_plugin_active( 'w3-total-cache/w3-total-cache.php' ); } } conflicting_plugins.php 0000644 00000013067 14717655160 0011340 0 ustar 00 <?php /** * The Conflicting Plugins class, documents and displays dashboard notice for conflicting plugins. * * @package \Optimole\Inc\Conflicts * @author Hardeep Asrani <hardeep@optimole.com> */ /** * Class Optml_Conflicting_Plugins * * @since 3.8.0 */ class Optml_Conflicting_Plugins { /** * Option key. * * @since 3.8.0 * @access private * @var string */ private $option_main = 'optml_dismissed_plugin_conflicts'; /** * Optml_Conflicting_Plugins constructor. * * @since 3.8.0 * @access public */ public function __construct() { add_action( 'wp_ajax_optml_dismiss_conflict_notice', [ $this, 'dismiss_notice' ] ); add_filter( 'all_plugins', [ $this, 'filter_conflicting_plugins' ] ); } /** * Define conflicting plugins. * * @since 3.8.0 * @access private * @return array */ private function defined_plugins() { $plugins = [ 'wp-smush' => 'wp-smushit/wp-smush.php', 'wp-smush-pro' => 'wp-smush-pro/wp-smush.php', 'kraken' => 'kraken-image-optimizer/kraken.php', 'tinypng' => 'tiny-compress-images/tiny-compress-images.php', 'shortpixel' => 'shortpixel-image-optimiser/wp-shortpixel.php', 'ewww' => 'ewww-image-optimizer/ewww-image-optimizer.php', 'ewww-cloud' => 'ewww-image-optimizer-cloud/ewww-image-optimizer-cloud.php', 'imagerecycle' => 'imagerecycle-pdf-image-compression/wp-image-recycle.php', 'imagify' => 'imagify/imagify.php', // 'plugin-slug' => 'plugin-folder/plugin-file.php' ]; return apply_filters( 'optml_conflicting_defined_plugins', $plugins ); } /** * Get a list of active conflicting plugins. * * @since 3.8.0 * @access private * @return array */ private function get_active_plugins() { require_once ABSPATH . 'wp-admin/includes/plugin.php'; $conflicting_plugins = $this->defined_plugins(); $conflicting_plugins = array_filter( $conflicting_plugins, 'is_plugin_active' ); return apply_filters( 'optml_conflicting_active_plugins', $conflicting_plugins ); } /** * Get a list of dismissed conflicting plugins. * * @since 3.8.0 * @access private * @return array */ private function get_dismissed_notices() { $dismissed_conflicts = get_option( $this->option_main, '{}' ); $dismissed_conflicts = json_decode( $dismissed_conflicts, true ); if ( empty( $dismissed_conflicts ) ) { return []; } return $dismissed_conflicts; } /** * Get a list of undismissed conflicting plugins. * * @since 3.8.0 * @access private * @param boolean $show_dismissed Also show the dismissed plugins. * @return array */ public function get_conflicting_plugins( $show_dismissed = false ) { $conflicting_plugins = $this->get_active_plugins(); if ( true === $show_dismissed ) { return $conflicting_plugins; } $dismissed_conflicts = $this->get_dismissed_notices(); $conflicting_plugins = array_diff_key( $conflicting_plugins, $dismissed_conflicts ); return $conflicting_plugins; } /** * Checks if there are any conflicting plugins. * * @since 3.8.0 * @access public * @return boolean */ public function has_conflicting_plugins() { $conflicting_plugins = $this->get_conflicting_plugins(); return ! empty( $conflicting_plugins ); } /** * Dismiss conflicting plugins. * * @since 3.8.0 * @access public */ public function dismiss_conflicting_plugins() { $options = get_option( $this->option_main, '{}' ); $options = json_decode( $options, true ); if ( empty( $options ) ) { $options = []; } $conflicting_plugins = $this->get_conflicting_plugins(); foreach ( $conflicting_plugins as $slug => $file ) { $conflicting_plugins[ $slug ] = true; } $options = array_merge( $options, $conflicting_plugins ); update_option( $this->option_main, wp_json_encode( $options ) ); } /** * Check if we should show the notice. * * @since 3.8.0 * @access public * @return bool Should show? */ public function should_show_notice() { if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { return false; } if ( is_network_admin() ) { return false; } if ( ! current_user_can( 'manage_options' ) ) { return false; } $current_screen = get_current_screen(); if ( empty( $current_screen ) ) { return false; } if ( ! $this->has_conflicting_plugins() ) { return false; } return true; } /** * Filter conflicting plugins. * It will appear at wp-admin/plugins.php?optimole_conflicts * * @since 3.8.0 * @access public * @param array $plugins List of plugins. * @return array */ public function filter_conflicting_plugins( $plugins ) { if ( ! isset( $_GET['optimole_conflicts'] ) ) { return $plugins; } $allowed_plugins = $this->get_conflicting_plugins( true ); $filtered_plugins = []; foreach ( $plugins as $plugin_file => $plugin_data ) { if ( in_array( $plugin_file, $allowed_plugins, true ) ) { $filtered_plugins[ $plugin_file ] = $plugin_data; } } return $filtered_plugins; } /** * Update the option value using AJAX * * @since 3.8.0 * @access public */ public function dismiss_notice() { if ( ! isset( $_POST['nonce'] ) ) { $response = [ 'success' => false, 'message' => 'Missing nonce or value.', ]; wp_send_json( $response ); } $nonce = sanitize_text_field( $_POST['nonce'] ); if ( ! wp_verify_nonce( $nonce, 'optml_dismiss_conflict_notice' ) ) { $response = [ 'success' => false, 'message' => 'Invalid nonce.', ]; wp_send_json( $response ); } $this->dismiss_conflicting_plugins(); $response = [ 'success' => true, ]; wp_send_json( $response ); } } divi.php 0000644 00000004211 14717655160 0006222 0 ustar 00 <?php /** * Class Optml_Divi * * An example of a conflict. */ class Optml_Divi extends Optml_Abstract_Conflict { /** * Optml_Divi constructor. */ public function __construct() { $this->priority = 2; $this->severity = self::SEVERITY_HIGH; parent::__construct(); } /** * Set the message property * * @since 2.2.6 * @access public */ public function define_message() { $this->message = sprintf( /* translators: 1 is the start of the bold tag, 2 is ending bold tag, 3 is new line tag, 4 is anchor tag start, 5 is ending anchor tag */ __( 'It seems your are using %1$sDivi%2$s right now. %3$s In order for Optimole to replace the images in your Divi pages, you will need to go to %4$sDivi -> Theme Options -> Builder -> Advanced -> Static CSS File Generations%5$s and click on Clear for the images to be processed. ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=et_divi_options' ) . '">', '</a>' ); } /** * Determine if conflict is applicable. * * @return bool * @since 2.2.6 * @access public */ public function is_conflict_valid() { $show_message = true; if ( is_plugin_active( 'divi-builder/divi-builder.php' ) ) { if ( ! function_exists( 'get_plugin_data' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/divi-builder/divi-builder.php' ); if ( version_compare( $plugin_data['Version'], '4.10.8', '<' ) ) { $show_message = true; } } $theme = wp_get_theme(); // Divi, no child theme. if ( strcmp( $theme->get( 'Name' ), 'Divi' ) === 0 && $theme->parent() === false && version_compare( $theme->get( 'Version' ), '4.10.8', '<' ) ) { $show_message = true; } // Child theme, parent divi. if ( $theme->parent() !== false && strcmp( $theme->parent()->get( 'Name' ), 'Divi' ) === 0 && version_compare( $theme->parent()->get( 'Version' ), '4.10.8', '<' ) ) { $show_message = true; } if ( ! function_exists( 'et_get_option' ) ) { return false; } if ( 'off' === et_get_option( 'et_pb_static_css_file', 'off' ) ) { return false; } return $show_message; } } jetpack_photon.php 0000644 00000002620 14717655160 0010301 0 ustar 00 <?php /** * Class Optml_Jetpack_Photon * * An example of a conflict. */ class Optml_Jetpack_Photon extends Optml_Abstract_Conflict { /** * Optml_Jetpack_Photon constructor. */ public function __construct() { $this->priority = 2; $this->severity = self::SEVERITY_HIGH; parent::__construct(); } /** * Set the message property * * @since 2.0.6 * @access public */ public function define_message() { $this->message = sprintf( /* translators: 1 is the start of the bold tag, 2 is ending bold tag, 3 is new line tag, 4 is anchor tag start, 5 is ending anchor tag, 6 is start of bold tag, 7 is ending bold tag */ __( 'It seems your are using %1$sJetpack%2$s with site accelerator option enabled for images. %3$s To avoid any possible conflicts with Optimole replacement mechanism, you can go to %4$sJetpack -> Perfomance%5$s and turn off the site accelerator option for %6$simages%7$s', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=jetpack#/performance' ) . '">', '</a>', '<b>', '</b>' ); } /** * Determine if conflict is applicable. * * @return bool * @since 2.0.6 * @access public */ public function is_conflict_valid() { if ( ! is_plugin_active( 'jetpack/jetpack.php' ) ) { return false; } if ( ! class_exists( 'Jetpack', false ) ) { return false; } return Jetpack::is_module_active( 'photon' ); } } abstract_conflict.php 0000644 00000005355 14717655160 0010765 0 ustar 00 <?php /** * The Abstract class inherited by all conflicts. * * @package \Optimole\Inc\Conflicts * @author Optimole <friends@optimole.com> */ /** * Class Optml_Abstract_Conflict * * @since 2.0.6 */ abstract class Optml_Abstract_Conflict { /** * Constant for low severity. * * @since 2.0.6 * @const string SEVERITY_LOW */ const SEVERITY_LOW = 'low'; /** * Constant for medium severity. * * @since 2.0.6 * @const string SEVERITY_MEDIUM */ const SEVERITY_MEDIUM = 'medium'; /** * Constant for high severity. * * @since 2.0.6 * @const string SEVERITY_HIGH */ const SEVERITY_HIGH = 'high'; /** * The type of the conflict if required. * * @since 2.0.6 * @access protected * @var string $type */ protected $type = 'base_conflict'; /** * Level of conflict severity. * * @since 2.0.6 * @access protected * @var string $severity */ protected $severity = self::SEVERITY_LOW; /** * Message of the conflict. * * @since 2.0.6 * @access protected * @var string */ protected $message = ''; /** * Priority of conflict for same level of severity conflicts. * * @since 2.0.6 * @access protected * @var int */ protected $priority = 1; /** * Optml_Abstract_Conflict constructor. */ public function __construct() { $this->define_message(); } /** * Set the message property * * @since 2.0.6 * @access public */ abstract public function define_message(); /** * Checks if conflict is active. * * @param array $dismissed_conflicts A list of dismissed conflicts. Passed by the manager. * * @return bool * @since 2.0.6 * @access public */ public function is_active( $dismissed_conflicts = [] ) { $conflict_id = $this->get_id(); if ( isset( $dismissed_conflicts[ $conflict_id ] ) && $dismissed_conflicts[ $conflict_id ] === 'true' ) { return false; } return $this->is_conflict_valid(); } /** * Get the id for the conflict. * * @param int $length Optional. A length for the generated ID. * * @return bool|string * @since 2.0.6 * @access public */ public function get_id( $length = 8 ) { $hash = sha1( strtolower( get_called_class() ) . $this->type . $this->severity . $this->priority ); return substr( $hash, 0, $length ); } /** * Determine if conflict is applicable. * * @return bool * @since 2.0.6 * @access public */ abstract public function is_conflict_valid(); /** * Get the conflict information. * * @return array * @since 2.0.6 * @access public */ public function get_conflict() { return [ 'id' => $this->get_id(), 'type' => $this->type, 'priority' => $this->priority, 'severity' => $this->severity, 'message' => $this->message, ]; } } conflict_manager.php 0000644 00000006720 14717655160 0010571 0 ustar 00 <?php /** * The Conflict Manager class, orchestrates conflicts. * * @package \Optimole\Inc\Conflicts * @author Optimole <friends@optimole.com> */ /** * Class Optml_Conflict_Manager * * @since 2.0.6 */ class Optml_Conflict_Manager { /** * List of conflicts to watch. * * @since 2.0.6 * @access protected * @var array $watched_conflicts */ protected $watched_conflicts = []; /** * List of conflicts dismissed by user. * * @since 2.0.6 * @access protected * @var array $dismissed_conflicts */ protected $dismissed_conflicts = []; /** * Optml_Conflict_Manager constructor. * * @since 2.0.6 * @access public * @param array $register_conflicts A list of conflicts to be registered. */ public function __construct( $register_conflicts = [] ) { $this->dismissed_conflicts = get_option( 'optml_dismissed_conflicts', [] ); if ( ! empty( $register_conflicts ) ) { foreach ( $register_conflicts as $conflict_to_watch ) { $this->watch( $conflict_to_watch ); } } } /** * Add a conflict to the watched conflicts. * * @since 2.0.6 * @access public * @param string $conflict A conflict class name. */ public function watch( $conflict ) { if ( is_subclass_of( new $conflict(), 'Optml_Abstract_Conflict' ) ) { array_push( $this->watched_conflicts, new $conflict() ); } } /** * Dismiss conflict. * * @since 2.0.6 * @access public * @param string $id The conflict ID. * * @return bool */ public function dismiss_conflict( $id ) { $this->dismissed_conflicts[ $id ] = 'true'; return update_option( 'optml_dismissed_conflicts', $this->dismissed_conflicts ); } /** * Get the conflict list. * * @since 2.0.6 * @access public * @return array */ public function get_conflict_list() { $conflict_list = []; if ( empty( $this->watched_conflicts ) ) { return $conflict_list; } /** * An instance of Optml_Abstract_Conflict * * @var Optml_Abstract_Conflict $conflict */ foreach ( $this->watched_conflicts as $conflict ) { if ( $conflict->is_active( $this->dismissed_conflicts ) ) { array_push( $conflict_list, $conflict->get_conflict() ); } } // Sort conflicts by severity and priority. usort( $conflict_list, function ( $item1, $item2 ) { if ( ! isset( $item1['severity'] ) ) { return -1; } if ( ! isset( $item2['severity'] ) ) { return -1; } $severity_map = [ 'high' => 0, 'medium' => 1, 'low' => 1, ]; if ( $severity_map[ $item1['severity'] ] === $severity_map[ $item2['severity'] ] ) { if ( ! isset( $item1['priority'] ) ) { return 0; } if ( ! isset( $item2['priority'] ) ) { return 0; } if ( $item1['priority'] === $item2['priority'] ) { return 0; } return $item1['priority'] < $item2['priority'] ? -1 : +1; } return $severity_map[ $item1['severity'] ] < $severity_map[ $item2['severity'] ] ? -1 : 1; } ); return $conflict_list; } /** * Get the total count for active conflicts. * * @since 2.0.6 * @access public * @return int */ public function get_conflict_count() { if ( empty( $this->watched_conflicts ) ) { return 0; } $count = 0; /** * An instance of Optml_Abstract_Conflict * * @var Optml_Abstract_Conflict $conflict */ foreach ( $this->watched_conflicts as $conflict ) { if ( $conflict->is_active( $this->dismissed_conflicts ) ) { ++$count; } } return $count; } } jetpack_lazyload.php 0000644 00000003005 14717655160 0010607 0 ustar 00 <?php /** * Class Optml_Jetpack_Lazyload * * An example of a conflict. */ class Optml_Jetpack_Lazyload extends Optml_Abstract_Conflict { /** * Optml_Jetpack_Lazyload constructor. */ public function __construct() { $this->severity = self::SEVERITY_MEDIUM; parent::__construct(); } /** * Set the message property * * @since 2.0.6 * @access public */ public function define_message() { $this->message = sprintf( /* translators: 1 is the start of the bold tag, 2 is ending bold tag, 3 is new line tag, 4 is anchor tag start, 5 is ending anchor tag */__( 'It seems your are using %1$sJetpack%2$s with Lazy loading option ON. %3$s Optimole already provides a lazy loading mechanism by it\'s own which might conflict with this. If you would like to further use Optimole lazy loading feature, you can turn that off from %4$sJetpack -> Perfomance%5$s page. ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=jetpack#/performance' ) . '">', '</a>' ); } /** * Determine if conflict is applicable. * * @return bool * @since 2.0.6 * @access public */ public function is_conflict_valid() { if ( ! is_plugin_active( 'jetpack/jetpack.php' ) ) { return false; } if ( ! class_exists( 'Jetpack', false ) ) { return false; } if ( ! class_exists( 'Jetpack', false ) ) { return false; } if ( ! Optml_Main::instance()->admin->settings->use_lazyload() ) { return false; } return Jetpack::is_module_active( 'lazy-images' ); } } wprocket.php 0000644 00000002562 14717655160 0007134 0 ustar 00 <?php /** * Class Optml_Wprocket * * An example of a conflict. */ class Optml_Wprocket extends Optml_Abstract_Conflict { /** * Optml_Wprocket constructor. */ public function __construct() { $this->severity = self::SEVERITY_MEDIUM; parent::__construct(); } /** * Set the message property * * @since 2.0.6 * @access public */ public function define_message() { $this->message = sprintf( /* translators: 1 is the start of the bold tag, 2 is ending bold tag, 3 is new line tag, 4 is anchor tag start, 5 is ending anchor tag */__( 'It seems your are using %1$sWP Rocket%2$s with Lazy loading for images option active. %3$s Optimole already provides a lazy loading mechanism by it\'s own which might conflict with this. If you would like to further use Optimole lazy loading feature, you can turn that off from %4$sSettings -> WP Rocket -> Media%5$s page.', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'options-general.php?page=wprocket#media' ) . '">', '</a>' ); } /** * Determine if conflict is applicable. * * @return bool * @since 2.0.6 * @access public */ public function is_conflict_valid() { if ( ! is_plugin_active( 'wp-rocket/wp-rocket.php' ) ) { return false; } if ( ! function_exists( 'get_rocket_option' ) ) { return false; } return get_rocket_option( 'lazyload', false ); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.3-4ubuntu2.24 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка