Can you send me a patch of all the modified files, indicating exactly where the changes have been made?
The lack of plugin updates — for proper PHP 8 support, and in general — have forced me to look for a different plugin/solution. Thus, I can’t justify the effort of submitting a formal patch at this point.
However, my first comment basically serves this purpose. Please feel free to work that logic into your plugin as you see fit.
Have you tested your patch with Gateway mode?
No, I do not use Gateway mode.
Overall, the comments from @partyka may indicate a better approach.