' . // PHPCS - Plain Text
esc_html__( 'Access 1,500+ amazing Font Awesome 5 icons and enjoy faster performance and design flexibility.', 'elementor' ) . ' ' . // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
esc_html__( 'By upgrading, whenever you edit a page containing a Font Awesome 4 icon, Elementor will convert it to the new Font Awesome 5 icon.', 'elementor' ) . // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'
' .
esc_html__( 'Please note that the upgrade process may cause some of the previously used Font Awesome 4 icons to look a bit different due to minor design changes made by Font Awesome.', 'elementor' ) . // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'
' .
esc_html__( 'The upgrade process includes a database update', 'elementor' ) . ' - ' . // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
esc_html__( 'We highly recommend backing up your database before performing this upgrade.', 'elementor' ) . // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'
' .
esc_html__( 'This action is not reversible and cannot be undone by rolling back to previous versions.', 'elementor' ) . // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'';
},
'fields' => [
[
'label' => esc_html__( 'Font Awesome Upgrade', 'elementor' ),
'field_args' => [
'type' => 'raw_html',
'html' => sprintf( '%s',
self::NEEDS_UPDATE_OPTION . '_upgrade',
wp_create_nonce( self::NEEDS_UPDATE_OPTION ),
esc_url( $this->get_upgrade_redirect_url() ),
esc_html__( 'Upgrade To Font Awesome 5', 'elementor' )
),
],
],
],
] );
}
/**
* Get redirect URL when upgrading font awesome.
*
* @return string
*/
public function get_upgrade_redirect_url() {
if ( ! wp_verify_nonce( Utils::get_super_global_value( $_GET, '_wpnonce' ), 'tools-page-from-editor' ) ) {
return '';
}
$document_id = ! empty( $_GET['redirect_to_document'] ) ? absint( $_GET['redirect_to_document'] ) : null;
if ( ! $document_id ) {
return '';
}
$document = Plugin::$instance->documents->get( $document_id );
if ( ! $document ) {
return '';
}
return $document->get_edit_url();
}
/**
* Ajax Upgrade to FontAwesome 5
*/
public function ajax_upgrade_to_fa5() {
check_ajax_referer( self::NEEDS_UPDATE_OPTION, '_nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
wp_send_json_error( 'Permission denied' );
}
delete_option( 'elementor_' . self::NEEDS_UPDATE_OPTION );
wp_send_json_success( [ 'message' => esc_html__( 'Hurray! The upgrade process to Font Awesome 5 was completed successfully.', 'elementor' ) ] );
}
/**
* Add Update Needed Flag
* @param array $settings
*
* @return array;
*/
public function add_update_needed_flag( $settings ) {
$settings['icons_update_needed'] = true;
return $settings;
}
public function enqueue_fontawesome_css() {
if ( ! self::is_migration_allowed() ) {
wp_enqueue_style( 'font-awesome' );
} else {
$current_filter = current_filter();
$load_shim = get_option( self::LOAD_FA4_SHIM_OPTION_KEY, false );
if ( 'elementor/editor/after_enqueue_styles' === $current_filter ) {
self::enqueue_shim();
} elseif ( 'yes' === $load_shim ) {
self::enqueue_shim();
}
}
}
/**
* @deprecated 3.1.0
*/
public function add_admin_strings() {
Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.1.0' );
return [];
}
/**
* Icons Manager constructor
*/
public function __construct() {
if ( is_admin() ) {
// @todo: remove once we deprecate fa4
add_action( 'elementor/admin/after_create_settings/' . Settings::PAGE_ID, [ $this, 'register_admin_settings' ], 100 );
}
if ( self::is_font_icon_inline_svg() ) {
self::$data_manager = new Font_Icon_Svg_Data_Manager();
}
add_action( 'elementor/frontend/after_enqueue_styles', [ $this, 'enqueue_fontawesome_css' ] );
add_action( 'elementor/frontend/after_register_styles', [ $this, 'register_styles' ] );
if ( ! self::is_migration_allowed() ) {
add_filter( 'elementor/editor/localize_settings', [ $this, 'add_update_needed_flag' ] );
add_action( 'elementor/admin/after_create_settings/' . Tools::PAGE_ID, [ $this, 'register_admin_tools_settings' ], 100 );
if ( ! empty( $_POST ) ) { // phpcs:ignore -- nonce validation done in callback
add_action( 'wp_ajax_' . self::NEEDS_UPDATE_OPTION . '_upgrade', [ $this, 'ajax_upgrade_to_fa5' ] );
}
}
}
}
Fatal error: Uncaught Error: Class "Elementor\Icons_Manager" not found in /htdocs/wp-content/plugins/elementor/includes/plugin.php:722
Stack trace:
#0 /htdocs/wp-content/plugins/elementor/includes/plugin.php(647): Elementor\Plugin->init_components()
#1 /htdocs/wp-includes/class-wp-hook.php(324): Elementor\Plugin->init('')
#2 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#3 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /htdocs/wp-settings.php(727): do_action('init')
#5 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...')
#6 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...')
#7 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...')
#8 /htdocs/index.php(17): require('/htdocs/wp-blog...')
#9 {main}
thrown in /htdocs/wp-content/plugins/elementor/includes/plugin.php on line 722