• Resolved Bjarne Oldrup

    (@oldrup)


    Hey. I got this warning in the dashboard when activating Updraft Plus on a fresh WP 6.3.1 install, with WP_DEBUG enabled.

    Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/removed/removed/wp-includes/formatting.php on line 2827
    • Server architecture: Linux 3.10.0-962.3.2.lve1.5.64.el7.x86_64 x86_64
    • PHP version: 8.1.22 (Supports 64bit values)

    De-activating updraft, makes it go away. As said, fresh install, no backups made yet.

    Do you have any idea what causes this? Is it something you can reproduce?

    Bjarne

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

    (@oldrup)

    Okay, it appears, that after going through the onboarding process and actually configuring a backup, the warning goes away.

    So might be a deprecation warning related to the onboarding process only.

    Plugin Support vupdraft

    (@vupdraft)

    Hi,

    Apologies, our developers will be addressing any deprecated messages. This should not affect your ability to do any backups.

    Paul

    (@paulschiretz)

    Hi, this happens to me as well on my staging machine where i don’t have a backup location configured. I guess once a backup location is set up everything is fin. Anyway it would be nice to have that fixed, here a detailed stacktrace:

    [08-Sep-2023 15:16:46 UTC] PHP Deprecated:  rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in src\app\public\wp-includes\formatting.php on line 2836
    [08-Sep-2023 15:16:47 UTC] #0 src\wp-content\plugins\updraftplus\class-updraftplus.php(4711): untrailingslashit(NULL)
    #1 src\wp-content\plugins\updraftplus\admin.php(1248): UpdraftPlus->backups_dir_location()
    #2 src\wp-content\plugins\updraftplus\admin.php(281): UpdraftPlus_Admin->disk_space_check(36700160)
    #3 src\wp-content\plugins\updraftplus\admin.php(580): UpdraftPlus_Admin->setup_all_admin_notices_global(NULL)
    #4 src\wp-content\plugins\updraftplus\admin.php(38): UpdraftPlus_Admin->admin_init()
    #5 src\wp-content\plugins\updraftplus\admin.php(8): UpdraftPlus_Admin->__construct()
    #6 src\wp-content\plugins\updraftplus\updraftplus.php(104): include_once('src...')
    #7 src\wp-content\plugins\updraftplus\class-updraftplus.php(481): updraft_try_include_file('admin.php', 'include_once')
    #8 src\wp-includes\class-wp-hook.php(310): UpdraftPlus->admin_menu('')
    #9 src\wp-includes\class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
    #10 src\wp-includes\plugin.php(517): WP_Hook->do_action(Array)
    #11 src\wp-admin\admin-ajax.php(45): do_action('admin_init')
    #12 {main}
    Plugin Support vupdraft

    (@vupdraft)

    Thanks @paulschiretz – we should get these cleared up soon.

    Thread Starter Bjarne Oldrup

    (@oldrup)

    @paulschiretz A detailed stack trace looks useful when reporting issues. Where do you find these, Paul?

    Paul

    (@paulschiretz)

    @oldrup Hmm it’s a bit of manual work to get those…( A C++ dev would call it printf debugging ?? ) What i did was basically setting WP_DEBUG & WP_DEBUG_LOG to true in the wp-config file and adding

    	if(is_null($value) ) {
    		$e = new \Exception();
    		error_log($e->getTraceAsString());
    	}

    to the wp-includes/formatting.php on line 2836 after the function header of the function: untrailingslashit <- thats where it happens. Then the output of the stacktrace can be found in your usual debug.txt in the wp-contents folder.

    IMPORTANT NOTE: Don’t forget to remove the added code after you got the stacktrace from the log and switch WP_DEBUG & WP_DEBUG_LOG to false again to keep your site production ready!

    What the code does in plain english:
    As the warning occurs when the variable $value is null my code simply creates an exception and gets the stacktrace of it if the var $value is_null and logs the output via the standard php error_log function.

    Hope this clears things up a bit and sorry if it is a bit much ??

    I tend to think logging a trace like this is especially useful if the only info you get is a php warning in some of the wp core files as it gives no idea what happened before… i use it a lot!

    All the best,
    Paul

    Thread Starter Bjarne Oldrup

    (@oldrup)

    Thank you so much @paulschiretz, for sharing your insights on debugging WordPress ??

    Paul

    (@paulschiretz)

    @oldrup Always glad to help! ?? And Congrats on your nice blog full of useful tipps and snippets about wp, really helpful!

    Cheers, Paul

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string’ is closed to new replies.