PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-beta
Jetpack – WP Security, Backup, Speed, & Growth v16.3-beta
16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 All 507 releases
← All changes | jetpack_vendor/automattic/jetpack-waf/src/class-waf-cli.php +7 -2 13.2.4 → 16.3-beta View file →
@@ -9,8 +9,12 @@
9 9
10 10 use WP_CLI;
11 11 use WP_CLI_Command;
12 12
13 +if ( ! defined( 'ABSPATH' ) ) {
14 + exit( 0 );
15 +}
16 +
13 17 /**
14 18 * Set up the WAF, change its mode, or generate its rules.
15 19 */
16 20 class CLI extends WP_CLI_Command {
@@ -114,9 +118,9 @@
114 118 )
115 119 );
116 120 }
117 121
118 - return WP_CLI::success( __( 'Jetpack WAF has successfully been setup.', 'jetpack-waf' ) );
122 + return WP_CLI::success( __( 'Jetpack WAF has successfully been set up.', 'jetpack-waf' ) );
119 123 }
120 124
121 125 /**
122 126 * Delete the WAF options.
@@ -141,8 +145,9 @@
141 145 * @throws WP_CLI\ExitException If there is an error switching the mode.
142 146 */
143 147 public function generate_rules() {
144 148 try {
149 + Waf_Constants::define_entrypoint();
145 150 Waf_Rules_Manager::generate_automatic_rules();
146 151 Waf_Rules_Manager::generate_rules();
147 152 } catch ( \Exception $e ) {
148 153
@@ -158,9 +163,9 @@
158 163 return WP_CLI::success(
159 164 sprintf(
160 165 /* translators: %1$s is the name of the mode that was just switched to. */
161 166 __( 'Jetpack WAF rules successfully created to: "%1$s".', 'jetpack-waf' ),
162 - Waf_Runner::get_waf_file_path( Waf_Rules_Manager::RULES_ENTRYPOINT_FILE )
167 + Waf_Runner::get_waf_file_path( JETPACK_WAF_ENTRYPOINT )
163 168 )
164 169 );
165 170 }
166 171 }