functions.php (copy)

jQuery(function($) { $(document).on(‘click’, ‘.favorite-toggle’, function(e) { e.preventDefault(); const btn = $(this); const post_id = btn.data(‘post-id’); const isFavorited = btn.attr(‘data-favorited’) === ‘1’; $.post(”, { action: ‘toggle_favorite’, post_id: post_id }, function(response) { if (response.success) { btn.text(isFavorited ? ‘♡’ : ‘❤️’).attr(‘data-favorited’, isFavorited ?…Continue reading

Feed Generation Cron Script

/** * Product Feed Generation Cron Script */ // Start timing $start_time = microtime(true); // Simple logging function function log_message($message) { $timestamp = date(‘Y-m-d H:i:s’); $log_entry = “[$timestamp] $message”; error_log($log_entry); echo $log_entry . “\n”; } log_message(“Feed generation started”); try {…Continue reading