-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
2,734 additions
and
1,252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "plugin:@wordpress/eslint-plugin/es5", | ||
"env": { | ||
"browser": true | ||
}, | ||
"rules": { | ||
"camelcase": 0, | ||
"vars-on-top": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
.idea/ | ||
.phpunit.result.cache | ||
css/*.min.css | ||
js/*.min.js | ||
vendor/ | ||
node_modules/ | ||
composer.lock | ||
package-lock.json | ||
phpunit.*.xml | ||
tests/coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Path to sources. | ||
sonar.sources=inc,js,css,cachify.php | ||
sonar.exclusions=**/*.min.css,**/*.min.js | ||
#sonar.inclusions= | ||
|
||
# Path to tests. | ||
sonar.tests=tests | ||
#sonar.test.exclusions= | ||
#sonar.test.inclusions= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"extends": "@wordpress/stylelint-config", | ||
"rules": { | ||
"declaration-property-unit-whitelist": null, | ||
"selector-id-pattern": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,9 @@ | ||
<?php | ||
/** | ||
* Proxy for APC based caching. | ||
* APC support was removed in Cachify 2.4.0 | ||
* | ||
* @package Cachify | ||
*/ | ||
|
||
if ( ! empty( $_COOKIE ) ) { | ||
foreach ( $_COOKIE as $k => $v ) { | ||
if ( preg_match( '/^(wp-postpass|wordpress_logged_in|comment_author)_/', $k ) ) { | ||
$_cachify_logged_in = true; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Determines if SSL is used. | ||
* This file is just here to not break any remaining "auto_prepend_file" configurations. | ||
* Will be removed with the next major update, so adjust your server's configuration, if you happen to read this notice. | ||
* | ||
* @see is_ssl() (wp-includes/load.php). | ||
* | ||
* @return bool True if SSL, otherwise false. | ||
* @package Cachify | ||
*/ | ||
function cachify_is_ssl() { | ||
if ( isset( $_SERVER['HTTPS'] ) ) { | ||
$https = filter_input( INPUT_SERVER, 'HTTPS', FILTER_SANITIZE_STRING ); | ||
if ( 'on' === strtolower( $https ) || '1' === $https ) { | ||
return true; | ||
} | ||
} elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' === $_SERVER['SERVER_PORT'] ) ) { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
if ( | ||
empty( $_cachify_logged_in ) | ||
&& extension_loaded( 'apc' ) | ||
&& ( strpos( filter_input( INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING ), '/wp-admin/' ) === false ) | ||
&& ( strpos( filter_input( INPUT_SERVER, 'HTTP_ACCEPT_ENCODING', FILTER_SANITIZE_STRING ), 'gzip' ) !== false ) | ||
) { | ||
$cache = apc_fetch( | ||
md5( | ||
( cachify_is_ssl() ? 'https-' : '' ) . | ||
filter_input( INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING ) . | ||
filter_input( INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL ) | ||
) . | ||
'.cachify' | ||
); | ||
if ( $cache ) { | ||
ini_set( 'zlib.output_compression', 'Off' ); | ||
|
||
header( 'Vary: Accept-Encoding' ); | ||
header( 'X-Powered-By: Cachify' ); | ||
header( 'Content-Encoding: gzip' ); | ||
header( 'Content-Length: ' . strlen( $cache ) ); | ||
header( 'Content-Type: text/html; charset=utf-8' ); | ||
|
||
echo $cache; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | ||
exit; | ||
} | ||
} |
Oops, something went wrong.