• Resolved palladiangroup

    (@palladiangroup)


    Hi,

    When we used the plugin, we had an error that broke our website.

    PHP Fatal error: Uncaught TypeError: str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string in wp-content/plugins/secure-copy-content-protection/public/class-secure-copy-content-protection-public.php:1498

    This appears to be happening when $search is a string and $replace is an array of user roles.

    Here’s a sample stack trace:

    #0 wp-content/plugins/secure-copy-content-protection/public/class-secure-copy-content-protection-public.php(1498): str_replace('%%post_author_r...', Array, '<p>You cannot c...')
    #1 wp-content/plugins/secure-copy-content-protection/public/class-secure-copy-content-protection-public.php(1423): Secure_Copy_Content_Protection_Public->sccp_replace_message_variables('<p>You cannot c...', Array)
    #2 wp-includes/class-wp-hook.php(324): Secure_Copy_Content_Protection_Public->ays_get_notification_text('')
    #3 wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #4 wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #5 wp-includes/general-template.php(3208): do_action('wp_footer')
    #6 wp-content/plugins/elementor-pro/modules/theme-builder/views/theme-support-footer.php(11): wp_footer()
    #7 wp-content/plugins/elementor-pro/modules/theme-builder/classes/theme-support.php(115): require('...')
    #8 wp-includes/class-wp-hook.php(326): ElementorPro\Modules\ThemeBuilder\Classes\Theme_Support->get_footer(NULL)
    #9 wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
    #10 wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #11 wp-includes/general-template.php(82): do_action('get_footer', NULL, Array)
    #12 wp-content/plugins/elementor/modules/page-templates/templates/header-footer.php(30): get_footer()
    #13 wp-includes/template-loader.php(106): include('...')
    #14 wp-blog-header.php(19): require_once('...')
    #15 index.php(17): require('...')
    #16 {main}

    thrown in wp-content/plugins/secure-copy-content-protection/public/class-secure-copy-content-protection-public.php on line 1498

    For now, we fixed this by 1) getting the first role from the array if it has values, and 2) skipping str_replace() call if the array is empty.

    We’re running this with:

    • PHP 8.2
    • WordPress 6.8.3
    • Secure Copy Content Protection 5.0.2

    Thanks for your time!

    • This topic was modified 2 months ago by palladiangroup.
    • This topic was modified 2 months ago by palladiangroup. Reason: removing some uselessly-short, vague path prefixes from the stack trace

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Jasmine

    (@hyenokian)

    Dear @palladiangroup,

    Thank you very much for your topic and for explaining the issue.

    We are sorry that you experienced this problem.

    We have forwarded the information to our Dev Team and they are currently checking it.
    The fix will be included in the upcoming update, and we will notify you once it is released.

    If you have any other questions, feel free to open another topic.

    Thank you.

    Plugin Support Jasmine

    (@hyenokian)

    Dear @palladiangroup,

    We are happy to let you know that the fixed version is now live.

    Please update the plugin, check it again, and let us know whether everything is working properly or not.

    Once again, thank you very much.

    Thread Starter palladiangroup

    (@palladiangroup)

    Hi @hyenokian,

    Thank you for getting back to us and especially for such a quick update. We updated the plugin and this resolves the issue we were running into.

    I hope you and your team have a great rest of your week.

    Plugin Support Jasmine

    (@hyenokian)

    Dear @palladiangroup,

    Thank you very much for your kind message. We truly appreciate it.

    We are glad to hear that updating the plugin resolved the issue.

    If you have any questions in the future, please feel free to open a new topic and we will be happy to assist you.

    If you are satisfied with our support, please leave us a rating on ww.wp.xz.cn

    You’ll help new users discover our plugin, giving us the opportunity to make it even better for you!

    Here is the link for rating: https://ww.wp.xz.cn/support/plugin/secure-copy-content-protection/reviews/

    Thanks in advance!

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

You must be logged in to reply to this topic.