Changeset 1693698
- Timestamp:
- 07/10/2017 12:26:21 PM (9 years ago)
- Location:
- optimality/trunk
- Files:
-
- 3 edited
-
index.php (modified) (8 diffs)
-
markup/html.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
optimality/trunk/index.php
r1688780 r1693698 5 5 * Plugin URI: https://wordpress.org/plugins/optimality 6 6 * Description: Optimizes website's content delivery, images, database, permalink structure, search engines and social media markup. 7 * Version: 0. 5.17 * Version: 0.6.0 8 8 * License: GPLv2 or later 9 9 * Author: Optimality … … 23 23 require_once('markup/comment.php'); 24 24 require_once('markup/media.php'); 25 require_once('markup/error.php'); 25 26 require_once('markup/sitemap.php'); 26 27 … … 57 58 Html::PREDNS => NULL, 58 59 Html::MINIFY => NULL, 59 Html:: STATIC=> NULL,60 Html::CACHE => NULL, 60 61 Style::MINIFY => NULL, 61 62 Style::CDNLIB => NULL, … … 80 81 User::UNLINK => NULL, 81 82 Media::UNLINK => NULL, 83 Error::PARENT => NULL, 82 84 83 85 Site::SEMETA => NULL, … … 260 262 case is_archive() : $markup = Html::class; break; 261 263 case is_sitemap() : $markup = Sitemap::class; break; 264 case is_404() : $markup = Error::class; break; 262 265 default : return; 263 266 } … … 273 276 $method = strtoupper(@$_SERVER['REQUEST_METHOD']); 274 277 275 if ($static = isset( $this->option[ Html:: STATIC] ) &&278 if ($static = isset( $this->option[ Html::CACHE ] ) && 276 279 $ishtml && empty($_REQUEST) && $method === 'GET' && 277 280 !is_user_logged_in() && !defined('DOING_CRON')) … … 335 338 $this->addOption(Html::PREDNS , __('Prefetch DNS' ), $module, 'binary', __('Reduce DNS lookup time by pre-resolving all external domains.')); 336 339 $this->addOption(Html::MINIFY , __('Optimize HTML' ), $module, 'binary', __('Remove comments, unnecessary whitespace and empty nodes.')); 337 $this->addOption(Html:: STATIC, __('Cache HTML' ), $module, 'binary', __('Cache dynamic HTML content and serve it as static HTML files.'));338 $this->addAction(Html:: STATIC, __('Clean HTML Cache' ), 'trash', [Html::class, 'cleanCache'], [Html::class, 'countCache']);340 $this->addOption(Html::CACHE , __('Cache HTML' ), $module, 'binary', __('Cache dynamic HTML content and serve it as static HTML files.')); 341 $this->addAction(Html::CACHE , __('Clean HTML Cache' ), 'trash', [Html::class, 'cleanCache'], [Html::class, 'countCache']); 339 342 $this->addOption(Style::MINIFY , __('Optimize Styles' ), $module, 'binary', __('Combine files, flatten imports, remove comments and cache.')); 340 343 $this->addAction(Style::MINIFY , __('Clean Style Cache' ), 'trash', [Style::class, 'cleanCache'], [Style::class, 'countCache']); … … 372 375 $this->addOption(Comment::UNLINK, __('Disable Reply Queries'), $module, 'binary', __('Redirect ?replytocom=id to #comment-id in comment replies.')); 373 376 $this->addOption(Comment::UNPAGE, __('Depaginate Comments' ), $module, 'binary', __('Redirect paginated comments to the URL of the parent page.')); 377 $this->addOption(Error::PARENT , __('Redirect 404 Errors' ), $module, 'binary', __('Redirect 404 error pages one level up in the website hierarchy.')); 374 378 375 379 $this->addModule($module = 'seo', __('Search Engines' )); -
optimality/trunk/markup/html.php
r1688620 r1693698 12 12 const PREDNS = 'html_predns'; 13 13 const MINIFY = 'html_minify'; 14 const STATIC= 'html_static';14 const CACHE = 'html_static'; 15 15 const CDNURL = 'html_cdnurl'; 16 16 const SEMETA = 'html_semeta'; … … 225 225 } 226 226 227 $this->root = $this->documentElement; 228 $this->head = @$this->root->childNodes[0]; 229 $this->body = @$this->root->childNodes[1]; 230 231 if (empty($this->head) || empty($this->body)) 232 { 233 return $string; 234 } 235 227 236 $schema = new \DOMXPath($this); $linked = [ ]; 228 229 $this->root = $this->documentElement;230 $this->head = $this->root->childNodes[0];231 $this->body = $this->root->childNodes[1];232 237 233 238 foreach ($schema->query('/html/head/meta') as $object) -
optimality/trunk/readme.txt
r1688780 r1693698 21 21 * Removes comments, unnecessary whitespace and empty nodes from HTML. 22 22 * Caches dynamic HTML content and serves it as static HTML files. 23 * Combines CSS files, flattens imports, removes comments and caches.23 * Combines styles, flattens imports, removes comments and caches. 24 24 * Serves popular CSS libraries from content delivery networks. 25 * Combines JS files, defers loading, removes comments and caches.25 * Combines scripts, defers loading, removes comments and caches. 26 26 * Serves popular JS libraries from content delivery networks. 27 27 * Strips metadata and compresses thumbnail images (requires ImageMagick). … … 44 44 * Redirects ?replytocom=id to #comment-id in comment replies. 45 45 * Redirects paginated comment pages to the parent page. 46 * Redirects 404 error pages one level up in the website hierarchy. 46 47 47 48 = Search Engines Optimization = … … 79 80 == Changelog == 80 81 82 = 0.6.0 = 83 * Feature: Redirect 404 error pages to the parent page 84 * Feature: Support for old versions of PHP (below 7.0) 85 81 86 = 0.5.1 = 82 87 * Bug Fix: Category names not appearing in post titles
Note: See TracChangeset
for help on using the changeset viewer.