-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #426 from wp-media/branch-3.0
2.10
- Loading branch information
Showing
175 changed files
with
40,559 additions
and
23,172 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
# PHPUnit files | ||
.travis.yml export-ignore | ||
bin export-ignore | ||
tests/bootstrap.php export-ignore | ||
tests/test-sample.php export-ignore | ||
tests/inc export-ignore | ||
phpunit.xml export-ignore | ||
tests export-ignore | ||
README.md export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
phpcs.xml export-ignore | ||
.tx export-ignore |
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 +1,2 @@ | ||
/node_modules/ | ||
getpomakemo.sh |
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,8 @@ | ||
[main] | ||
host = https://www.transifex.com | ||
|
||
[wp-rocket.rocket] | ||
file_filter = languages/rocket-<lang>.po | ||
source_file = languages/rocket.pot | ||
source_lang = en | ||
type = PO |
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,45 +1,58 @@ | ||
<?php | ||
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' ); | ||
defined( 'ABSPATH' ) or die( 'Cheatin’ uh?' ); | ||
|
||
/** | ||
* Conflict with Age Verify: don't cache pages until to have the age-verified cookie | ||
* Conflict with Age Verify: don't cache pages until the age-verified cookie is set | ||
* | ||
* @since 2.7 | ||
*/ | ||
if ( class_exists( 'Age_Verify' ) && defined( 'Age_Verify::SLUG' ) ) : | ||
|
||
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false' ); | ||
add_filter( 'rocket_cache_mandatory_cookies', '__rocket_add_cache_mandatory_cookie_for_age_verify' ); | ||
|
||
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false' ); | ||
add_filter( 'rocket_cache_mandatory_cookies', 'rocket_add_cache_mandatory_cookie_for_age_verify' ); | ||
endif; | ||
|
||
// Add age-verified to the list of mandatory cookies | ||
function __rocket_add_cache_mandatory_cookie_for_age_verify( $cookies ) { | ||
/** | ||
* Add age-verified to the list of mandatory cookies | ||
* | ||
* @since 2.7 | ||
* | ||
* @param Array $cookies Array of mandatory cookies. | ||
* @return Array Updated array of mandatory cookies | ||
*/ | ||
function rocket_add_cache_mandatory_cookie_for_age_verify( $cookies ) { | ||
$cookies[] = 'age-verified'; | ||
return $cookies; | ||
} | ||
|
||
// Add age-verified cookie when we activate the plugin | ||
add_action( 'activate_age-verify/age-verify.php' , '__rocket_activate_age_verify', 11 ); | ||
function __rocket_activate_age_verify() { | ||
/** | ||
* Add age-verified cookie when we activate the plugin | ||
* | ||
* @since 2.7 | ||
*/ | ||
function rocket_activate_age_verify() { | ||
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false' ); | ||
add_filter( 'rocket_cache_mandatory_cookies', '__rocket_add_cache_mandatory_cookie_for_age_verify' ); | ||
// Update the WP Rocket rules on the .htaccess file | ||
add_filter( 'rocket_cache_mandatory_cookies', 'rocket_add_cache_mandatory_cookie_for_age_verify' ); | ||
|
||
// Update the WP Rocket rules on the .htaccess file. | ||
flush_rocket_htaccess(); | ||
// Regenerate the config file | ||
|
||
// Regenerate the config file. | ||
rocket_generate_config_file(); | ||
} | ||
add_action( 'activate_age-verify/age-verify.php' , 'rocket_activate_age_verify', 11 ); | ||
|
||
/** | ||
* Remove age-verified cookie when we deactivate the plugin | ||
* | ||
* @since 2.7 | ||
*/ | ||
function rocket_deactivate_age_verify() { | ||
remove_filter( 'rocket_cache_mandatory_cookies', 'rocket_add_cache_mandatory_cookie_for_age_verify' ); | ||
|
||
// Remove age-verified cookie when we deactivate the plugin | ||
add_action( 'deactivate_age-verify/age-verify.php' , '__rocket_deactivate_age_verify', 11 ); | ||
function __rocket_deactivate_age_verify() { | ||
remove_filter( 'rocket_cache_mandatory_cookies', '__rocket_add_cache_mandatory_cookie_for_age_verify' ); | ||
|
||
// Update the WP Rocket rules on the .htaccess file | ||
// Update the WP Rocket rules on the .htaccess file. | ||
flush_rocket_htaccess(); | ||
// Regenerate the config file | ||
|
||
// Regenerate the config file. | ||
rocket_generate_config_file(); | ||
} | ||
} | ||
add_action( 'deactivate_age-verify/age-verify.php' , 'rocket_deactivate_age_verify', 11 ); |
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,54 +1,92 @@ | ||
<?php | ||
defined( 'ABSPATH' ) or die( 'Cheatin’ uh?' ); | ||
|
||
if ( defined( 'AIOSEOP_VERSION' ) ) : | ||
$all_in_one_seo_xml_options = get_option( 'aioseop_options' ); | ||
$all_in_one_seo_xml_options = get_option( 'aioseop_options' ); | ||
/** | ||
* Improvement with All in One SEO Pack: auto-detect the XML sitemaps for the preload option | ||
* | ||
* @since 2.8 | ||
* @author Remy Perona | ||
*/ | ||
if ( isset( $all_in_one_seo_xml_options['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_sitemap'] ) && 'on' === $all_in_one_seo_xml_options['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_sitemap'] ) { | ||
add_filter( 'rocket_first_install_options', '__rocket_add_all_in_one_seo_sitemap_option' ); | ||
function __rocket_add_all_in_one_seo_sitemap_option( $options ) { | ||
$options['all_in_one_seo_xml_sitemap'] = 0; | ||
if ( isset( $all_in_one_seo_xml_options['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_sitemap'] ) && 'on' === $all_in_one_seo_xml_options['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_sitemap'] ) { | ||
/** | ||
* Add All in One SEO Sitemap option to WP Rocket options | ||
* | ||
* @since 2.8 | ||
* @author Remy Perona | ||
* | ||
* @param Array $options Array of WP Rocket options. | ||
* @return Array Updated array of WP Rocket options | ||
*/ | ||
function rocket_add_all_in_one_seo_sitemap_option( $options ) { | ||
$options['all_in_one_seo_xml_sitemap'] = 0; | ||
|
||
return $options; | ||
} | ||
return $options; | ||
} | ||
add_filter( 'rocket_first_install_options', 'rocket_add_all_in_one_seo_sitemap_option' ); | ||
|
||
add_filter( 'rocket_inputs_sanitize', '__rocket_all_in_one_seo_sitemap_option_sanitize' ); | ||
function __rocket_all_in_one_seo_sitemap_option_sanitize( $inputs ) { | ||
$inputs['all_in_one_seo_xml_sitemap'] = ! empty( $inputs['all_in_one_seo_xml_sitemap'] ) ? 1 : 0; | ||
/** | ||
* Sanitize the AIO SEO option value | ||
* | ||
* @since 2.8 | ||
* @author Remy Perona | ||
* | ||
* @param Array $inputs Array of inputs values. | ||
* @return Array Updated array of inputs $values | ||
*/ | ||
function rocket_all_in_one_seo_sitemap_option_sanitize( $inputs ) { | ||
$inputs['all_in_one_seo_xml_sitemap'] = ! empty( $inputs['all_in_one_seo_xml_sitemap'] ) ? 1 : 0; | ||
|
||
return $inputs; | ||
} | ||
return $inputs; | ||
} | ||
add_filter( 'rocket_inputs_sanitize', 'rocket_all_in_one_seo_sitemap_option_sanitize' ); | ||
|
||
add_filter( 'rocket_sitemap_preload_list', '__rocket_add_all_in_one_seo_sitemap' ); | ||
function __rocket_add_all_in_one_seo_sitemap( $sitemaps ) { | ||
if ( get_rocket_option( 'all_in_one_seo_xml_sitemap', false ) ) { | ||
$all_in_one_seo_xml = get_option( 'aioseop_options' ); | ||
$sitemaps[] = trailingslashit( home_url() ) . $all_in_one_seo_xml['modules']['aiosp_sitemap_options']['aiosp_sitemap_filename'] . '.xml'; | ||
} | ||
/** | ||
* Add All in One SEO Sitemap to the preload list | ||
* | ||
* @since 2.8 | ||
* @author Remy Perona | ||
* | ||
* @param Array $sitemaps Array of sitemaps to preload. | ||
* @return Array Updated array of sitemaps to preload | ||
*/ | ||
function rocket_add_all_in_one_seo_sitemap( $sitemaps ) { | ||
if ( get_rocket_option( 'all_in_one_seo_xml_sitemap', false ) ) { | ||
$all_in_one_seo_xml = get_option( 'aioseop_options' ); | ||
$sitemaps[] = trailingslashit( home_url() ) . $all_in_one_seo_xml['modules']['aiosp_sitemap_options']['aiosp_sitemap_filename'] . '.xml'; | ||
} | ||
|
||
return $sitemaps; | ||
} | ||
return $sitemaps; | ||
} | ||
add_filter( 'rocket_sitemap_preload_list', 'rocket_add_all_in_one_seo_sitemap' ); | ||
|
||
add_filter( 'rocket_sitemap_preload_options', '__rocket_sitemap_preload_all_in_one_seo_option' ); | ||
function __rocket_sitemap_preload_all_in_one_seo_option( $options ) { | ||
$options[] = array( | ||
'parent' => 'sitemap_preload', | ||
'type' => 'checkbox', | ||
'label' => __('All in One SEO XML sitemap', 'rocket' ), | ||
'label_for' => 'all_in_one_seo_xml_sitemap', | ||
'label_screen' => sprintf( __( 'Preload the sitemap from the %s plugin', 'rocket' ), 'All in One SEO Pack' ), | ||
'default' => 0, | ||
); | ||
$options[] = array( | ||
'parent' => 'sitemap_preload', | ||
'type' => 'helper_description', | ||
'name' => 'all_in_one_seo_xml_sitemap_desc', | ||
'description' => sprintf( __( 'We automatically detected the sitemap generated by the %s plugin. You can check the option to preload it.', 'rocket' ), 'All in One SEO Pack' ) | ||
); | ||
return $options; | ||
} | ||
} | ||
endif; | ||
/** | ||
* Add All in One SEO Sitemap sub-option on WP Rocket settings page | ||
* | ||
* @since 2.8 | ||
* @author Remy Perona | ||
* | ||
* @param Array $options Array of WP Rocket options. | ||
* @return Array Updated array of WP Rocket options | ||
*/ | ||
function rocket_sitemap_preload_all_in_one_seo_option( $options ) { | ||
$options[] = array( | ||
'parent' => 'sitemap_preload', | ||
'type' => 'checkbox', | ||
'label' => __( 'All in One SEO XML sitemap', 'rocket' ), | ||
'label_for' => 'all_in_one_seo_xml_sitemap', | ||
'label_screen' => sprintf( __( 'Preload the sitemap from the %s plugin', 'rocket' ), 'All in One SEO Pack' ), | ||
'default' => 0, | ||
); | ||
$options[] = array( | ||
'parent' => 'sitemap_preload', | ||
'type' => 'helper_description', | ||
'name' => 'all_in_one_seo_xml_sitemap_desc', | ||
'description' => sprintf( __( 'We automatically detected the sitemap generated by the %s plugin. You can check the option to preload it.', 'rocket' ), 'All in One SEO Pack' ), | ||
); | ||
return $options; | ||
} | ||
add_filter( 'rocket_sitemap_preload_options', 'rocket_sitemap_preload_all_in_one_seo_option' ); | ||
} | ||
endif; |
Oops, something went wrong.