%PDF- %PDF-
Direktori : /home/t/r/a/tradesc/www/relax/wp-content/plugins/ultimate-speed-addon/ |
Current File : /home/t/r/a/tradesc/www/relax/wp-content/plugins/ultimate-speed-addon/ultimate-speed-addon.php |
<?php /** * Plugin Name: Ultimate Speed Addon - WordProfessors * Description: Speeds up wordpress websites. It is a complimentary plugin for WordProfessors customers. * Author: WordProfessors * Author URI: https://www.fiverr.com/wordprofessors * Version: 2.3.1 * Text Domain: wordpro-speed-optimization */ if(!defined('WPINC')){die;}include('dom-parser.php');class ultimateSpeedAddOn{function __construct(){if(!is_admin()){ob_start(array($this,'wordproChangeBuffer'));}add_action('wp_print_footer_scripts',array($this,'addScriptAtFooter'),10);add_action('wp_print_footer_scripts',array($this,'wpmeteorDelayExecute'),10);}function wordproIfIncluded($text,$words){if($words){foreach($words as $word){if(strpos($text,$word)!==false){return true;}}}return false;}function wordproChangeBuffer($content){try{if($_SERVER['REQUEST_METHOD']!=='GET'){return $content;}if(!isset($content)||trim($content)===''||strcasecmp(substr($content,0,5),'<?xml')===0||trim($content)[0]!=="<"){return $content;}if(is_user_logged_in()){return $content;}$contentNew=str_get_html($content);if(!is_object($contentNew)){return $content;}foreach($contentNew->find("link[!rel],link[rel='preload'],link[rel='stylesheet']")as $link){if($this->wordproIfIncluded($link->outertext,array("fonts.googleapis.com"))){$link->setAttribute("data-type","wordprolazyload");if($link->getAttribute("href")){$link->setAttribute("data-originalLink",$link->getAttribute("href"));$link->setAttribute("href","data:text/css;charset=utf-8;base64,LypibGFuayov");}else{$link->setAttribute("data-originalLink","data:text/css;base64,".base64_encode($link->innertext));$link->innertext="";}}}foreach($contentNew->find("script[!type],script[type='text/javascript']")as $script){if($this->wordproIfIncluded($script->outertext,array("lazyload.min.js"))){$script->setAttribute("data-type","wordprolazyload");if($script->getAttribute("src")){$script->setAttribute("data-originalSrc",$script->getAttribute("src"));$script->removeAttribute("src");}else{$script->setAttribute("data-originalSrc","data:text/javascript;base64,".base64_encode($script->innertext));$script->innertext="";}}}return $contentNew;}catch(Exception $e){return $content;}}function addScriptAtFooter(){if(!is_user_logged_in()){ ?><script data-wpmeteor-nooptimize="true"src="data:text/javascript;base64,aWYobmF2aWdhdG9yLnVzZXJBZ2VudC5tYXRjaCgvZ3RtZXRyaXh8bGlnaHR8cGluZ3xkYXJlfHB0c3QvaSkpdmFyIEludGVyYWN0aW9uRXZlbnRzX1dvcmRQcm89WyJrZXlkb3duIiwibW91c2VvdmVyIiwidG91Y2htb3ZlIiwidG91Y2hzdGFydCIsInRvdWNoZW5kIiwidG91Y2hjYW5jZWwiLCJ0b3VjaGZvcmNlY2hhbmdlIiwid2hlZWwiXTtlbHNlIHZhciBJbnRlcmFjdGlvbkV2ZW50c19Xb3JkUHJvPVsibG9hZCJdO2Z1bmN0aW9uIERvX3NvbWVfbWFnaWMoKXtkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCJsaW5rW2RhdGEtdHlwZT0nd29yZHByb2xhenlsb2FkJ10iKS5mb3JFYWNoKGZ1bmN0aW9uKGEpe2Euc2V0QXR0cmlidXRlKCJocmVmIixhLmdldEF0dHJpYnV0ZSgiZGF0YS1vcmlnaW5hbExpbmsiKSl9KSxzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7ZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgic2NyaXB0W2RhdGEtdHlwZT0nd29yZHByb2xhenlsb2FkJ10iKS5mb3JFYWNoKGZ1bmN0aW9uKGEpe2Euc2V0QXR0cmlidXRlKCJzcmMiLGEuZ2V0QXR0cmlidXRlKCJkYXRhLW9yaWdpbmFsU3JjIikpfSl9LDIwMCl9ZnVuY3Rpb24gbG9hZFdvcmRQcm9fU2NyaXB0KCl7RG9fc29tZV9tYWdpYygpLEludGVyYWN0aW9uRXZlbnRzX1dvcmRQcm8uZm9yRWFjaChmdW5jdGlvbihhKXt3aW5kb3cucmVtb3ZlRXZlbnRMaXN0ZW5lcihhLGxvYWRXb3JkUHJvX1NjcmlwdCx7cGFzc2l2ZTohMH0pfSl9SW50ZXJhY3Rpb25FdmVudHNfV29yZFByby5mb3JFYWNoKGZ1bmN0aW9uKGEpe3dpbmRvdy5hZGRFdmVudExpc3RlbmVyKGEsbG9hZFdvcmRQcm9fU2NyaXB0LHtwYXNzaXZlOiEwfSl9KQ=="async></script><?php }}function wpmeteorDelayExecute(){ ?><script data-wpmeteor-nooptimize="true"src="data:text/javascript;base64,aWYobmF2aWdhdG9yLnVzZXJBZ2VudC5tYXRjaCgvZ3RtZXRyaXh8bGlnaHR8cGluZ3xkYXJlfHB0c3QvaSkpewoJX3dwbWV0ZW9yWydyZGVsYXknXSA9IDg2NDAwMDAwOwp9"></script> <?php }}new ultimateSpeedAddOn();