/**
  * Initialize plugin load
  */
 public function init()
 {
     // activate plugin and resource builder
     $this->resourceBuilder();
     $this->essb();
     // Social Share Optimization
     if (defined('ESSB3_SSO_ACTIVE')) {
         $this->factoryActivate('sso', 'ESSBSocialShareOptimization');
     }
     // Social Share Analytics
     if (defined('ESSB3_SSA_ACTIVE')) {
         $tracker = ESSBSocialShareAnalytics::get_instance();
         $this->resourceBuilder()->add_js($this->socialShareAnalytics()->generate_tracker_code(), true, 'essb-stats-tracker');
     }
     // After Share Actions
     if (defined('ESSB3_AFTERSHARE_ACTIVE')) {
         foreach ($this->afterShareActions()->resource_files as $key => $object) {
             $this->resourceBuilder()->add_static_resource($object["file"], $object["key"], $object["type"]);
         }
         foreach ($this->afterShareActions()->js_code as $key => $code) {
             $this->resourceBuilder()->add_js($code, false, 'essbasc_custom' . $key);
         }
         foreach ($this->afterShareActions()->social_apis as $key => $code) {
             $this->resourceBuilder()->add_social_api($key);
         }
     }
     // Love this button
     if (defined('ESSB3_LOVEYOU_ACTIVE')) {
         $this->resourceBuilder()->add_js($this->loveThisButton()->generate_js_code(), true, 'essb-loveyou-code');
     }
     // On Media Sharing
     if (defined('ESSB3_IMAGESHARE_ACTIVE')) {
         $this->factoryActivate('essbis', 'ESSBSocialImageShare');
         $this->resourceBuilder()->add_css(ESSBResourceBuilderSnippets::css_build_imageshare_customizer(), 'essb-imageshare-customizer', 'footer');
     }
     // Social Profiles
     if (!defined('ESSB3_LIGHTMODE')) {
         if (defined('ESSB3_SOCIALPROFILES_ACTIVE')) {
             $this->factoryActivate('essbsp', 'ESSBSocialProfiles');
             $this->resourceBuilder()->add_static_resource(ESSB3_PLUGIN_URL . '/assets/css/essb-profiles.css', 'easy-social-share-buttons-profles', 'css');
         }
     }
     // Followers Counter
     if (defined('ESSB3_SOCIALFANS_ACTIVE')) {
         $this->factoryActivate('essbfc', 'ESSBSocialFollowersCounter');
         $this->resourceBuilder()->add_css(ESSBResourceBuilderSnippets::css_build_followerscounter_customizer(), 'essb-followerscounter-customizer', 'footer');
     }
     if (!defined('ESSB3_LIGHTMODE')) {
         if (defined('ESSB3_NATIVE_ACTIVE')) {
             // Social Privacy Buttons when active include resources
             $essb_spb = ESSBSocialPrivacyNativeButtons::get_instance();
             ESSBNativeButtonsHelper::$essb_spb = $essb_spb;
             foreach ($this->privacyNativeButtons()->resource_files as $key => $object) {
                 $this->resourceBuilder()->add_static_resource($object["file"], $object["key"], $object["type"]);
             }
             foreach (ESSBSkinnedNativeButtons::get_assets() as $key => $object) {
                 $this->resourceBuilder()->add_static_resource($object["file"], $object["key"], $object["type"]);
             }
             $this->resourceBuilder()->add_css(ESSBSkinnedNativeButtons::generate_skinned_custom_css(), 'essb-skinned-native-buttons');
             // asign instance of native buttons privacy class to helper
             // register active social network apis
             foreach (ESSBNativeButtonsHelper::get_list_of_social_apis() as $key => $code) {
                 $this->resourceBuilder()->add_social_api($key);
             }
         }
     }
     if (is_admin()) {
         $this->asAdmin();
     }
 }