Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter rmayer

    (@rmayer)

    hey henningaa.

    Thank you for your response.

    I already enabled and disabled the plugin advanced-ads and the advanced-ads-pro with no change in behavior.

    What i do to make it work is creating my user on the specific site, but that doesnt scale, there are some sites and some new users every now and then so i need a solution to work with multisite.

    This works well until the update of those specific versions.

    I will try to contact support, but i also thing the developers of this plugin should know because that is a disrupted change for the people using multisite with superadmins.

    Thread Starter rmayer

    (@rmayer)

    Hey, thank you.

    That works as expected!

    And I agree, a warning would be nice to have!

    Thread Starter rmayer

    (@rmayer)

    Hey, thanks for your answer,

    Does that mean that ‘wordpress’ is the DB_NAME, ‘example username’ is DB_USER and ‘example password’ is DB_PASSWORD?

    NO, that is used if there is no env variable.
    I expect to use the value inside those variables, for that I redeclare the function that takes care of that.

    Further research and beta implementations:

    The issue is that NF [ninjafirewall] needs to initialize a DB connection before WordPress is initiated.

    That was done with some regex that looks for those string connections in wp-config but now it’s broken due the wordpress docker image consume a enviroment variable instead of hardcoded strings.

    I made a quick patch but I would like to have something more “reliable”.
    I apply this as a composer patch with cwegans and this allows me to upgrade core.

    https://gist.githubusercontent.com/renzit/4a7f1f17c7635c8f703d616fa02a2cdc/raw/37998098354b9010f37719bb32f242e9435e9ea8/gistfile1.patch

    diff --git a/lib/firewall.php b/lib/firewall.php
    index 8ed362b33..30e7e2568 100644
    --- a/lib/firewall.php
    +++ b/lib/firewall.php
    @@ -387,7 +387,32 @@ function nfw_connect() {
     		} elseif ( preg_match('/^\s*\$table_prefix\s*=\s*[\'"](.+?)[\'"]/', $nfw_['line'], $nfw_['match']) ) {
     			$nfw_['table_prefix'] = $nfw_['match'][1];
     		}
    +		if( strpos( $nfw_['line'], 'getenv_docker' )){
    +			if(preg_match("/define\( '(DB_.*?)', getenv_docker\(\'(.*WORDPRESS.*)\', \'(.*)'\)/", $nfw_['line'], $nfw_['match'])){
    +
    +				if (!function_exists('getenv_docker')) {
    +					// https://github.com/docker-library/wordpress/issues/588 (WP-CLI will load this file 2x)
    +					function getenv_docker($env, $default) {
    +						if ($fileEnv = getenv($env . '_FILE')) {
    +							return rtrim(file_get_contents($fileEnv), "\r\n");
    +						}
    +						else if (($val = getenv($env)) !== false) {
    +							return $val;
    +						}
    +						else {
    +							return $default;
    +						}
    +					}
    +				}
    +				$key_string_connection = $nfw_['match'][1];
    +				$env_constant = $nfw_['match'][2];
    +				$env_default =  $nfw_['match'][3];
    +				$nfw_[$key_string_connection] = getenv_docker($env_constant, $env_default);
    +				$nfw_['table_prefix'] = getenv_docker('WORDPRESS_TABLE_PREFIX', 'wp_');
    +			}
    +		}
     	}
    +
     	fclose($nfw_['fh']);
     	unset($wp_config);
     	if ( (! isset($nfw_['DB_NAME'])) || (! isset($nfw_['DB_USER'])) || (! isset($nfw_['DB_PASSWORD'])) ||	(! isset($nfw_['DB_HOST'])) || (! isset($nfw_['table_prefix'])) ) {
    • This reply was modified 3 years, 8 months ago by rmayer.
    • This reply was modified 3 years, 8 months ago by rmayer.
    Thread Starter rmayer

    (@rmayer)

    Here is the list of files and permissions.

    create mode 100755 LICENSE.txt
     create mode 100755 README.txt
     create mode 100755 assets/css/better-search-replace.css
     create mode 100755 assets/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png
     create mode 100755 assets/css/images/ui-bg_diagonals-thick_20_666666_40x40.png
     create mode 100755 assets/css/images/ui-bg_flat_10_000000_40x100.png
     create mode 100755 assets/css/images/ui-bg_glass_100_f6f6f6_1x400.png
     create mode 100755 assets/css/images/ui-bg_glass_100_fdf5ce_1x400.png
     create mode 100755 assets/css/images/ui-bg_glass_65_ffffff_1x400.png
     create mode 100755 assets/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
     create mode 100755 assets/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
     create mode 100755 assets/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
     create mode 100755 assets/css/images/ui-icons_222222_256x240.png
     create mode 100755 assets/css/images/ui-icons_228ef1_256x240.png
     create mode 100755 assets/css/images/ui-icons_ef8c08_256x240.png
     create mode 100755 assets/css/images/ui-icons_ffd27a_256x240.png
     create mode 100755 assets/css/images/ui-icons_ffffff_256x240.png
     create mode 100755 assets/css/jquery-ui.min.css
     create mode 100644 assets/img/bsr-logo-white.svg
     create mode 100644 assets/img/phil-gravatar.jpeg
     create mode 100644 assets/img/sidebar-upgrade.png
     create mode 100755 assets/index.php
     create mode 100644 assets/js/better-search-replace.js
     create mode 100644 assets/js/better-search-replace.min.js
     create mode 100755 better-search-replace.php
     create mode 100755 includes/class-bsr-admin.php
     create mode 100644 includes/class-bsr-ajax.php
     create mode 100644 includes/class-bsr-compatibility.php
     create mode 100644 includes/class-bsr-db.php
     create mode 100755 includes/class-bsr-i18n.php
     create mode 100755 includes/class-bsr-loader.php
     create mode 100755 includes/class-bsr-main.php
     create mode 100755 includes/index.php
     create mode 100755 index.php
     create mode 100644 languages/better-search-replace-de_DE.mo
     create mode 100644 languages/better-search-replace-de_DE.po
     create mode 100755 languages/better-search-replace-es_ES.mo
     create mode 100755 languages/better-search-replace-es_ES.po
     create mode 100755 languages/better-search-replace-fr_FR.mo
     create mode 100755 languages/better-search-replace-fr_FR.po
     create mode 100755 languages/better-search-replace.pot
     create mode 100644 templates/bsr-dashboard.php
     create mode 100644 templates/bsr-help.php
     create mode 100644 templates/bsr-search-replace.php
     create mode 100644 templates/bsr-settings.php

    I suggest the next code:
    find . -type f -exec chmod 644 {} +
    find . -type d -exec chmod 755 {} +

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)