/home/websdxuk/dannymattinezllc.com/wp-content/plugins/elementor-pro/modules/usage/module.php
<?php
namespace ElementorPro\Modules\Usage;

use Elementor\Core\Base\Module as BaseModule;
use Elementor\Modules\System_Info\Module as System_Info;
use ElementorPro\Modules\AssetsManager\AssetTypes\Fonts\Custom_Fonts;
use ElementorPro\Modules\AssetsManager\AssetTypes\Icons\Custom_Icons;
use ElementorPro\Plugin;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Elementor usage module.
 * @method static Module instance()
 */
class Module extends BaseModule {
	/**
	 * Get module name.
	 *
	 * Retrieve the usage module name.
	 *
	 * @access public
	 *
	 * @return string Module name.
	 */
	public function get_name() {
		return 'usage';
	}

	/**
	 * Get integrations usage.
	 *
	 * Check all integrations in settings tab, find out who are in use.
	 *
	 * @return array
	 */
	public function get_integrations_usage() {
		$usage = [];

		$settings_tab = Plugin::elementor()->settings->get_tabs();
		$integrations = $settings_tab['integrations']['sections'];

		foreach ( $integrations as $integration_name => $integration_data ) {
			$integration_options = [];
			$integration_fields_count = count( $integration_data['fields'] );

			foreach ( $integration_data['fields'] as $field_name => $field_data ) {
				$integration_options [] = get_option( 'elementor_' . $field_name );
			}
			/**
			 * array_filter will clear all empty array values.
			 * if all the values filled then the count should be the same.
			 */
			if ( count( array_filter( $integration_options ) ) === $integration_fields_count ) {
				$usage[ $integration_name ] = true;
			}
		}

		return $usage;
	}

	/**
	 * Get fonts usage.
	 *
	 * Retrieve the number of Elementor fonts variants saved.
	 *
	 * @access public
	 * @static
	 *
	 * @return array The number of Elementor fonts variants.
	 */
	public static function get_fonts_usage() {
		$usage = [];
		$query = new \WP_Query( [
			'posts_per_page' => -1,
			'post_type' => 'elementor_font',
		] );

		$post_index = 0;
		foreach ( $query->get_posts() as $post ) {
			$elementor_font_files = get_post_meta( $post->ID, Custom_Fonts::FONT_META_KEY );

			if ( ! empty( $elementor_font_files ) ) {
				foreach ( $elementor_font_files as $elementor_font_index => $elementor_font_file ) {
					$current = & $usage[ $post_index ];

					foreach ( $elementor_font_file as $elementor_font_variant_index => $elementor_font_variant ) {
						$current_variant = & $current[ 'variant_' . $elementor_font_variant_index ];

						foreach ( [ 'weight', 'style' ] as $font_prop ) {
							$current_variant[ $font_prop ] = $elementor_font_variant[ 'font_' . $font_prop ];
						}

						$current_variant['types'] = [];
						foreach ( [ 'woff', 'woff2', 'ttf', 'svg', 'eot' ] as $font_ext ) {
							if ( isset( $elementor_font_variant[ $font_ext ] ) && strlen( $elementor_font_variant[ $font_ext ]['url'] ) ) {
								$current_variant['types'][] = $font_ext;
							}
						}
					}
				}

				$post_index++;
			}
		}

		return $usage;
	}

	/**
	 * Get icons usage.
	 *
	 * Retrieve the number of Elementor icons saved.
	 *
	 * @access public
	 * @static
	 *
	 * @return array The number of Elementor icons.
	 */
	public static function get_icons_usage() {
		$usage = [];
		$query = new \WP_Query( [
			'posts_per_page' => -1,
			'post_type' => 'elementor_icons',
		] );

		$index = 0;
		foreach ( $query->get_posts() as $post ) {
			$elementor_custom_icon_set_config = get_post_meta( $post->ID, Custom_Icons::META_KEY );

			if ( isset( $elementor_custom_icon_set_config[0] ) ) {
				$elementor_custom_icon_set_config = json_decode( $elementor_custom_icon_set_config[0] );

				$usage[ $index ] = (int) $elementor_custom_icon_set_config->count;

				$index++;
			}
		}

		return $usage;
	}

