Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/leadin/public
File: class-assetsmanager.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Leadin;
[2] Fix | Delete
[3] Fix | Delete
use Leadin\data\Filters;
[4] Fix | Delete
use Leadin\admin\AdminConstants;
[5] Fix | Delete
use Leadin\data\Portal_Options;
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Class responsible of managing all the plugin assets.
[9] Fix | Delete
*/
[10] Fix | Delete
class AssetsManager {
[11] Fix | Delete
const ADMIN_CSS = 'leadin-css';
[12] Fix | Delete
const BRIDGE_CSS = 'leadin-bridge-css';
[13] Fix | Delete
const ADMIN_JS = 'leadin-js';
[14] Fix | Delete
[15] Fix | Delete
const FEEDBACK_CSS = 'leadin-feedback-css';
[16] Fix | Delete
const FEEDBACK_JS = 'leadin-feedback';
[17] Fix | Delete
const TRACKING_CODE = 'leadin-script-loader-js';
[18] Fix | Delete
const GUTENBERG = 'leadin-gutenberg';
[19] Fix | Delete
const MEETINGS_GUTENBERG = 'leadin-meetings-gutenberg';
[20] Fix | Delete
const FORMS_SCRIPT = 'leadin-forms-v2';
[21] Fix | Delete
const MEETINGS_SCRIPT = 'leadin-meeting';
[22] Fix | Delete
const LEADIN_CONFIG = 'leadinConfig';
[23] Fix | Delete
const LEADIN_I18N = 'leadinI18n';
[24] Fix | Delete
const REVIEW_BANNER = 'leadin-review-banner';
[25] Fix | Delete
const ELEMENTOR = 'leadin-elementor';
[26] Fix | Delete
const APP_ENTRY_CSS = 'leadin-app-css';
[27] Fix | Delete
const APP_EMBEDDER = 'leadin-app-embedder';
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* Register and localize all assets.
[31] Fix | Delete
*/
[32] Fix | Delete
public static function register_assets() {
[33] Fix | Delete
wp_register_style( self::ADMIN_CSS, LEADIN_ASSETS_PATH . '/style/leadin.css', array(), LEADIN_PLUGIN_VERSION );
[34] Fix | Delete
wp_register_script( self::ADMIN_JS, LEADIN_JS_BASE_PATH . '/leadin.js', array( 'jquery', 'wp-element' ), LEADIN_PLUGIN_VERSION, true );
[35] Fix | Delete
[36] Fix | Delete
wp_localize_script( self::ADMIN_JS, self::LEADIN_CONFIG, AdminConstants::get_leadin_config() );
[37] Fix | Delete
wp_register_script( self::FEEDBACK_JS, LEADIN_JS_BASE_PATH . '/feedback.js', array( 'jquery', 'thickbox' ), LEADIN_PLUGIN_VERSION, true );
[38] Fix | Delete
wp_localize_script( self::FEEDBACK_JS, self::LEADIN_CONFIG, AdminConstants::get_background_leadin_config() );
[39] Fix | Delete
wp_register_style( self::FEEDBACK_CSS, LEADIN_ASSETS_PATH . '/style/leadin-feedback.css', array(), LEADIN_PLUGIN_VERSION );
[40] Fix | Delete
wp_register_style( self::BRIDGE_CSS, LEADIN_ASSETS_PATH . '/style/leadin-bridge.css?', array(), LEADIN_PLUGIN_VERSION );
[41] Fix | Delete
wp_register_style( self::APP_ENTRY_CSS, LEADIN_JS_BASE_PATH . '/leadin.css', array(), LEADIN_PLUGIN_VERSION );
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Enqueue the assets needed in the admin section.
[46] Fix | Delete
*/
[47] Fix | Delete
public static function enqueue_admin_assets() {
[48] Fix | Delete
wp_enqueue_style( self::ADMIN_CSS );
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Enqueue the assets needed to render the deactivation feedback form.
[53] Fix | Delete
*/
[54] Fix | Delete
public static function enqueue_feedback_assets() {
[55] Fix | Delete
$embed_domain = Filters::apply_script_loader_domain_filters();
[56] Fix | Delete
wp_enqueue_script( self::APP_EMBEDDER, "$embed_domain/integrated-app-embedder/v1.js", array(), LEADIN_PLUGIN_VERSION, true );
[57] Fix | Delete
wp_enqueue_style( self::FEEDBACK_CSS );
[58] Fix | Delete
wp_enqueue_script( self::FEEDBACK_JS );
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* Enqueue the assets needed to correctly render the plugin's iframe.
[63] Fix | Delete
*/
[64] Fix | Delete
public static function enqueue_bridge_assets() {
[65] Fix | Delete
wp_enqueue_style( self::BRIDGE_CSS );
[66] Fix | Delete
wp_enqueue_script( self::ADMIN_JS );
[67] Fix | Delete
wp_enqueue_style( self::APP_ENTRY_CSS );
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
[71] Fix | Delete
/**
[72] Fix | Delete
* Enqueue the assets needed to correctly render the integrated forms app.
[73] Fix | Delete
*/
[74] Fix | Delete
public static function enqueue_integrated_app_assets() {
[75] Fix | Delete
$embed_domain = Filters::apply_js_base_url_filters();
[76] Fix | Delete
wp_enqueue_style( self::BRIDGE_CSS );
[77] Fix | Delete
wp_enqueue_script( self::ADMIN_JS );
[78] Fix | Delete
wp_enqueue_style( self::APP_ENTRY_CSS );
[79] Fix | Delete
wp_enqueue_script( self::APP_EMBEDDER, "$embed_domain/integrated-app-embedder/v1.js", array(), LEADIN_PLUGIN_VERSION, true );
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
/**
[83] Fix | Delete
* Register and enqueue the HubSpot's script loader (aka tracking code), used to collect data from your visitors.
[84] Fix | Delete
* https://knowledge.hubspot.com/account/how-does-hubspot-track-visitors
[85] Fix | Delete
*
[86] Fix | Delete
* @param Object $leadin_wordpress_info Object used to pass to the script loader.
[87] Fix | Delete
*/
[88] Fix | Delete
public static function enqueue_script_loader( $leadin_wordpress_info ) {
[89] Fix | Delete
$embed_domain = Filters::apply_script_loader_domain_filters();
[90] Fix | Delete
$portal_id = Portal_Options::get_portal_id();
[91] Fix | Delete
$business_unit_id = Portal_Options::get_business_unit_id();
[92] Fix | Delete
$embed_url = "https://$embed_domain/$portal_id.js?integration=WordPress";
[93] Fix | Delete
[94] Fix | Delete
if ( $business_unit_id && '' !== $business_unit_id ) {
[95] Fix | Delete
$embed_url = $embed_url . "&businessUnitId=$business_unit_id";
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
wp_register_script( self::TRACKING_CODE, $embed_url, array(), LEADIN_PLUGIN_VERSION, true );
[99] Fix | Delete
wp_localize_script( self::TRACKING_CODE, 'leadin_wordpress', $leadin_wordpress_info );
[100] Fix | Delete
wp_enqueue_script( self::TRACKING_CODE );
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
/**
[104] Fix | Delete
* Register and enqueue forms script
[105] Fix | Delete
*/
[106] Fix | Delete
public static function enqueue_forms_script() {
[107] Fix | Delete
wp_enqueue_script(
[108] Fix | Delete
self::FORMS_SCRIPT,
[109] Fix | Delete
Filters::apply_forms_script_url_filters(),
[110] Fix | Delete
array(),
[111] Fix | Delete
LEADIN_PLUGIN_VERSION,
[112] Fix | Delete
true
[113] Fix | Delete
);
[114] Fix | Delete
}
[115] Fix | Delete
[116] Fix | Delete
/**
[117] Fix | Delete
* Register and enqueue meetings script
[118] Fix | Delete
*/
[119] Fix | Delete
public static function enqueue_meetings_script() {
[120] Fix | Delete
wp_enqueue_script(
[121] Fix | Delete
self::MEETINGS_SCRIPT,
[122] Fix | Delete
'https://static.hsappstatic.net/MeetingsEmbed/ex/MeetingsEmbedCode.js',
[123] Fix | Delete
array(),
[124] Fix | Delete
LEADIN_PLUGIN_VERSION,
[125] Fix | Delete
true
[126] Fix | Delete
);
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* Register and localize the Gutenberg scripts.
[131] Fix | Delete
*/
[132] Fix | Delete
public static function localize_gutenberg() {
[133] Fix | Delete
$embed_domain = Filters::apply_js_base_url_filters();
[134] Fix | Delete
wp_enqueue_script( self::APP_EMBEDDER, "$embed_domain/integrated-app-embedder/v1.js", array(), LEADIN_PLUGIN_VERSION, true );
[135] Fix | Delete
wp_register_style( self::GUTENBERG, LEADIN_JS_BASE_PATH . '/gutenberg.css', array(), LEADIN_PLUGIN_VERSION );
[136] Fix | Delete
wp_enqueue_style( self::GUTENBERG );
[137] Fix | Delete
wp_register_script( self::GUTENBERG, LEADIN_JS_BASE_PATH . '/gutenberg.js', array( 'wp-blocks', 'wp-element', 'wp-i18n', self::APP_EMBEDDER ), LEADIN_PLUGIN_VERSION, true );
[138] Fix | Delete
wp_localize_script( self::GUTENBERG, self::LEADIN_CONFIG, AdminConstants::get_background_leadin_config() );
[139] Fix | Delete
wp_set_script_translations( self::GUTENBERG, 'leadin', __DIR__ . '/../languages' );
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
/**
[143] Fix | Delete
* Register and enqueue a new script for tracking review banner events.
[144] Fix | Delete
*/
[145] Fix | Delete
public static function enqueue_review_banner_tracking_script() {
[146] Fix | Delete
wp_register_script( self::REVIEW_BANNER, LEADIN_JS_BASE_PATH . '/reviewBanner.js', array( 'jquery' ), LEADIN_PLUGIN_VERSION, true );
[147] Fix | Delete
wp_localize_script( self::REVIEW_BANNER, self::LEADIN_CONFIG, AdminConstants::get_background_leadin_config() );
[148] Fix | Delete
wp_enqueue_script( self::REVIEW_BANNER );
[149] Fix | Delete
}
[150] Fix | Delete
[151] Fix | Delete
/**
[152] Fix | Delete
* Register and enqueue a new script/style for elementor.
[153] Fix | Delete
*/
[154] Fix | Delete
public static function enqueue_elementor_script() {
[155] Fix | Delete
$embed_domain = Filters::apply_js_base_url_filters();
[156] Fix | Delete
wp_enqueue_script( self::APP_EMBEDDER, "$embed_domain/integrated-app-embedder/v1.js", array(), LEADIN_PLUGIN_VERSION, true );
[157] Fix | Delete
wp_register_style( self::ELEMENTOR, LEADIN_JS_BASE_PATH . '/elementor.css', array(), LEADIN_PLUGIN_VERSION );
[158] Fix | Delete
wp_enqueue_style( self::ELEMENTOR );
[159] Fix | Delete
wp_register_script( self::ELEMENTOR, LEADIN_JS_BASE_PATH . '/elementor.js', array( 'wp-element', 'wp-i18n', self::APP_EMBEDDER ), LEADIN_PLUGIN_VERSION, true );
[160] Fix | Delete
wp_localize_script( self::ELEMENTOR, self::LEADIN_CONFIG, AdminConstants::get_background_leadin_config() );
[161] Fix | Delete
wp_enqueue_script( self::ELEMENTOR );
[162] Fix | Delete
wp_set_script_translations( self::ELEMENTOR, 'leadin', __DIR__ . '/../languages' );
[163] Fix | Delete
}
[164] Fix | Delete
[165] Fix | Delete
}
[166] Fix | Delete
[167] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function