CMB2_Field::__construct() was called with a parameter that is deprecated

#215954
  • Resolved Simon
    Rank Math free

    Upon installing via Composer I’m getting the following notice errors:

    Notice: CMB2_Field::__construct() was called with a parameter that is deprecated since version 2.2.3! Using the “default” field parameter as a callback has been deprecated in favor of the “default_cb” parameter. in /Users/username/Websites/site-name/web/app/plugins/seo-by-rank-math/vendor/cmb2/cmb2/includes/CMB2_Base.php on line 457

    I can’t find this error logged anywhere on your support forums, are you able to assist with this issue?

    Thanks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    It looks like your theme is adding some function without proper prefixing it. As per the WordPress guidelines, all the functions in your theme should be prefixed with the theme_name: https://themereview.co/prefix-all-the-things/

    A couple of users had also reported this issue in the past. Prefixing the theme functions had fixed the issue for them. Can you also check and prefix all the functions in your theme? I’d recommend having your theme developer help you in fixing this.

    Hope this helps. Let us know if you need any further assistance.

    Simon
    Rank Math free

    Hi, thanks for your reply!

    These errors are occurring even when a default theme has been activated.

    I am using https://roots.io/bedrock/ to install and manage WP via Composer. Are there any known issues with this setup?

    Thanks.

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    I would like to add that installing Rank Math using Composer is only available in the PRO version. You need an API key which Free users do not have. Please refer to this KB guide: https://rankmath.com/kb/install-rank-math-pro-with-composer/

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Simon
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Simon
    Rank Math free

    Hi Jeremy,

    The plugin was installed using Composer via https://wpackagist.org/

    Brian
    Rank Math free

    Hello

    Thank you for getting back to us.

    At the moment, We use the latest CMB2 release anyway so there’s nothing else to do from our side. Since we do not have a way to have the Rank Math free version installed via composer it could be the reason why it is causing these issues. Please make sure that the installation is done normally via WordPress to resolve this issue.

    Hope this helps. Please let us know if you have any other queries.
    Thank you.

    Simon
    Rank Math free

    Hi Brian,

    Thank you for your response.

    The wpackagist.org mirrors all WordPress plugins and themes directories. It’s a widely used Composer repo and it installs the plugin within /wp-content/plugins, just like a manual installation.

    Even when I install it manually I receive the same errors so the installation doesn’t appear to be causing any issues.

    Any more assistance would be of great help.

    Hello,

    Thank you for keeping in touch with us.

    Allow me to escalate this ticket to our dev team to further check on this issue. We should get back to you with a solution shortly.

    We appreciate your time and patience on this one.

    Hello,

    Your installation is not installing the plugins to the default wp-content/plugins folder but rather to a different location under app/plugins directory.

    Because of this custom installation, your website might throw errors like this and we would recommend that you switch to a more “default” folder structure in order to prevent issues like this.

    Hope that helps clarify your doubts.

    Don’t hesitate to get in touch if you have any other questions.

    Simon
    Rank Math free

    I don’t want to use a more “default” folder structure as I’m using Bedrock from Roots and it’s vital to my workflow. I’ve never had issues when installing any other plugins like this and Bedrock is widely used within the WordPress community.

    Are you able to confirm whether these errors would persist in the pro version? I wanted to upgrade but if it’s not compatible with my site then I’ll have to use an alternative solution.

    Thanks.

    Hello,

    Thank you for getting back to us.

    The PRO version of the plugin is built on top of the Free version so those errors won’t go away by just installing the PRO plugin alone.

    Having said that, you could get in touch with the team over at Bedrock to check if they are prefixing all the functions they use to achieve the functionality as not doing so could be the root cause of this issue.

    Hope this helps solve your issue.

    Don’t hesitate to get in touch if you have any other questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘CMB2_Field::__construct() was called with a parameter that is deprecated’ is closed to new replies.