Skip to content

Commit

Permalink
- Adding new config option: amp_exclusions_enable (default is enabl…
Browse files Browse the repository at this point in the history
…ed). This improves compatibility with [Accelerated Mobile Pages](https://www.ampproject.org/). When this option is enabled and the URI being compressed ends with `/amp/`, or the document contains a top-level `<html ⚡>` tag (`<html amp>` is accepted as well), then features which are incompatible with [Accelerated Mobile Pages](https://www.ampproject.org/) will be disabled accordingly, regardless of your other settings. See [Issue #695](wpsharks/comet-cache#695) in the Comet Cache repo.

- Adding `isDocAmpd()` conditional check against current URI & document.
- Adding automatic AMP feature exclusions for improved AMP compatibility.
- Optimizing for speed by removing unnecessary calls to `unset()`.
- Enhancing unicode compatibility by taking full advantage of all `mb_*()` functions.
- Adding multibyte compatible `pregQuote()`.
- Adding multibyte compatible `replaceOnce()`.
- Adding multibyte compatible `substrReplace()`.
- Updating all regex patterns to add the `/u` flag for unicode compatibility.
- Updating minimum PHP requirement. Now requires PHP v5.4+ in support of short array syntax `[]`.
  • Loading branch information
jaswsinc committed Dec 7, 2016
1 parent 424dc37 commit 3543679
Show file tree
Hide file tree
Showing 7 changed files with 444 additions and 422 deletions.
2 changes: 1 addition & 1 deletion .build.props
Expand Up @@ -11,5 +11,5 @@ project_sub_namespace = HtmlCompressor

project_version = %y%m%d

project_php_required_version = 5.3.2
project_php_required_version = 5.4
project_php_tested_up_to_version = ${php.version}
13 changes: 13 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,16 @@
## $v

- Adding new config option: `amp_exclusions_enable` (default is enabled). This improves compatibility with [Accelerated Mobile Pages](https://www.ampproject.org/). When this option is enabled and the URI being compressed ends with `/amp/`, or the document contains a top-level `<html ⚡>` tag (`<html amp>` is accepted as well), then features which are incompatible with [Accelerated Mobile Pages](https://www.ampproject.org/) will be disabled accordingly, regardless of your other settings. See [Issue #695](https://github.com/websharks/comet-cache/issues/695) in the Comet Cache repo.
- Adding `isDocAmpd()` conditional check against current URI & document.
- Adding automatic AMP feature exclusions for improved AMP compatibility.
- Optimizing for speed by removing unnecessary calls to `unset()`.
- Enhancing unicode compatibility by taking full advantage of all `mb_*()` functions.
- Adding multibyte compatible `pregQuote()`.
- Adding multibyte compatible `replaceOnce()`.
- Adding multibyte compatible `substrReplace()`.
- Updating all regex patterns to add the `/u` flag for unicode compatibility.
- Updating minimum PHP requirement. Now requires PHP v5.4+ in support of short array syntax `[]`.

## v161108

- **Enhancing Exclusion Tests:** Now testing exclusion rules against full open tag instead of only the CSS or JS URL and content. This allows for exclusion rules that exclude CSS or JS based on an opening tag attribute; e.g., `<style id='rs-plugin-settings-inline-css'`. See also: [this Comet Cache issue](https://github.com/websharks/comet-cache/issues/614).
Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -346,6 +346,8 @@ e.g., `new WebSharks\HtmlCompressor\Core($options);`
please set this to a FALSE value. This can be helpful if your site (for whatever reason) is incompatible with the HTML compression routines.
NOTE: if you disable this due to an incompatibility, please report it via GitHub so the issue can be resolved for everyone.

- (boolean)`amp_exclusions_enable` TRUE by default. This improves compatibility with [Accelerated Mobile Pages](https://www.ampproject.org/). When this option is enabled and the URI being compressed ends with `/amp/`, or the document contains a top-level `<html ⚡>` tag (`<html amp>` is accepted as well), then features which are incompatible with [Accelerated Mobile Pages](https://www.ampproject.org/) will be disabled accordingly, regardless of your other settings.

----

##### Other misc. options. These don't really fall into any specific category yet.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -28,7 +28,7 @@
},

"require": {
"php": ">=5.3",
"php": ">=5.4",
"ext-openssl": "*",
"ext-curl": "*",
"ext-mbstring": "*",
Expand Down
8 changes: 4 additions & 4 deletions src/includes/classes/Benchmark.php
Expand Up @@ -16,18 +16,18 @@ class Benchmark // For debugging.
*/

/**
* @type array An array of times.
* @var array An array of times.
*
* @since 150315 Enhancing debugger.
*/
protected $times = array();
protected $times = [];

/**
* @type array An array of data.
* @var array An array of data.
*
* @since 150315 Enhancing debugger.
*/
protected $data = array();
protected $data = [];

/*
* Public API Methods
Expand Down

0 comments on commit 3543679

Please sign in to comment.