Skip to content

Commit 2886056

Browse files
feat(*): Change path of plugin in some doc and comment
1 parent ce216bc commit 2886056

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

.github/workflows/end-to-end-auto-prepend-test-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
cp .ddev/custom_files/phpinfo.php phpinfo.php
131131
curl -v https://${{ env.WP_VERSION_CODE }}.ddev.site/phpinfo.php
132132
PREPENDVERIF=$(curl https://${{ env.WP_VERSION_CODE }}.ddev.site/phpinfo.php | grep -o -E "auto_prepend_file=(.*)php(.*)" | sed 's/<\/tr>//g; s/<\/td>//g;' | tr '\n' '#')
133-
if [[ $PREPENDVERIF == "auto_prepend_file=/var/www/html/wp-content/plugins/cs-wordpress-bouncer/inc/standalone-bounce.php#auto_prepend_file=/var/www/html/wp-content/plugins/cs-wordpress-bouncer/inc/standalone-bounce.php#" ]]
133+
if [[ $PREPENDVERIF == "auto_prepend_file=/var/www/html/wp-content/plugins/crowdsec/inc/standalone-bounce.php#auto_prepend_file=/var/www/html/wp-content/plugins/crowdsec/inc/standalone-bounce.php#" ]]
134134
then
135135
echo "AUTO PREPEND FILE OK"
136136
else

docs/USER_GUIDE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Choose between `Country` and `City`.
263263

264264
`Geolocation → Path to the MaxMind database`
265265

266-
Relative path from `wp-content/plugins/cs-wordpress-bouncer/geolocation` folder.
266+
Relative path from `wp-content/plugins/crowdsec/geolocation` folder.
267267

268268
***
269269

@@ -285,7 +285,7 @@ See the `Geolocation cache lifetime` setting above to set the lifetime of this r
285285

286286
Enable if you want to see some debug information in a specific log file.
287287

288-
When this mode is enabled, a `debug.log` file will be written in a `wp-content/plugins/cs-wordpress-bouncer/logs`
288+
When this mode is enabled, a `debug.log` file will be written in a `wp-content/plugins/crowdsec/logs`
289289
sub folder.
290290
Note that by default, there is always a `prod.log` file in the same folder.
291291

@@ -343,7 +343,7 @@ Adding an `auto_prepend_file` directive can be done in different ways:
343343

344344
You should add this line to a `.ini` file :
345345

346-
auto_prepend_file = /wordpress-root-directory/wp-content/plugins/cs-wordpress-bouncer/inc/standalone-bounce.php
346+
auto_prepend_file = /wordpress-root-directory/wp-content/plugins/crowdsec/inc/standalone-bounce.php
347347

348348

349349
#### Nginx
@@ -357,15 +357,15 @@ location ~ \.php$ {
357357
...
358358
...
359359
...
360-
fastcgi_param PHP_VALUE "/wordpress-root-directory/wp-content/plugins/cs-wordpress-bouncer/inc/standalone-bounce.php";
360+
fastcgi_param PHP_VALUE "/wordpress-root-directory/wp-content/plugins/crowdsec/inc/standalone-bounce.php";
361361
}
362362
```
363363

364364
#### Apache
365365

366366
If you are using Apache, you should add this line to your `.htaccess` file:
367367

368-
php_value auto_prepend_file "/wordpress-root-directory/wp-content/plugins/cs-wordpress-bouncer/inc/standalone-bounce.php"
368+
php_value auto_prepend_file "/wordpress-root-directory/wp-content/plugins/crowdsec/inc/standalone-bounce.php"
369369

370370

371371

inc/Bounce.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ public function shouldBounceCurrentIp(): bool
262262

263263
if (!$this->isConfigValid()) {
264264
// We bounce only if plugin config is valid
265+
$this->logger->warning('', [
266+
'type' => 'WP_BAD_CONFIG',
267+
'message' => 'Will not bounce as config is not valid',
268+
]);
265269
return false;
266270
}
267271

inc/admin/advanced-settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ function convertInlineIpRangesToComparableIpBounds(string $inlineIpRanges): arra
325325

326326
addFieldString('crowdsec_geolocation_maxmind_database_path', 'Path to the MaxMind database', 'crowdsec_plugin_advanced_settings', 'crowdsec_advanced_settings', 'crowdsec_admin_advanced_geolocation', function ($input) {
327327
return $input;
328-
}, '<p>Relative path from <i>wp-content/plugins/cs-wordpress-bouncer/geolocation</i> folder</p>', 'GeoLite2-Country.mmdb', '');
328+
}, '<p>Relative path from <i>wp-content/plugins/crowdsec/geolocation</i> folder</p>', 'GeoLite2-Country.mmdb', '');
329329

330330
addFieldCheckbox('crowdsec_geolocation_save_result', 'Save geolocalized country in cache', 'crowdsec_plugin_advanced_settings',
331331
'crowdsec_advanced_settings', 'crowdsec_admin_advanced_geolocation', function () {}, function () {}, '
@@ -342,7 +342,7 @@ function convertInlineIpRangesToComparableIpBounds(string $inlineIpRanges): arra
342342

343343
// Field "crowdsec_debug_mode"
344344
addFieldCheckbox('crowdsec_debug_mode', 'Enable debug mode', 'crowdsec_plugin_advanced_settings', 'crowdsec_advanced_settings', 'crowdsec_admin_advanced_debug', function () {}, function () {}, '
345-
<p>Should not be used in production.<br>When this mode is enabled, a debug.log file will be written in the <i>wp-content/plugins/cs-wordpress-bouncer/logs</i> folder.<br> Note that by default, there is always a prod.log file in the same folder.</p>');
345+
<p>Should not be used in production.<br>When this mode is enabled, a debug.log file will be written in the <i>wp-content/plugins/crowdsec/logs</i> folder.<br> Note that by default, there is always a prod.log file in the same folder.</p>');
346346

347347
/*******************************
348348
** Section "Display errors" **

0 commit comments

Comments
 (0)