• Resolved Docfxit

    (@docfxit)


    After installing WordPress 3.9 I set debug to true in:
    wp-config.php

    I’m seeing an error come up:
    Notice: get_settings is deprecated since version 2.1! Use get_option() instead. in C:\HostingSpaces\admin1\theoffice.la\wwwroot\Wood\wp-includes\functions.php on line 3078

    On line 3078 it has:
    trigger_error( sprintf( __(‘%1$s is deprecated since version %2$s! Use %3$s instead.’), $function, $version, $replacement ) );

    Does anyone know of a fix for this?

    Thank you,

    Docfxit

Viewing 4 replies - 1 through 4 (of 4 total)
  • That file and line is not the problem, they simply generate the error message you see. Something in your theme or plugin is still using get_settings causing this issue. Switch themes, see if it goes away. If it does, then its your theme that causes error. If not, then its a plugin and deactivating one by one can help you narrow it down to see which plugin causes that issue.

    Please note, it’s an error but it’s not breaking anything yet. It’s a notice, which means you should fix it but it still works for now. When WP drops support for get_settings completely, then it will break your site.

    Thread Starter Docfxit

    (@docfxit)

    Thank you for the information Viktor.

    I did a search in my folders for files that include get_settings
    I found it in:
    wp-includes\class-wp-customize-widgets.php

    wp-includes\widgets.php

    wp-admin\includes\template.php

    wp-admin\options.php

    wp-content\plugins\better-wp-security\core\class-itsec-core.php

    wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\nextgen_data\class.image_wrapper.php

    wp-content\plugins\role-manager\capability-management.php

    wp-content\plugins\role-manager\general.php

    wp-content\plugins\role-manager\help.php

    wp-content\plugins\role-manager\role-management.php

    It looks like it’s both in WP 3.9 as delivered and in my plugins.

    Is there any possibility to bring this to the attention of the developers of WP to clean up the code that is distributed within WP?

    The other plugins of course they won’t be cleaning up.

    Thanks,

    Docfxit

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    There is no use of the old “get_settings” function in WordPress itself. The ones you found in the core files aren’t referring to the same thing.

    For example, the instance you found in the wp-includes\class-wp-customize-widgets.php file is this:

    * (via wp_convert_widget_settings()) and can set global variable

    It’s part of a comment, referring to “widGET_SETTINGS”. 🙂

    Similarly, in wp-includes\widgets.php, you’ll find this:

    $settings = $this->get_settings();

    That call is to a get_settings function in the WP_Widget class, which is not deprecated.

    The only things that are actually causing that warning are in your plugins files.

    As Samuel pointed out, WP does still use it.

    These are the files and plugins that cause your notice:
    wp-content\plugins\better-wp-security\core\class-itsec-core.php

    wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\nextgen_data\class.image_wrapper.php

    wp-content\plugins\role-manager\capability-management.php

    wp-content\plugins\role-manager\general.php

    wp-content\plugins\role-manager\help.php

    wp-content\plugins\role-manager\role-management.php

    It’s not a critical error right now, it’s not breaking website features. You can bring this to plugin developers’ attention in plugin forums, but if the notice shows up on your frontend and is visible by public, than you can simply disable it.

    Add this inside your wp-config.php:

    define( 'WP_DEBUG', false );
    define( 'WP_DEBUG_LOG', false );
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );

    Note, wp-config will already have wp_debug line, so simply add remaining 3 lines below it. That will turn off errors from showing.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘get_settings is deprecated since version 2.1’ is closed to new replies.