• Dear developers,

    I would like to express my gratitude to you for the high-quality Beautiful Cookie Consent Banner (BCCB) plugin.

    However, I must inform you that BCCB is not compatible with the PostX plugin.

    If both plugins are installed and the Enable Cookie Banner option is enabled in the BCCB plugin, none of the ajax functions work in PostX. Specifically, the Load more buttons on the homepage do not work, the Preloader spins endlessly, and there is some disruption to the footer design.

    I kindly request that you resolve this conflict. Thank you in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter pharmanext

    (@pharmanext)

    To avoid any ambiguity, I hasten to inform you that the incompatibility is observed in its pure form, i.e., only the Twenty-Twenty Five (or Twenty-Twenty Four) theme is active, and only these two plugins.

    Plugin Author Nikel

    (@nikelschubert)

    Hi, thanks for reporting this. We can reproduce the issue and will provide a fix ASAP. The issue is in the “block services”. When “Service Blocking” is disabled it works for us.

    Regards

    • This reply was modified 3 months, 4 weeks ago by Nikel.
    Plugin Author Nikel

    (@nikelschubert)

    @pharmanext can you maybe share a screen of your blocked services?

    We have identified the “Google Fonts” Blocking which seem to break this.

    Plugin Author Nikel

    (@nikelschubert)

    Hi,

    this issue is fixed with 4.1.3 of the premium plugin. Can you confirm?

    Regards

    Nikel

    Thread Starter pharmanext

    (@pharmanext)

    Dear Nikel,

    I apologize in advance for my potentially harsh tone, but this whole situation seems absurd and ridiculous.

    Firstly, your initial response took a full nine days. During that time, I managed to write my own plugin for managing cookies. It was a very interesting journey. But what else could I do when you remained silent for so long?

    Second, tell me, how does it help me that you said the issue was with Google Fonts? Thank you, of course, for this invaluable information, but what next?

    Third, excuse me, are we talking about the premium version of the plugin? No!

    We are talking about the plugin that is available for free in the WordPress repository. So how can I confirm that the issue has been resolved if you have eliminated it, as you claim, only in the premium version?

    Fourth, the issue has not been resolved.

    P.S. In conclusion, in all fairness, I must say that you have an excellent, awesome plugin!

    I really like it. It has many wonderful features and capabilities. You are very talented and smart! Thank you for your work. I wish you success and prosperity for your business!

    Plugin Author Nikel

    (@nikelschubert)

    Hi,

    It is really not our claim to have such a long response time, however in rare situations this might happen. I apologize for this. I am happy for you that you could resolve your use case with your own plugin in the meantime.

    Regarding the bug:

    I was not aware that this was an issue in the free version, as we were not able to reproduce it in the free version for whatever reasons. The ajax functions just worked fine, in the settings we were testing.

    Would you mind to share some additional data? That would help us reproduce the issue.

    1. The export of the banner config would be extremely helpful (from tab: Im / export)
    2. Some screenshots or maybe even videos how the error looks like in the frontend.
    3. Maybe some details on postX configuration if you think they are worth mentioning?
    4. Your WP Version and PHP Version.

    That would be really helpful.

    Regards,

    Nikel

    Plugin Author Nikel

    (@nikelschubert)

    I will be closing this thread for now. If the issue persists or you need any further assistance, please feel free to reply and we will be happy to help.

    If possible, providing additional details would be greatly appreciated, as it will help us support you more effectively.

    Thread Starter pharmanext

    (@pharmanext)

    The issue was in /beautiful-and-responsive-cookie-consent/class/class-nsc_bar_input_validation.php:

    [debug.log]

    PHP Fatal error:  Cannot redeclare escape_recursive() (previously declared in /beautiful-and-responsive-cookie-consent/class/class-nsc_bar_input_validation.php:414) in /beautiful-and-responsive-cookie-consent/class/class-nsc_bar_input_validation.php on line 414

    Cause:

    The error occurs because the escape_recursive() function is defined inside the escape_json_content() method. In PHP, nested functions are global – they are declared in the global scope the first time the method runs. If the method is called again, PHP attempts to redeclare the same function, triggering a fatal error.

    Original Code:

       public function escape_json_content(string $json_string)

        {

            $decoded_json = json_decode($json_string, true);

            if (json_last_error() !== JSON_ERROR_NONE) {

                return false;

            }

            function escape_recursive($data, $allowedHtml)

            {

                if (is_array($data)) {

                    foreach ($data as $key => $value) {

                        if ($key === "message" && is_string($value) === true) {

                            $data[$key] = wp_kses($value, $allowedHtml);

                            continue;

                        }

                        $data[$key] = escape_recursive($value, $allowedHtml);

                    }

                } elseif (is_string($data)) {

                    $data = stripslashes(esc_js($data));

                }

                return $data;

            }

            $escaped_json = escape_recursive($decoded_json, $this->allowedHtml);

            return json_encode($escaped_json, JSON_UNESCAPED_UNICODE);

        }

    New Code:

    private function escape_recursive($data, $allowedHtml)

    {

        if (is_array($data)) {

            foreach ($data as $key => $value) {

                if ($key === "message" && is_string($value) === true) {

                    $data[$key] = wp_kses($value, $allowedHtml);

                    continue;

                }

                $data[$key] = $this->escape_recursive($value, $allowedHtml);

            }

        } elseif (is_string($data)) {

            $data = stripslashes(esc_js($data));

        }

        return $data;

    }

    public function escape_json_content(string $json_string)

    {

        $decoded_json = json_decode($json_string, true);

        if (json_last_error() !== JSON_ERROR_NONE) {

            return false;

        }

        $escaped_json = $this->escape_recursive($decoded_json, $this->allowedHtml);

        return json_encode($escaped_json, JSON_UNESCAPED_UNICODE);

    }
Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.