PluginProbe
Autoptimize / 0.4
Autoptimize v0.4
2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 All 107 releases
autoptimize / classes / autoptimizeBase.php

autoptimizeBase.php in Autoptimize 0.4, at classes/autoptimizeBase.php

38 lines 747 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 abstract class autoptimizeBase
4 {
5 protected $content = '';
6
7 public function __construct($content)
8 {
9 $this->content = $content;
10 //Best place to catch errors
11 }
12
13 //Reads the page and collects tags
14 abstract public function read();
15
16 //Joins and optimizes collected things
17 abstract public function minify();
18
19 //Caches the things
20 abstract public function cache();
21
22 //Returns the content
23 abstract public function getcontent();
24
25 //Converts an URL to a full path
26 protected function getpath($url)
27 {
28 $path = str_replace(get_settings('home'),'',$url);
29 if(preg_match('#^(https?|ftp)://#i',$path))
30 {
31 //External script (adsense, etc)
32 return false;
33 }
34 $path = str_replace('//','/',ABSPATH.$path);
35 return $path;
36 }
37 }
38