Changeset 1944110
- Timestamp:
- 09/20/2018 08:55:45 AM (8 years ago)
- Location:
- spotim-comments
- Files:
-
- 47 added
- 3 edited
-
tags/4.3.6 (added)
-
tags/4.3.6/.gitignore (added)
-
tags/4.3.6/assets (added)
-
tags/4.3.6/assets/images (added)
-
tags/4.3.6/assets/images/ajax-loader.gif (added)
-
tags/4.3.6/assets/javascripts (added)
-
tags/4.3.6/assets/javascripts/admin.js (added)
-
tags/4.3.6/assets/stylesheets (added)
-
tags/4.3.6/assets/stylesheets/admin.css (added)
-
tags/4.3.6/assets/stylesheets/comments-number.css (added)
-
tags/4.3.6/gulpfile.js (added)
-
tags/4.3.6/inc (added)
-
tags/4.3.6/inc/class-spotim-admin.php (added)
-
tags/4.3.6/inc/class-spotim-cron.php (added)
-
tags/4.3.6/inc/class-spotim-feed.php (added)
-
tags/4.3.6/inc/class-spotim-frontend.php (added)
-
tags/4.3.6/inc/class-spotim-i18n.php (added)
-
tags/4.3.6/inc/class-spotim-import.php (added)
-
tags/4.3.6/inc/class-spotim-metabox.php (added)
-
tags/4.3.6/inc/class-spotim-options.php (added)
-
tags/4.3.6/inc/class-spotim-settings-fields.php (added)
-
tags/4.3.6/inc/helpers (added)
-
tags/4.3.6/inc/helpers/class-spotim-comment.php (added)
-
tags/4.3.6/inc/helpers/class-spotim-form.php (added)
-
tags/4.3.6/inc/helpers/class-spotim-json-feed.php (added)
-
tags/4.3.6/inc/helpers/class-spotim-message.php (added)
-
tags/4.3.6/inc/helpers/index.php (added)
-
tags/4.3.6/inc/index.php (added)
-
tags/4.3.6/inc/spotim-shortcodes.php (added)
-
tags/4.3.6/inc/spotim-widgets.php (added)
-
tags/4.3.6/index.php (added)
-
tags/4.3.6/language (added)
-
tags/4.3.6/language/index.php (added)
-
tags/4.3.6/language/spotim-comments.pot (added)
-
tags/4.3.6/license.txt (added)
-
tags/4.3.6/package.json (added)
-
tags/4.3.6/readme.txt (added)
-
tags/4.3.6/spotim-comments.php (added)
-
tags/4.3.6/templates (added)
-
tags/4.3.6/templates/admin-template.php (added)
-
tags/4.3.6/templates/comments-number-template.php (added)
-
tags/4.3.6/templates/comments-template-empty.php (added)
-
tags/4.3.6/templates/comments-template.php (added)
-
tags/4.3.6/templates/index.php (added)
-
tags/4.3.6/templates/newsfeed-template.php (added)
-
tags/4.3.6/templates/recirculation-template.php (added)
-
tags/4.3.6/templates/siderail-template.php (added)
-
trunk/inc/class-spotim-import.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/spotim-comments.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
spotim-comments/trunk/inc/class-spotim-import.php
r1944095 r1944110 31 31 32 32 private $total_changed_posts = []; 33 34 private $needto_load_more_changed_posts = 0; 33 35 34 36 /** … … 123 125 124 126 $this->total_changed_posts = get_option("wp-spotim-settings_total_changed_posts", []); 127 $this->needto_load_more_changed_posts = $this->options->get('needto_load_more_changed_posts',0); 125 128 } else { 126 129 $this->page_number = $page_number; … … 129 132 130 133 // $post_ids = $this->get_post_ids( $this->posts_per_request, $this->page_number ); 131 if(!is_array($this->total_changed_posts) || empty($this->total_changed_posts) )134 if(!is_array($this->total_changed_posts) || empty($this->total_changed_posts) || $this->needto_load_more_changed_posts > 0) 132 135 $this->get_changed_post_ids(); 133 136 … … 285 288 if ( 0 === $total_posts_count ) { 286 289 $response_args['status'] = 'success'; 287 $response_args['message'] = esc_html__( "Your website doesn't have any posts to sync.", 'spotim-comments' ); 290 $response_args['message'] = esc_html__("Your website doesn't have any posts to sync.", 'spotim-comments'); 291 }else if($this->needto_load_more_changed_posts > 0){ 292 $parsed_message = sprintf( 293 esc_html__( 'Loading %d total posts to sync.', 'spotim-comments' ), 294 $total_posts_count 295 ); 296 297 $response_args['status'] = 'continue'; 298 $response_args['message'] = $parsed_message; 299 288 300 } else if ( $current_posts_count < $total_posts_count ) { 289 301 $parsed_message = sprintf( … … 348 360 * @return array 349 361 */ 350 private function get_changed_post_ids($offset = 0){ 351 ini_set('display_errors', 1); 352 ini_set('display_startup_errors', 1); 353 error_reporting(E_ALL); 362 private function get_changed_post_ids(){ 363 364 $offset = $this->needto_load_more_changed_posts; 365 $limit = 5000; 366 354 367 $spot_id = $this->options->get( 'spot_id' ); 355 368 $sec_ago = $this->options->get("spotim_last_sync_timestamp", null); … … 363 376 'spot_id' => $spot_id, 364 377 'sec_ago' => $sec_ago, 365 'limit' => 5000,378 'limit' => $limit, 366 379 'offset' => $offset 367 380 ), self::SPOTIM_LAST_MODIFIED_API_URL ); … … 381 394 update_option("wp-spotim-settings_total_changed_posts", $this->total_changed_posts); 382 395 383 $offset += 5000; 384 385 if(count($body) >= 5000) 386 $this->get_changed_post_ids($offset); 396 $offset += $limit; 397 398 if(count($body) >= 1){ 399 $this->needto_load_more_changed_posts = $this->options->update('needto_load_more_changed_posts', $offset); 400 $this->finish(); 401 }else 402 $this->needto_load_more_changed_posts = $this->options->update('needto_load_more_changed_posts', 0); 387 403 } 388 404 } -
spotim-comments/trunk/readme.txt
r1944095 r1944110 5 5 Tested up to: 4.9 6 6 Requires PHP: 5.2 7 Stable tag: 4.3. 57 Stable tag: 4.3.6 8 8 License: GPLv2 or later 9 9 License URI: license.txt … … 204 204 == Changelog == 205 205 206 = 4.3. 5=206 = 4.3.6 = 207 207 * Improve sync mechanism 208 209 208 210 209 = 4.3.0 = -
spotim-comments/trunk/spotim-comments.php
r1944095 r1944110 4 4 * Plugin URI: https://wordpress.org/plugins/spotim-comments/ 5 5 * Description: Real-time comments widget turns your site into its own content-circulating ecosystem. 6 * Version: 4.3. 56 * Version: 4.3.6 7 7 * Author: Spot.IM 8 8 * Author URI: https://github.com/SpotIM
Note: See TracChangeset
for help on using the changeset viewer.