The deprecation warning you're seeing occurs because json_decode expects a string as its first argument, but in your code, $old_slugs is null. To fix this issue, you should add a check to ensure that $old_slugs is not null before passing it to json_decode.
Here’s how you can modify the line...