Changeset 2583733
- Timestamp:
- 08/16/2021 07:32:14 PM (5 years ago)
- Location:
- fastcomments
- Files:
-
- 34 added
- 4 edited
-
tags/3.9.4 (added)
-
tags/3.9.4/.gitignore (added)
-
tags/3.9.4/LICENSE (added)
-
tags/3.9.4/README.md (added)
-
tags/3.9.4/README.txt (added)
-
tags/3.9.4/admin (added)
-
tags/3.9.4/admin/fastcomments-admin-setup-view.js (added)
-
tags/3.9.4/admin/fastcomments-admin-setup-view.php (added)
-
tags/3.9.4/admin/fastcomments-admin-sso-view.css (added)
-
tags/3.9.4/admin/fastcomments-admin-sso-view.js (added)
-
tags/3.9.4/admin/fastcomments-admin-sso-view.php (added)
-
tags/3.9.4/admin/fastcomments-admin-support-view.php (added)
-
tags/3.9.4/admin/fastcomments-admin-view.php (added)
-
tags/3.9.4/admin/fastcomments-admin.css (added)
-
tags/3.9.4/admin/fastcomments-admin.php (added)
-
tags/3.9.4/admin/images (added)
-
tags/3.9.4/admin/images/api.png (added)
-
tags/3.9.4/admin/images/crown.png (added)
-
tags/3.9.4/admin/images/css.png (added)
-
tags/3.9.4/admin/images/debugging.png (added)
-
tags/3.9.4/admin/images/download.png (added)
-
tags/3.9.4/admin/images/home.png (added)
-
tags/3.9.4/admin/images/logo-50.png (added)
-
tags/3.9.4/admin/images/logo.png (added)
-
tags/3.9.4/admin/images/support.png (added)
-
tags/3.9.4/admin/images/sync.png (added)
-
tags/3.9.4/core (added)
-
tags/3.9.4/core/FastCommentsIntegrationCore.php (added)
-
tags/3.9.4/core/FastCommentsWordPressIntegration.php (added)
-
tags/3.9.4/fastcomments-wordpress-plugin.php (added)
-
tags/3.9.4/public (added)
-
tags/3.9.4/public/fastcomments-public.php (added)
-
tags/3.9.4/public/fastcomments-widget-view.php (added)
-
tags/3.9.4/uninstall.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/core/FastCommentsWordPressIntegration.php (modified) (1 diff)
-
trunk/fastcomments-wordpress-plugin.php (modified) (2 diffs)
-
trunk/public/fastcomments-public.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fastcomments/trunk/README.txt
r2577475 r2583733 4 4 Requires at least: 4.6 5 5 Tested up to: 5.8 6 Stable tag: 3.9. 36 Stable tag: 3.9.4 7 7 Requires PHP: 5.2.4 8 8 License: GPLv2 or later … … 85 85 == Changelog == 86 86 87 = 3.9.4 = 88 * Support for custom integrations to pass custom values for "comment thread ids" while retaining the WordPress Post and User IDs on sync. 89 87 90 = 3.9.3 = 88 91 * Stability improvements and sync-related bugfixes. -
fastcomments/trunk/core/FastCommentsWordPressIntegration.php
r2577475 r2583733 223 223 $wp_parent_id = isset($fc_comment->parentId) && $fc_comment->parentId ? $this->getWPCommentId($fc_comment->parentId) : 0; 224 224 225 $post_id = null; 226 $user_id = null; 227 228 if (isset($fc_comment->meta)) { 229 if (isset($fc_comment->meta->wpPostId)) { 230 $post_id = $fc_comment->meta->wpPostId; 231 } 232 if (isset($fc_comment->meta->wpUserId)) { 233 $user_id = $fc_comment->meta->wpUserId; 234 } 235 } else { 236 $post_id = (int) $fc_comment->urlId; 237 } 238 225 239 $wp_comment['comment_ID'] = is_numeric($wp_id) ? $wp_id : null; 226 $wp_comment['comment_post_ID'] = (int)$fc_comment->urlId; 227 $finalpostId = $wp_comment['comment_post_ID']; 240 $wp_comment['comment_post_ID'] = $post_id; 228 241 $wp_comment['comment_post_url'] = $fc_comment->url; 229 // TODO fix user ids potentially getting lost via 1. Create comment in WP 2. Sync to FC 3. Update Comment Text in FC 4. Sync back to WP. 230 // $wp_comment['comment_user_ID'] = 0; 242 // Isset check to prevent user ids potentially getting lost if integration is custom and doesn't define meta->wpUserId. 243 if (isset($user_id)) { 244 $wp_comment['comment_user_ID'] = $user_id; 245 } 231 246 $wp_comment['comment_author'] = $fc_comment->commenterName; 232 247 $wp_comment['comment_author_email'] = $fc_comment->commenterEmail; -
fastcomments/trunk/fastcomments-wordpress-plugin.php
r2577475 r2583733 4 4 Plugin URI: https://fastcomments.com 5 5 Description: Live Comments, Fast. A comment system that will delight your users and developers. 6 Version: 3.9. 36 Version: 3.9.4 7 7 Author: winrid @ FastComments 8 8 License: GPL-2.0+ … … 14 14 } 15 15 16 $FASTCOMMENTS_VERSION = 3.9 3;16 $FASTCOMMENTS_VERSION = 3.94; 17 17 18 18 require_once plugin_dir_path(__FILE__) . 'admin/fastcomments-admin.php'; -
fastcomments/trunk/public/fastcomments-public.php
r2577451 r2583733 66 66 $ssoKey = get_option('fastcomments_sso_key'); 67 67 $isSSOEnabled = $ssoKey && get_option('fastcomments_sso_enabled'); 68 $userId = null; 69 $wp_user = wp_get_current_user(); 68 70 return array( 69 71 'tenantId' => get_option('fastcomments_tenant_id') ? get_option('fastcomments_tenant_id') : 'demo', … … 71 73 'url' => get_permalink($post), 72 74 'readonly' => 'open' != $post->comment_status, 73 'sso' => $isSSOEnabled ? FastCommentsPublic::getSSOConfig($ssoKey) : null 75 'sso' => $isSSOEnabled ? FastCommentsPublic::getSSOConfig($ssoKey, $wp_user) : null, 76 'commentMeta' => array( 77 'wpPostId' => $post->ID, 78 'wpUserId' => $wp_user ? $wp_user->ID : null 79 ) 74 80 ); 75 81 } 76 82 77 private static function getSSOConfig($ssoKey ) {83 private static function getSSOConfig($ssoKey, $wp_user) { 78 84 $timestamp = time() * 1000; 79 85 … … 82 88 83 89 $sso_user = array(); 84 $wp_user = wp_get_current_user();85 90 if ($wp_user) { 86 91 $sso_user['id'] = $wp_user->ID;
Note: See TracChangeset
for help on using the changeset viewer.