| Server IP : 185.88.153.241 / Your IP : 216.73.216.220 Web Server : LiteSpeed System : Linux server312.bertina.biz 3.10.0-962.3.2.lve1.5.88.el7.x86_64 #1 SMP Fri Sep 26 14:06:42 UTC 2025 x86_64 User : ( 1405) PHP Version : 7.0.33 Disable Function : mail, apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd, exec, fp, highlight_file, ini_alter, ini_restore, inject_code, mysql_pconnect, openlog, passthru, phpAds_remoteInfo, phpAds_XmlRpc, phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,dl,leak,crack_check,crack_closedict,crack_getlastmessage,crack_opendict,symlink,link,escapeshellarg,parse_ini_file, ln, show_source, pclose, parse_perms, mysql_list_dbs,stream_select,mysql_list_dbs,socket_select,socket_create,socket_create_listen,socket_create_pair,socket_listen,socket_accept,socket_bind,socket_strerror,socket_clear_error,socket_close,socket_connect,socket_get_option,socket_getpeername,socket_getsockname,socket_last_error,socket_read,socket_recv,socket_recvfrom,socket_send,socket_sendto,socket_set_block,socket_set_nonblock,socket_set_option,socket_shutdown,socket_write,readlink,pfsockopen,pcntl_exec,pcntl_fork,pcntl_signal,pcntl_waitpid,pcntl_wexitstatus, pcntl_wifexited, pcntl_wifsignaled, pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,fpassthru, posix_access, posix_ctermid, posix_errno, posix_get_last_error, posix_getcwd, posix_getgrnam, posix_getgroups, posix_getlogin, posix_getpgrp, posix_getpwnam, posix_getpwuid, posix_getrlimit, posix_getsid, posix_initgroups, posix_isatty, posix_mknod, posix_setegid, posix_seteuid, posix_strerror, posix_times, posix_ttyname, diskfreespace, disk_free_space, disk_total_space, sys_getloadavg,get_current_user MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/newhome1/public_html/wp-content/plugins/elementskit-lite/ |
Upload File : |
<?php
namespace ElementsKit;
defined( 'ABSPATH' ) || exit;
/**
* ElementsKit - the God class.
* Initiate all necessary classes, hooks, configs.
*
* @since 1.1.0
*/
class Handler{
/**
* The plugin instance.
*
* @since 1.0.0
* @access public
* @static
*
* @var Handler
*/
public static $instance = null;
/**
* Construct the plugin object.
*
* @since 1.0.0
* @access public
*/
public function __construct() {
// Call the method for ElementsKit autoloader.
$this->registrar_autoloader();
// Enqueue frontend scripts.
add_action( 'wp_enqueue_scripts', [$this, 'enqueue_frontend'] );
// Enqueue admin scripts.
add_action( 'admin_enqueue_scripts', [$this, 'enqueue_admin'] );
// Enqueue inline scripts
Core\Build_Inline_Scripts::instance();
// Register plugin settings pages
Libs\Framework\Attr::instance();
// Register default widgets
Core\Build_Widgets::instance();
// Register default modules
Core\Build_Modules::instance();
// Register ElementsKit supported widgets to Elementor from 3rd party plugins.
add_action( 'elementor/widgets/widgets_registered', [$this, 'register_widgets'], 1050);
// Register ElementsKit's custom endpoints for WP RESTful APIs and 3rd party hooks.
add_action( 'init', [$this, 'register_apis'], 1055);
// Adding pro lebel
new Libs\Pro_Label\Init();
Compatibility\Wpml\Init::instance();
Compatibility\Conflicts\Init::instance();
add_action('wp_head', [$this, 'add_meta_for_search_excluded']);
// Add banner class
add_action('admin_notices', function(){
include \ElementsKit::lib_dir() . 'banner/init.php';
\WpMet_Banner::run();
});
}
/**
* Enqueue scripts
*
* Enqueue js and css to frontend.
*
* @since 1.0.0
* @access public
*/
public function enqueue_frontend(){
wp_enqueue_style( 'elementskit-framework-css-frontend', \ElementsKit::lib_url() . 'framework/assets/css/frontend-style.min.css', [], \ElementsKit::VERSION );
wp_enqueue_script( 'elementskit-framework-js-frontend', \ElementsKit::lib_url() . 'framework/assets/js/frontend-script.js', ['jquery'], \ElementsKit::VERSION, true );
}
public function enqueue_frontend_inline(){
$script_builder = new Core\Build_Inline_scripts();
$script_builder->script_for_frontend();
}
/**
* Enqueue scripts
*
* Enqueue js and css to admin.
*
* @since 1.0.0
* @access public
*/
public function enqueue_admin(){
wp_register_style( 'elementskit-global-css-admin', \ElementsKit::lib_url() . 'framework/assets/css/admin-global.css', \ElementsKit::VERSION );
wp_enqueue_style( 'elementskit-global-css-admin' );
$screen = get_current_screen();
if(!in_array($screen->id, ['nav-menus', 'toplevel_page_elementskit', 'edit-elementskit_template'])){
return;
}
wp_register_style( 'fontawesome', \ElementsKit::widget_url() . 'init/assets/css/font-awesome.min.css', \ElementsKit::VERSION );
wp_register_style( 'elementskit-font-css-admin', \ElementsKit::widget_url() . 'init/assets/css/admin-ekiticon.css', \ElementsKit::VERSION );
wp_register_style( 'elementskit-lib-css-admin', \ElementsKit::lib_url() . 'framework/assets/css/framework.css', \ElementsKit::VERSION );
wp_register_style( 'elementskit-init-css-admin', \ElementsKit::lib_url() . 'framework/assets/css/admin-style.css', \ElementsKit::VERSION );
wp_register_style( 'elementskit-init-css-ems-admin', \ElementsKit::lib_url() . 'framework/assets/css/admin-style-ems-dev.css', \ElementsKit::VERSION );
wp_enqueue_style( 'fontawesome' );
wp_enqueue_style( 'elementskit-font-css-admin' );
wp_enqueue_style( 'elementskit-lib-css-admin' );
wp_enqueue_style( 'elementskit-init-css-ems-admin' );
wp_enqueue_style( 'elementskit-init-css-admin' );
wp_enqueue_script( 'elementskit-admin-core-ui', \ElementsKit::lib_url() . 'framework/assets/js/core-ui.min.js', \ElementsKit::VERSION, true );
wp_enqueue_script( 'elementskit-init-js-admin', \ElementsKit::lib_url() . 'framework/assets/js/admin-script.js', ['jquery'], \ElementsKit::VERSION, true );
}
public function enqueue_admin_inline(){
$script_builder = new Core\Build_Inline_scripts();
$script_builder->script_for_admin();
}
/**
* Control registrar.
*
* Register the custom controls for Elementor
* using `elementskit/widgets/widgets_registered` action.
*
* @since 1.0.0
* @access public
*/
public function register_control($widgets_manager){
do_action('elementskit/widgets/widgets_registered', $widgets_manager);
}
/**
* Api registrar.
*
* Retrieve all the registered API's endpoints
* using `elementskit/apis/apis_registered/post` action (for POST method).
* using `elementskit/apis/apis_registered/get` action (for GET method).
*
* @since 1.0.0
* @access public
*/
public function register_apis(){
new Core\Build_Apis();
}
/**
* Widget registrar.
*
* Retrieve all the registered widgets
* using `elementor/widgets/widgets_registered` action.
*
* @since 1.0.0
* @access public
*/
public function register_widgets($widgets_manager){
do_action('elementskit/widgets/widgets_registered', $widgets_manager);
}
/**
* Construct the plugin version manager.
*
* @since 1.0.0
* @access public
*/
private function registrar_version_manager(){
// run the migration class if current version is greater than old installed version.
if(Helper::current_version() > Helper::old_version()){
// load the update and related migration classes
// new ElementsKit_Version_Manager();
}
}
/**
* Excluding ElementsKit template and megamenu content from search engine.
* See - https://wordpress.org/support/topic/google-is-indexing-elementskit-content-as-separate-pages/
*
* @since 1.4.5
* @access public
*/
public function add_meta_for_search_excluded(){
if (get_post_type() == 'elementskit_template' || get_post_type() == 'elementskit_content' ) {
echo '<meta name="robots" content="noindex,nofollow" />', "\n";
}
}
/**
* Autoloader.
*
* ElementsKit autoloader loads all the classes needed to run the plugin.
*
* @since 1.0.0
* @access private
*/
private function registrar_autoloader() {
require_once \ElementsKit::plugin_dir() . '/autoloader.php';
Autoloader::run();
}
/**
* Disable class cloning and throw an error on object clone.
*
* The whole idea of the singleton design pattern is that there is a single
* object. Therefore, we don't want the object to be cloned.
*
* @access public
* @since 1.0.0
*/
public function __clone() {
// Cloning instances of the class is forbidden.
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cloning is forbidden.', 'elementskit' ), '1.0.0' );
}
/**
* Disable unserializing of the class.
*
* @access public
* @since 1.0.0
*/
public function __wakeup() {
// Unserializing instances of the class is forbidden.
_doing_it_wrong( __FUNCTION__, esc_html__( 'Unserializing instances of this class is forbidden.', 'elementskit' ), '1.0.0' );
}
/**
* Instance.
*
* Ensures only one instance of the plugin class is loaded or can be loaded.
*
* @since 1.0.0
* @access public
* @static
*
* @return Handler An instance of the class.
*/
public static function instance() {
if ( is_null( self::$instance ) ) {
// Fire when ElementsKit instance.
self::$instance = new self();
// Fire when ElementsKit was fully loaded and instantiated.
do_action( 'elementskit/loaded' );
}
return self::$instance;
}
}
// Run the instance.
Handler::instance();