	/**
	 * Add's tracking data.
	 *
	 * Called on elementor/tracker/send_tracking_data_params.
	 *
	 * @param array $params
	 *
	 * @return array
	 */
	public function add_tracking_data( $params ) {
		unset( $params['is_first_time'] );

		$params['install_time_pro'] = Plugin::instance()->license_admin->get_installed_time();

		$params['usages']['integrations'] = $this->get_integrations_usage();
		$params['usages']['icons'] = $this->get_icons_usage();
		$params['usages']['fonts'] = $this->get_fonts_usage();

		return $params;
	}

	public function register_system_info_reporters() {
		System_Info::add_report( 'features', [
			'file_name' => __DIR__ . '/features-reporter.php',
			'class_name' => __NAMESPACE__ . '\Features_Reporter',
		] );

		System_Info::add_report( 'integrations', [
			'file_name' => __DIR__ . '/integrations-reporter.php',
			'class_name' => __NAMESPACE__ . '\Integrations_Reporter',
		] );
	}

	/**
	 * Usage module constructor.
	 *
	 * Initializing Elementor usage module.
	 *
	 * @access public
	 */
	public function __construct() {
		add_filter( 'elementor/tracker/send_tracking_data_params', [ $this, 'add_tracking_data' ] );

		add_action( 'admin_init', [ $this, 'register_system_info_reporters' ], 60 );
	}
}
My Blog – My WordPress Blog

Navigating Your Journey, Relocating Your World

Elevate Your Move, Experience Seamless Relocations.

A leading innovator in orchestrating top-notch Moving Solutions and Ensuring Seamless Relocations across the USA.

Booked Your Movement

Goods Packing Service

Goods Unpacking Service

Moving Goods Service

Goods Unloading Service

Service

Choose Your Movement Service

Start From 10 USD/Hour

Complete Goods Packing Service for House

All aspects of your software assets including purchasing, deployment & maintenance.

Start From 15 USD/Hour

Complete Goods Unpacking Service for House

All aspects of your software assets including purchasing, deployment & maintenance.

Start From 100 USD/Month

Complete Storage Solution For Your Goods

All aspects of your software assets including purchasing, deployment & maintenance.

Start From 100 USD/Month

Complete Unloading Solution For Your Goods

All aspects of your software assets including purchasing, deployment & maintenance.

Get 10% Discount For Every First of Order. 

View All Our Service Here

WHY CHOOSE US

Explore Why Our Company is Preferable

At [Your Company Name], we pride ourselves on delivering exceptional value, unparalleled service, and innovative solutions tailored to meet your needs.

No Hidden Price

Free Unloading

Clean No Trash

Warehouse

Fast Truck

About Us

Swift Your Transitions With Unmatched Service

At [Your Company Name], we are more than just a business—we are a team of passionate professionals dedicated to delivering excellence. With [X] years of experience in [your industry], we’ve built a reputation for [key strengths, e.g., innovation, reliability, customer-centric solutions].

Thinking insights, verified driven research, and metrics data help you make the right decisions!

Achievments

Moving You Forward By Moving with Care

At [Your Company Name], we take pride in our milestones and the impact we’ve made. Our journey is marked by dedication, innovation, and a relentless pursuit of excellence. Here’s a glimpse of what we’ve accomplished:

Every achievement reflects our commitment to excellence and the trust our clients and partners place in us. We’re not just celebrating the past—we’re building an even brighter future.

0 +

Clients

0 +

Miles

0 +

Movers

Study Case

Learn Our Successfull Study Cases

Urban, Relocations

From City to Suburbs: A Smooth Urban Relocation

Corporate, Precision

Corporate Precision: Streamlining Office Moves

Senior, Transitions

Senior Transitions: Compassionate Moves for Aging Loved Onesz

Cross, Country

Cross-Country Adventure: A Transcontinental Move

Booked Form

Don't Let Your Back Hurt, Let Us Move Your Things!

Our easy-to-use booking form ensures a seamless experience, allowing you to choose your preferred date, time, and options without any hassle.

Why book with us?
✓ Instant Confirmation – Receive immediate booking details via email/SMS.
✓ Flexible Scheduling – Pick a slot that fits your schedule.
✓ 100% Secure – Your information is safe with us.

Booked Your Movement

Booked Your Movement