-
Notifications
You must be signed in to change notification settings - Fork 227
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
24 changed files
with
611 additions
and
420 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,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(); | ||
} | ||
} | ||
} |
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
Binary file not shown.
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 |
---|---|---|
|
@@ -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" | ||
|
@@ -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 "" | ||
|
Binary file not shown.
Oops, something went wrong.