I mean if there is mutual understanding then we cannot treat it as a plagiarism.
You're talking about copyright: if the author agrees (or got paid), it's not a copyright violation. Plagiarism, on the other hand, means making it look like it was created by you, and permission from the original author can't change that.
And it's so easy to prevent, ask permission and post credits:
Credits to
shorena for most of these instructions!