Skip to content

Commit

Permalink
Release 3.15.6 (PR #6306)
Browse files Browse the repository at this point in the history
  • Loading branch information
wordpressfan authored Dec 5, 2023
2 parents 83c269c + c20ce3a commit fa9eeed
Show file tree
Hide file tree
Showing 24 changed files with 611 additions and 420 deletions.
4 changes: 4 additions & 0 deletions assets/js/wpr-admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/wpr-admin.js.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/wpr-admin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dynamic-lists.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ public function i18n_multidomain_url( $url ) {
return $url;
}

return str_replace( $url_host, sanitize_text_field( $_SERVER['HTTP_HOST'] ), $url ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
return preg_replace( '/' . preg_quote( $url_host, '/' ) . '/', sanitize_text_field( $_SERVER['HTTP_HOST'] ), $url, 1 ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
}
}
1 change: 1 addition & 0 deletions inc/Engine/Optimization/RUCSS/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ public function add_localize_script_data( $data ): array {
}

$data['notice_end_time'] = $transient;
$data['cron_disabled'] = rocket_get_constant( 'DISABLE_WP_CRON', false );

return $data;
}
Expand Down
4 changes: 4 additions & 0 deletions inc/Engine/Optimization/RUCSS/Admin/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,10 @@ private function set_notice_transient() {
* @return void
*/
public function spawn_cron() {
if ( rocket_get_constant( 'DISABLE_WP_CRON', false ) ) {
return;// Bailout and don't fire the CRON.
}

check_ajax_referer( 'rocket-ajax', 'nonce' );

if ( ! current_user_can( 'rocket_manage_options' ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class DefaultProcess implements StrategyInterface {
2 => 300, // 5 minutes
3 => 600, // 10 minutes.
4 => 1200, // 20 minutes.
5 => 1800, // 30 minutes.
5 => 1500, // 25 minutes.
];

/**
* Default value to wait before a retry.
*
* @var int
*/
private $default_waiting_retry = 1800;
private $default_waiting_retry = 1500;

/**
* Strategy Constructor.
Expand Down
1 change: 1 addition & 0 deletions inc/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ private function init_common_subscribers() {
'lazyload_css_subscriber',
'shoptimizer',
'weglot',
'contactform7',
];

$host_type = HostResolver::get_host_service();
Expand Down
61 changes: 61 additions & 0 deletions inc/ThirdParty/Plugins/ContactForm7.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
namespace WP_Rocket\ThirdParty\Plugins;

use WP_Rocket\Event_Management\Subscriber_Interface;

class ContactForm7 implements Subscriber_Interface {

/**
* Required CF6 version.
*
* Version in which the wpcf7_shortcode_callback action was introduced.
*
* @var string
*/
const REQUIRED_CF7_VERSION = '5.8.1';

/**
* Subscribed events.
*/
public static function get_subscribed_events() {
return [
'template_redirect' => [ 'maybe_optimize_contact_form_7', 10 ],
];
}

/**
* Optimize ContactForm7 scripts.
*/
public function maybe_optimize_contact_form_7() {
// The wpcf7_shortcode_callback action was added in CF7 version 5.8.1.
if ( ! defined( 'WPCF7_VERSION' ) || version_compare( WPCF7_VERSION, self::REQUIRED_CF7_VERSION, '<' ) ) {
return;
}

// Force scripts and styles to not load by default.
add_filter( 'wpcf7_load_js', '__return_false', PHP_INT_MAX );
add_filter( 'wpcf7_load_css', '__return_false', PHP_INT_MAX );

// Conditionally enqueue scripts.
add_action( 'wpcf7_shortcode_callback', [ $this, 'conditionally_enqueue_scripts' ] );
add_action( 'wpcf7_shortcode_callback', [ $this, 'conditionally_enqueue_styles' ] );
}

/**
* Enqueue scripts if not already enqueued.
*/
public function conditionally_enqueue_scripts() {
if ( ! did_action( 'wpcf7_enqueue_scripts' ) ) { // Prevent double-enqueueing when multiple forms present.
wpcf7_enqueue_scripts();
}
}

/**
* Enqueue styles if not already enqueued.
*/
public function conditionally_enqueue_styles() {
if ( ! did_action( 'wpcf7_enqueue_styles' ) ) { // Prevent double-enqueueing when multiple forms present.
wpcf7_enqueue_styles();
}
}
}
3 changes: 3 additions & 0 deletions inc/ThirdParty/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use WP_Rocket\ThirdParty\Plugins\CDN\{Cloudflare, CloudflareFacade};
use WP_Rocket\ThirdParty\Plugins\Jetpack;
use WP_Rocket\ThirdParty\Plugins\WPGeotargeting;
use WP_Rocket\ThirdParty\Plugins\ContactForm7;
use WP_Rocket\ThirdParty\Plugins\SEO\RankMathSEO;
use WP_Rocket\ThirdParty\Plugins\SEO\AllInOneSEOPack;
use WP_Rocket\ThirdParty\Plugins\SEO\SEOPress;
Expand Down Expand Up @@ -103,6 +104,7 @@ class ServiceProvider extends AbstractServiceProvider {
'translatepress',
'wpgeotargeting',
'weglot',
'contactform7',
];

/**
Expand Down Expand Up @@ -261,5 +263,6 @@ public function register() {
->share( 'weglot', Weglot::class );
$this->getContainer()->share( 'translatepress', TranslatePress::class );
$this->getContainer()->share( 'wpgeotargeting', WPGeotargeting::class );
$this->getContainer()->share( 'contactform7', ContactForm7::class );
}
}
Binary file modified languages/rocket-de_DE.mo
Binary file not shown.
9 changes: 4 additions & 5 deletions languages/rocket-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
# Caspar Hübinger, 2020
# Rico Michael <[email protected]>, 2021
# Ben_Mew <[email protected]>, 2023
# Romain • WP Rocket <[email protected]>, 2023
# Christian Herrmann, 2023
# Romain • WP Rocket <[email protected]>, 2023
#
msgid ""
msgstr ""
"Project-Id-Version: WP Rocket 3.15.1-alpha1\n"
"Report-Msgid-Bugs-To: http://wp-rocket.me/\n"
"POT-Creation-Date: 2023-09-25T14:39:29+03:00\n"
"PO-Revision-Date: 2019-08-26 15:14+0000\n"
"Last-Translator: Christian Herrmann, 2023\n"
"Last-Translator: Romain • WP Rocket <[email protected]>, 2023\n"
"Language-Team: German (Germany) (https://app.transifex.com/wp-media/teams/18133/de_DE/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -557,9 +557,8 @@ msgid ""
"https://docs.wp-rocket.me/article/626-how-to-make-system-files-htaccess-wp-"
"config-writeable/?utm_source=wp_plugin&utm_medium=wp_rocket"
msgstr ""
"https://de.docs.wp-rocket.me/article/1042-fehlende-schreibrechte-fuer-"
"system-dateien-beheben-htaccess-wp-"
"configphp?utm_source=wp_plugin&utm_medium=wp_rocket"
"https://docs.wp-rocket.me/article/626-how-to-make-system-files-htaccess-wp-"
"config-writeable/?utm_source=wp_plugin&utm_medium=wp_rocket"

#: inc/admin/ui/notices.php:311
msgid ""
Expand Down
Binary file modified languages/rocket-fa_IR.mo
Binary file not shown.
Loading

0 comments on commit fa9eeed

Please sign in to comment.