HEX
Server: LiteSpeed
System: Linux server240.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: creaqbdc (8964)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/elementskit/modules/copy-paste-cross-domain/init.php
<?php
namespace ElementsKit\Modules\Copy_Paste_Cross_Domain;

defined('ABSPATH') || exit;

/**
 * Class: Initiate Copy-Paste-Cross-Domain module
 */
class Init {
    
    private $dir;
    private $url;

    public function __construct() {

        // get current directory path
        $this->dir = dirname(__FILE__) . '/';

        // get current module's url
        $this->url = \ElementsKit::plugin_url() . 'modules/copy-paste-cross-domain/';

        // enqueue styles and scripts
        add_action('elementor/editor/after_enqueue_scripts', [$this, 'editor_scripts']);

        // include all necessary files
        $this->include_files();

    }

    /**
     * Include necessary classes for the module
     *
     * @return void
     */
    public function include_files() {
        include $this->dir . 'ajax.php';

        new \Elementskit_Copy_Paste_Ajax();
    }

    /**
     * Enqueue and add javascript codes for this module
     *
     * @return void
     */
    public function editor_scripts() {

        if (is_admin()) {

            wp_enqueue_script('ekit-xd-copy-paste-editor-defer', $this->url . 'assets/js/ekit-copy-paste.js', ['elementor-editor'], \ElementsKit::version(), true);

            wp_localize_script('ekit-xd-copy-paste-editor-defer', 'ekit_cp_xd', [
                'ajaxurl'  => admin_url('admin-ajax.php'),
                'adminurl' => admin_url('admin.php'),
                'message'  => [
                    'copy'        => esc_html__('Element copied successfully!', 'elementskit'),
                    'import_wait' => esc_html__('Processing media import! Please wait', 'elementskit'),
                    'paste'       => esc_html__('Element pasted successfully!', 'elementskit'),
                    'error'       => esc_html__('Something went wrong!', 'elementskit'),
                    'empty_copy'  => esc_html__('No copied element found!', 'elementskit'),
                    'storage_key' => 'ekit-cross-domain-key',
                ],
            ]);

        }

    }
}