Changeset 2584331
- Timestamp:
- 08/17/2021 04:25:55 PM (5 years ago)
- Location:
- fastcomments
- Files:
-
- 34 added
- 4 edited
-
tags/3.9.5 (added)
-
tags/3.9.5/.gitignore (added)
-
tags/3.9.5/LICENSE (added)
-
tags/3.9.5/README.md (added)
-
tags/3.9.5/README.txt (added)
-
tags/3.9.5/admin (added)
-
tags/3.9.5/admin/fastcomments-admin-setup-view.js (added)
-
tags/3.9.5/admin/fastcomments-admin-setup-view.php (added)
-
tags/3.9.5/admin/fastcomments-admin-sso-view.css (added)
-
tags/3.9.5/admin/fastcomments-admin-sso-view.js (added)
-
tags/3.9.5/admin/fastcomments-admin-sso-view.php (added)
-
tags/3.9.5/admin/fastcomments-admin-support-view.php (added)
-
tags/3.9.5/admin/fastcomments-admin-view.php (added)
-
tags/3.9.5/admin/fastcomments-admin.css (added)
-
tags/3.9.5/admin/fastcomments-admin.php (added)
-
tags/3.9.5/admin/images (added)
-
tags/3.9.5/admin/images/api.png (added)
-
tags/3.9.5/admin/images/crown.png (added)
-
tags/3.9.5/admin/images/css.png (added)
-
tags/3.9.5/admin/images/debugging.png (added)
-
tags/3.9.5/admin/images/download.png (added)
-
tags/3.9.5/admin/images/home.png (added)
-
tags/3.9.5/admin/images/logo-50.png (added)
-
tags/3.9.5/admin/images/logo.png (added)
-
tags/3.9.5/admin/images/support.png (added)
-
tags/3.9.5/admin/images/sync.png (added)
-
tags/3.9.5/core (added)
-
tags/3.9.5/core/FastCommentsIntegrationCore.php (added)
-
tags/3.9.5/core/FastCommentsWordPressIntegration.php (added)
-
tags/3.9.5/fastcomments-wordpress-plugin.php (added)
-
tags/3.9.5/public (added)
-
tags/3.9.5/public/fastcomments-public.php (added)
-
tags/3.9.5/public/fastcomments-widget-view.php (added)
-
tags/3.9.5/uninstall.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/core/FastCommentsWordPressIntegration.php (modified) (3 diffs)
-
trunk/fastcomments-wordpress-plugin.php (modified) (2 diffs)
-
trunk/public/fastcomments-public.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
fastcomments/trunk/README.txt
r2583733 r2584331 4 4 Requires at least: 4.6 5 5 Tested up to: 5.8 6 Stable tag: 3.9. 46 Stable tag: 3.9.5 7 7 Requires PHP: 5.2.4 8 8 License: GPLv2 or later … … 85 85 == Changelog == 86 86 87 = 3.9.5 = 88 * Improved comment date accuracy on reverse sync + switching to WordPress built in mechanisms for HTTP requests. 89 87 90 = 3.9.4 = 88 91 * Support for custom integrations to pass custom values for "comment thread ids" while retaining the WordPress Post and User IDs on sync. -
fastcomments/trunk/core/FastCommentsWordPressIntegration.php
r2583733 r2584331 143 143 144 144 public function makeHTTPRequest($method, $url, $body) { 145 $curl = curl_init(); 146 147 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); 148 switch ($method) { 149 case "POST": 150 if ($body) { 151 curl_setopt($curl, CURLOPT_POSTFIELDS, $body); 152 curl_setopt($curl, CURLOPT_HTTPHEADER, array( 153 'Content-Type: application/json', 154 'Content-Length: ' . strlen($body) 155 )); 156 } 157 break; 158 default: 159 if ($body) { 160 $url = sprintf("%s?%s", $url, http_build_query($body)); 161 } 162 } 163 164 curl_setopt($curl, CURLOPT_URL, $url); 165 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 166 // curl_setopt($curl, CURLOPT_VERBOSE, true); 167 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 168 curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); 169 170 $rawResult = curl_exec($curl); 145 $rawResult = wp_remote_request($url, array( 146 'method' => $method, 147 'body' => $body, 148 'timeout' => 20, 149 'headers' => array('Content-Type' => 'application/json; charset=utf-8'), 150 'data_format' => $body ? 'body' : 'query' 151 )); 171 152 172 153 $result = new stdClass(); 173 $result->responseStatusCode = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); 174 $result->responseBody = $rawResult; 154 if ($rawResult instanceof WP_Error) { 155 $this->log('error', "Request for $url errored out."); 156 $result->responseStatusCode = 500; 157 $result->responseBody = null; 158 } else { 159 $result->responseStatusCode = $rawResult['response']['code']; 160 $result->responseBody = $rawResult['body']; 161 } 175 162 176 163 // echo "Response URL " . $method . " " . $url . "\n"; 177 164 // echo "Response Code " . $result->responseStatusCode . "\n"; 178 165 // echo "Response Body " . $result->responseBody . "\n"; 179 180 curl_close($curl);181 166 182 167 return $result; … … 217 202 // wordpress timestamp format is Y-m-d H:i:s (mysql date column type) 218 203 $timestamp = strtotime($fc_comment->date); 219 $date_formatted = date('Y-m-d H:i:s', $timestamp); 220 204 $date_formatted_gmt = date('Y-m-d H:i:s', $timestamp); 205 $date_formatted = get_date_from_gmt($date_formatted_gmt); 206 207 $this->log('debug', "Dates: got $date_formatted_gmt -> $date_formatted from $fc_comment->date -> $timestamp"); 221 208 222 209 $wp_id = $this->getWPCommentId($fc_comment->_id); … … 247 234 $wp_comment['comment_author_email'] = $fc_comment->commenterEmail; 248 235 $wp_comment['comment_date'] = $date_formatted; 249 $wp_comment['comment_date_gmt'] = $date_formatted ;236 $wp_comment['comment_date_gmt'] = $date_formatted_gmt; 250 237 $wp_comment['comment_content'] = $fc_comment->comment; 251 238 $wp_comment['comment_karma'] = $fc_comment->votes; -
fastcomments/trunk/fastcomments-wordpress-plugin.php
r2583733 r2584331 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. 46 Version: 3.9.5 7 7 Author: winrid @ FastComments 8 8 License: GPL-2.0+ … … 14 14 } 15 15 16 $FASTCOMMENTS_VERSION = 3.9 4;16 $FASTCOMMENTS_VERSION = 3.95; 17 17 18 18 require_once plugin_dir_path(__FILE__) . 'admin/fastcomments-admin.php'; -
fastcomments/trunk/public/fastcomments-public.php
r2583733 r2584331 74 74 'readonly' => 'open' != $post->comment_status, 75 75 'sso' => $isSSOEnabled ? FastCommentsPublic::getSSOConfig($ssoKey, $wp_user) : null, 76 'apiHost' => null, // For local builds, the CI system will replace this with localhost. This mechanism prevents us from having to read files etc at run time for production sites. 76 77 'commentMeta' => array( 77 78 'wpPostId' => $post->ID,
Note: See TracChangeset
for help on using the changeset viewer.