Changeset 3474122
- Timestamp:
- 03/04/2026 03:03:32 AM (4 weeks ago)
- Location:
- floyi
- Files:
-
- 26 added
- 2 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/admin (added)
-
tags/1.0.1/admin/class-floyi-admin.php (added)
-
tags/1.0.1/admin/index.php (added)
-
tags/1.0.1/assets (added)
-
tags/1.0.1/assets/css (added)
-
tags/1.0.1/assets/css/admin.css (added)
-
tags/1.0.1/assets/css/index.php (added)
-
tags/1.0.1/assets/index.php (added)
-
tags/1.0.1/assets/js (added)
-
tags/1.0.1/assets/js/admin.js (added)
-
tags/1.0.1/assets/js/index.php (added)
-
tags/1.0.1/floyi.php (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/class-floyi-api.php (added)
-
tags/1.0.1/includes/class-floyi-capabilities.php (added)
-
tags/1.0.1/includes/class-floyi-publisher.php (added)
-
tags/1.0.1/includes/class-floyi-security.php (added)
-
tags/1.0.1/includes/class-floyi-settings.php (added)
-
tags/1.0.1/includes/class-floyi-webhook-queue.php (added)
-
tags/1.0.1/includes/index.php (added)
-
tags/1.0.1/index.php (added)
-
tags/1.0.1/languages (added)
-
tags/1.0.1/languages/index.php (added)
-
tags/1.0.1/readme.txt (added)
-
tags/1.0.1/uninstall.php (added)
-
trunk/floyi.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
floyi/trunk/floyi.php
r3463064 r3474122 4 4 * Plugin URI: https://floyi.com/wordpress-plugin 5 5 * Description: Connect your WordPress site to Floyi for seamless content publishing from your topical authority platform. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Floyi 8 8 * Author URI: https://floyi.com … … 23 23 24 24 // Plugin constants 25 define('FLOYI_CONNECT_VERSION', '1.0. 0');25 define('FLOYI_CONNECT_VERSION', '1.0.1'); 26 26 define('FLOYI_CONNECT_PLUGIN_DIR', plugin_dir_path(__FILE__)); 27 27 define('FLOYI_CONNECT_PLUGIN_URL', plugin_dir_url(__FILE__)); … … 103 103 // Track post status changes for Floyi-managed posts 104 104 add_action('transition_post_status', array($this, 'handle_post_status_change'), 10, 3); 105 106 // Track permanent deletions (emptying trash) for Floyi-managed posts 107 add_action('before_delete_post', array($this, 'handle_post_deleted'), 10, 2); 105 108 } 106 109 … … 146 149 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Guarded by WP_DEBUG check. 147 150 error_log("[Floyi] Queued webhook for post {$post->ID}: " . ($queue_id ? "id={$queue_id}" : 'FAILED')); 151 } 152 153 // Process queue immediately instead of waiting for cron 154 Floyi_Webhook_Queue::process_queue(); 155 } 156 157 /** 158 * Handle permanent post deletion for Floyi-managed posts. 159 * 160 * Fires when a post is permanently deleted (emptying trash or force delete). 161 * Queues a webhook notification so Floyi can clean up its publish record. 162 * 163 * @param int $post_id Post ID being deleted. 164 * @param WP_Post $post Post object. 165 */ 166 public function handle_post_deleted($post_id, $post) { 167 // Skip if not connected to Floyi 168 if (!self::is_connected()) { 169 return; 170 } 171 172 // Only track posts that were published via Floyi 173 $floyi_article_id = get_post_meta($post_id, '_floyi_article_id', true); 174 if (!$floyi_article_id) { 175 return; 176 } 177 178 // Queue webhook event 179 $queue_id = Floyi_Webhook_Queue::add('post_deleted', array( 180 'wp_post_id' => $post_id, 181 'floyi_article_id' => $floyi_article_id, 182 'post_title' => $post->post_title, 183 )); 184 185 if (defined('WP_DEBUG') && WP_DEBUG) { 186 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Guarded by WP_DEBUG check. 187 error_log("[Floyi] Queued post_deleted webhook for post {$post_id}: " . ($queue_id ? "id={$queue_id}" : 'FAILED')); 148 188 } 149 189 -
floyi/trunk/readme.txt
r3463070 r3474122 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 125 125 == Changelog == 126 126 127 = 1.0.1 = 128 * Added webhook notification for permanent post deletions so Floyi cleans up publish records 129 * Hooks into `before_delete_post` to detect when Floyi-managed posts are permanently removed 130 127 131 = 1.0.0 = 128 132 * Initial release … … 142 146 == Upgrade Notice == 143 147 148 = 1.0.1 = 149 Fixes publish record cleanup when posts are permanently deleted from WordPress. 150 144 151 = 1.0.0 = 145 152 Initial release of Floyi Connect.
Note: See TracChangeset
for help on using the changeset viewer.