You didn’t come harsh at all, you had great insights.
After working on it a bit more, we found a better, more elegant solution using the clone function.
This has already been published to the updated Lnk.Bio plugin and the patch is simply
diff --git a/lnk.bio.php b/lnk.bio.php
index 65759fc..cc0c0d2 100644
--- a/lnk.bio.php
+++ b/lnk.bio.php
@@ -126,8 +126,7 @@ function lnkbio_api_post(string $url, array $data) {
}
function lnkbio_api_sync($post_id, $post, $update) {
- $json = json_encode($post);
- $local_post = json_decode($json);
+ $local_post = clone($post);
unset($local_post->post_content);
if ($post->post_status === 'publish') {
if (!get_option('lnkbio_id') || !get_option('lnkbio_secret')) {