I created a redirect function, based on the code in this topic: https://projectdmc.org/support/topic/php-api-red_item-parameters-update-something-changed/ and that has worked for a long time.
Today I noticed, I am getting an error while using this hook:
PHP Fatal error: Uncaught Error: Class "Red_Group" not found in /var/www/html/web/app/plugins/redirection/models/redirect/redirect-sanitizer.php:207
Stack trace:
#0 /var/www/html/web/app/plugins/redirection/models/redirect/redirect-sanitizer.php(114): Red_Item_Sanitize->get_group(1)
#1 /var/www/html/web/app/plugins/redirection/models/redirect/redirect.php(479): Red_Item_Sanitize->get(Array)
#2 /var/www/html/web/app/themes/sm-base/inc/actions-import.php(443): Red_Item::create(Array)
#3 /var/www/html/web/cms/wp-includes/class-wp-hook.php(324): hr_create_redirect(3066, '/topics/loopbaa...')
#4 /var/www/html/web/cms/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#5 /var/www/html/web/cms/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#6 /var/www/html/web/app/themes/sm-base/inc/actions-wp-one-time.php(322): do_action('create_post_red...', 3066, '/topics/loopbaa...')
#7 /var/www/html/web/cms/wp-includes/class-wp-hook.php(324): sm_add_redirects(1)
#8 /var/www/html/web/cms/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#9 /var/www/html/web/cms/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#10 /var/www/html/web/cms/wp-cron.php(191): do_action_ref_array('add_redirects', Array)
#11 {main}
thrown in /var/www/html/web/app/plugins/redirection/models/redirect/redirect-sanitizer.php on line 207