Changeset 3491158
- Timestamp:
- 03/25/2026 06:32:31 PM (5 days ago)
- Location:
- threewp-broadcast/trunk
- Files:
-
- 17 edited
-
ThreeWP_Broadcast.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/broadcasting_data.php (modified) (1 diff)
-
src/maintenance/checks/broadcast_data/check.php (modified) (7 diffs)
-
src/maintenance/checks/broadcast_data/data.php (modified) (1 diff)
-
src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_broken_bcd.php (modified) (2 diffs)
-
src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_child_is_unlinked.php (modified) (2 diffs)
-
src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_duplicate_bcd.php (modified) (2 diffs)
-
src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_missing_children.php (modified) (2 diffs)
-
src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_missing_parents.php (modified) (1 diff)
-
src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_missing_post.php (modified) (2 diffs)
-
src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_parent_is_unlinked.php (modified) (2 diffs)
-
src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_same_parent.php (modified) (2 diffs)
-
src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_unnecessary_children.php (modified) (2 diffs)
-
src/maintenance/checks/simple_broadcast_data/check.php (modified) (3 diffs)
-
src/maintenance/checks/view_post_info/check.php (modified) (1 diff)
-
src/traits/broadcasting.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
threewp-broadcast/trunk/ThreeWP_Broadcast.php
r3455980 r3491158 9 9 Plugin Name: Broadcast 10 10 Plugin URI: https://broadcast.plainviewplugins.com/ 11 Version: 52.0 211 Version: 52.03 12 12 */ 13 13 14 14 if ( ! defined( 'ABSPATH' ) ) exit; 15 15 16 DEFINE( 'THREEWP_BROADCAST_VERSION', 52.0 2);16 DEFINE( 'THREEWP_BROADCAST_VERSION', 52.03 ); 17 17 18 18 require_once( __DIR__ . '/vendor/autoload.php' ); -
threewp-broadcast/trunk/readme.txt
r3455980 r3491158 5 5 Requires at least: 6.2 6 6 Requires PHP: 8.0 7 Stable tag: 52.0 27 Stable tag: 52.03 8 8 Tags: multipost, sharing, duplicate, syndication, marketing 9 9 Tested up to: 6.9.1 … … 373 373 == Changelog == 374 374 375 = 52.03 20260325 = 376 377 * Fix: Prevent PHP timeouts during Broadcast Data maintenance checks by chunking the checks more efficiently. Thanks to mj@networker.de for the patch and testing. 378 * Dev: Add ->existing_child_post in the broadcasting_data to help the modify_post action see how the existing child post looks. 379 * Dev: Fix proper display of custom fields in view post info maintenance check. 380 375 381 = 52.02 20260207 = 376 382 -
threewp-broadcast/trunk/src/broadcasting_data.php
r3445175 r3491158 121 121 **/ 122 122 public $dynamic_data = false; 123 124 /** 125 @brief The WP_Post of the existing child post on the child blog. 126 @details The post data is retrieved after switching to the child blog and reset to false after each switch. 127 Can be used in conjunction with the modify_post action to get the existing child post's data. 128 @since 2026-03-12 16:42:09 129 **/ 130 public $existing_child_post = false; 123 131 124 132 /** -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/check.php
r3445175 r3491158 148 148 149 149 if ( count( $bcd->get_linked_children() ) > 0 ) 150 $this->data->unnecessary_children->set( $id, $bcd);150 $this->data->unnecessary_children->set( $id, true ); 151 151 152 152 // The parent blog + post must exist. … … 311 311 $r = ''; 312 312 313 $max = count( $this->data->ids_to_check ); 314 if ( $max < 1 ) 313 $query = sprintf( 314 "SELECT * FROM `%s` WHERE `id` > %d ORDER BY `id` ASC LIMIT %d", 315 $this->table, 316 $this->data->last_id, 317 data::$rows_per_step 318 ); 319 $results = $this->broadcast()->query( $query ); 320 321 if ( count( $results ) < 1 ) 315 322 { 316 323 $r .= $this->broadcast()->p( __( 'Finished checking database rows. Now checking the actual broadcast data relations.', 'threewp-broadcast' ) ); … … 319 326 } 320 327 321 328 $remaining = max( 0, $this->data->total_rows - $this->data->checked_rows ); 322 329 $r .= $this->broadcast()->p( 323 330 // Translators: NUMBER rows left to check 324 __( '%d rows left to check...', 'threewp-broadcast' ), 325 count( $this->data->ids_to_check ) 331 __( '%1$d of %2$d rows checked. %3$d left to check...', 'threewp-broadcast' ), 332 $this->data->checked_rows, 333 $this->data->total_rows, 334 $remaining 326 335 ); 327 336 328 // Check the next ids 329 $max = min( $max, data::$rows_per_step ); 330 $ids = []; 331 for ( $counter = 0; $counter < $max; $counter++ ) 332 { 333 $id = array_shift( $this->data->ids_to_check ); 334 $query = sprintf( "SELECT * FROM `%s` WHERE `id` = '%s'", $this->table, $id ); 335 $results = $this->broadcast()->query( $query ); 336 $result = reset( $results ); 337 foreach( $results as $result ) 338 { 339 $id = (int) $result[ 'id' ]; 340 $this->data->last_id = max( $this->data->last_id, $id ); 341 $this->data->checked_rows++; 337 342 338 343 $bcd = BroadcastData::sql( $result ); … … 344 349 if ( ! BroadcastData::unserialize_data( $result[ 'data' ] ) ) 345 350 { 346 $this->data->broken_bcd->set( $id, $bcd);351 $this->data->broken_bcd->set( $id, true ); 347 352 continue; 348 353 } … … 356 361 if ( $this->data->seen_blog_post->has( $key ) ) 357 362 { 358 $this->data->duplicate_bcd->put( $id, $bcd);363 $this->data->duplicate_bcd->put( $id, true ); 359 364 continue; 360 365 } … … 366 371 if ( ! $this->blog_and_post_exists( $blog_id, $post_id ) ) 367 372 { 368 $this->data->missing_post->put( $id, $bcd ); 373 $this->data->missing_post->put( $id, [ 374 'blog_id' => $blog_id, 375 'post_id' => $post_id, 376 ] ); 369 377 continue; 370 378 } … … 403 411 404 412 // Count the rows in the table. 405 $query = sprintf( 'SELECT `id`FROM `%s`', $this->table );413 $query = sprintf( 'SELECT COUNT(*) AS row_count FROM `%s`', $this->table ); 406 414 $results = $this->broadcast()->query( $query ); 407 408 $ this->data->ids = [];409 foreach( $results as $result ) 410 $this->data->ids []= $result[ 'id' ];411 412 $this->data-> ids_to_check = $this->data->ids;415 $row = is_array( $results ) ? reset( $results ) : null; 416 $count = isset( $row[ 'row_count' ] ) ? intval( $row[ 'row_count' ] ) : 0; 417 418 $this->data->last_id = 0; 419 $this->data->checked_rows = 0; 420 $this->data->total_rows = $count; 413 421 414 422 $r = $this->broadcast()->p( 415 423 // Translators: NUMBER rows to check 416 424 __( 'Beginning to check broadcast data. %d rows to check.', 'threewp-broadcast' ), 417 count( $this->data->ids_to_check )425 $count 418 426 ); 419 427 $r .= $this->next_step( 'check_ids' ); -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/data.php
r3190117 r3491158 13 13 { 14 14 public static $rows_per_step = 500; 15 public $last_id = 0; 16 public $checked_rows = 0; 17 public $total_rows = 0; 15 18 16 19 public function __construct() -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_broken_bcd.php
r1229100 r3491158 15 15 if ( $button->pressed() ) 16 16 { 17 // Delete all of the missing post broadcast datas. 18 foreach( $this->data->broken_bcd as $bcd ) 17 $batch_size = 200; 18 $deleted = 0; 19 foreach( $this->data->broken_bcd as $id => $ignore ) 19 20 { 20 $o->bc->sql_delete_broadcast_data( $bcd->id ); 21 $this->data->broken_bcd->forget( $bcd->id ); 21 $o->bc->sql_delete_broadcast_data( $id ); 22 $this->data->broken_bcd->forget( $id ); 23 $deleted++; 24 if ( $deleted >= $batch_size ) 25 break; 22 26 } 23 $o->bc->message( 'The broadcast data objects that could not be read have been deleted.' ); 27 $remaining = count( $this->data->broken_bcd ); 28 if ( $remaining > 0 ) 29 { 30 $o->bc->message( sprintf( 'Deleted %d corrupt broadcast data objects. %d remaining.', $deleted, $remaining ) ); 31 $o->r .= $this->next_step( 'results' ); 32 } 33 else 34 { 35 $o->bc->message( 'The broadcast data objects that could not be read have been deleted.' ); 36 } 24 37 return; 25 38 } … … 33 46 $row->th()->text( 'Belonging to post' ); 34 47 35 foreach( $this->data->broken_bcd as $id => $ bcd)48 foreach( $this->data->broken_bcd as $id => $ignore ) 36 49 { 50 $bcd = $this->data->broadcast_data->get( $id ); 51 if ( ! $bcd ) 52 continue; 37 53 $row = $table->body()->row(); 38 54 $row->td()->text_( $id ); -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_child_is_unlinked.php
r1229100 r3491158 15 15 if ( $button->pressed() ) 16 16 { 17 $batch_size = 200; 18 $processed = 0; 17 19 foreach( $this->data->child_is_unlinked as $id => $blog_post ) 18 20 { 19 21 // Create a link from all of the child posts back to this parent. 20 22 $bcd = $this->data->broadcast_data->get( $id ); 23 if ( ! $bcd ) 24 { 25 $this->data->child_is_unlinked->forget( $id ); 26 continue; 27 } 21 28 $child_blog_id = key( $blog_post ); 22 29 $child_post_id = reset( $blog_post ); … … 25 32 $o->bc->set_post_broadcast_data( $child_blog_id, $child_post_id, $child_bcd ); 26 33 $this->data->child_is_unlinked->forget( $id ); 34 $processed++; 35 if ( $processed >= $batch_size ) 36 break; 27 37 } 28 $o->bc->message( 'The children now have links back to the parents.' ); 38 $remaining = count( $this->data->child_is_unlinked ); 39 if ( $remaining > 0 ) 40 { 41 $o->bc->message( sprintf( 'Linked %d children. %d remaining.', $processed, $remaining ) ); 42 $o->r .= $this->next_step( 'results' ); 43 } 44 else 45 { 46 $o->bc->message( 'The children now have links back to the parents.' ); 47 } 29 48 return; 30 49 } -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_duplicate_bcd.php
r1229100 r3491158 15 15 if ( $button->pressed() ) 16 16 { 17 // Delete all of the duplicate post broadcast datas. 18 foreach( $this->data->duplicate_bcd as $bcd ) 17 $batch_size = 200; 18 $deleted = 0; 19 foreach( $this->data->duplicate_bcd as $id => $ignore ) 19 20 { 20 $o->bc->sql_delete_broadcast_data( $bcd->id ); 21 $this->data->duplicate_bcd->forget( $bcd->id ); 21 $o->bc->sql_delete_broadcast_data( $id ); 22 $this->data->duplicate_bcd->forget( $id ); 23 $deleted++; 24 if ( $deleted >= $batch_size ) 25 break; 22 26 } 23 $o->bc->message( 'The duplicate broadcast data objects have been deleted.' ); 27 $remaining = count( $this->data->duplicate_bcd ); 28 if ( $remaining > 0 ) 29 { 30 $o->bc->message( sprintf( 'Deleted %d duplicate broadcast data objects. %d remaining.', $deleted, $remaining ) ); 31 $o->r .= $this->next_step( 'results' ); 32 } 33 else 34 { 35 $o->bc->message( 'The duplicate broadcast data objects have been deleted.' ); 36 } 24 37 return; 25 38 } … … 33 46 $row->th()->text( 'Belonging to post' ); 34 47 35 foreach( $this->data->duplicate_bcd as $id => $ bcd)48 foreach( $this->data->duplicate_bcd as $id => $ignore ) 36 49 { 50 $bcd = $this->data->broadcast_data->get( $id ); 51 if ( ! $bcd ) 52 continue; 37 53 $row = $table->body()->row(); 38 54 $row->td()->text_( $id ); -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_missing_children.php
r1229100 r3491158 15 15 if ( $button->pressed() ) 16 16 { 17 $batch_size = 200; 18 $processed = 0; 17 19 foreach( $this->data->missing_children as $id => $blog_post ) 18 20 { … … 20 22 // Remove the link to this non-existent child. 21 23 $bcd = $this->data->broadcast_data->get( $id ); 24 if ( ! $bcd ) 25 { 26 $this->data->missing_children->forget( $id ); 27 continue; 28 } 22 29 $bcd->remove_linked_child( $child_blog_id ); 23 30 $o->bc->set_post_broadcast_data( $bcd->blog_id, $bcd->post_id, $bcd ); 24 31 $this->data->missing_children->forget( $id ); 32 $processed++; 33 if ( $processed >= $batch_size ) 34 break; 25 35 } 26 $o->bc->message( 'The missing children have been removed from the broadcast data.' ); 36 $remaining = count( $this->data->missing_children ); 37 if ( $remaining > 0 ) 38 { 39 $o->bc->message( sprintf( 'Removed %d missing children. %d remaining.', $processed, $remaining ) ); 40 $o->r .= $this->next_step( 'results' ); 41 } 42 else 43 { 44 $o->bc->message( 'The missing children have been removed from the broadcast data.' ); 45 } 27 46 return; 28 47 } -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_missing_parents.php
r1229100 r3491158 15 15 if ( $button->pressed() ) 16 16 { 17 $batch_size = 200; 18 $processed = 0; 17 19 foreach( $this->data->missing_parents as $id => $ignore ) 18 20 { 19 21 // Remove the link to this non-existent parent. 20 22 $bcd = $this->data->broadcast_data->get( $id ); 23 if ( ! $bcd ) 24 { 25 $this->data->missing_parents->forget( $id ); 26 continue; 27 } 21 28 $bcd->remove_linked_parent(); 22 29 $o->bc->set_post_broadcast_data( $bcd->blog_id, $bcd->post_id, $bcd ); 23 30 $this->data->missing_parents->forget( $id ); 31 $processed++; 32 if ( $processed >= $batch_size ) 33 break; 24 34 } 25 $o->bc->message( 'The missing parents have been removed from the broadcast data.' ); 35 $remaining = count( $this->data->missing_parents ); 36 if ( $remaining > 0 ) 37 { 38 $o->bc->message( sprintf( 'Removed %d missing parents. %d remaining.', $processed, $remaining ) ); 39 $o->r .= $this->next_step( 'results' ); 40 } 41 else 42 { 43 $o->bc->message( 'The missing parents have been removed from the broadcast data.' ); 44 } 26 45 return; 27 46 } -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_missing_post.php
r1229100 r3491158 15 15 if ( $button->pressed() ) 16 16 { 17 // Delete all of the missing post broadcast datas. 18 foreach( $this->data->missing_post as $id => $bcd ) 17 // Delete missing post broadcast data in batches to avoid memory spikes. 18 $batch_size = 200; 19 $deleted = 0; 20 foreach( $this->data->missing_post as $id => $info ) 19 21 { 20 $o->bc->sql_delete_broadcast_data( $bcd->id ); 21 $this->data->missing_post->forget( $bcd->id ); 22 $o->bc->sql_delete_broadcast_data( $id ); 23 $this->data->missing_post->forget( $id ); 24 $deleted++; 25 if ( $deleted >= $batch_size ) 26 break; 22 27 } 23 $o->bc->message( 'The broadcast data objects without existing posts have been deleted.' ); 28 $remaining = count( $this->data->missing_post ); 29 if ( $remaining > 0 ) 30 { 31 $o->bc->message( sprintf( 'Deleted %d broadcast data objects. %d remaining.', $deleted, $remaining ) ); 32 $o->r .= $this->next_step( 'results' ); 33 } 34 else 35 { 36 $o->bc->message( 'The broadcast data objects without existing posts have been deleted.' ); 37 } 24 38 return; 25 39 } … … 33 47 $row->th()->text( 'Belonging to post' ); 34 48 35 foreach( $this->data->missing_post as $id => $ bcd)49 foreach( $this->data->missing_post as $id => $info ) 36 50 { 37 51 $row = $table->body()->row(); 38 52 $row->td()->text_( $id ); 39 53 $row->td()->text_( 'Post %s on %s', 40 $ bcd->post_id,41 $this->blogname( $ bcd->blog_id)54 $info[ 'post_id' ], 55 $this->blogname( $info[ 'blog_id' ] ) 42 56 ); 43 57 } -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_parent_is_unlinked.php
r1229100 r3491158 15 15 if ( $button->pressed() ) 16 16 { 17 $batch_size = 200; 18 $processed = 0; 17 19 foreach( $this->data->parent_is_unlinked as $id => $blog_post ) 18 20 { 19 21 $bcd = $this->data->broadcast_data->get( $id ); 22 if ( ! $bcd ) 23 { 24 $this->data->parent_is_unlinked->forget( $id ); 25 continue; 26 } 20 27 $parent_blog_id = key( $blog_post ); 21 28 $parent_post_id = reset( $blog_post ); … … 24 31 $o->bc->set_post_broadcast_data( $parent_blog_id, $parent_post_id, $parent_bcd ); 25 32 $this->data->parent_is_unlinked->forget( $id ); 33 $processed++; 34 if ( $processed >= $batch_size ) 35 break; 26 36 } 27 $o->bc->message( 'The parents now have links back to the children.' ); 37 $remaining = count( $this->data->parent_is_unlinked ); 38 if ( $remaining > 0 ) 39 { 40 $o->bc->message( sprintf( 'Linked %d parents. %d remaining.', $processed, $remaining ) ); 41 $o->r .= $this->next_step( 'results' ); 42 } 43 else 44 { 45 $o->bc->message( 'The parents now have links back to the children.' ); 46 } 28 47 return; 29 48 } -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_same_parent.php
r1229100 r3491158 47 47 if ( $button->pressed() ) 48 48 { 49 $batch_size = 50; 50 $deleted = 0; 51 $stop = false; 49 52 foreach( $this->data->same_parent as $blog_id => $blog ) 50 53 { … … 65 68 66 69 $posts->forget( $id ); 70 $deleted++; 71 if ( $deleted >= $batch_size ) 72 { 73 $stop = true; 74 break; 75 } 67 76 } 68 $blog->forget( $post_id ); 77 if ( $posts->count() < 1 ) 78 $blog->forget( $post_id ); 79 if ( $stop ) 80 break; 69 81 } 70 $this->data->same_parent->forget( $blog_id ); 82 if ( $blog->count() < 1 ) 83 $this->data->same_parent->forget( $blog_id ); 84 if ( $stop ) 85 break; 71 86 } 72 $o->bc->message( 'The orphaned children have been deleted.' ); 87 88 $remaining = 0; 89 foreach( $this->data->same_parent as $blog ) 90 { 91 foreach( $blog as $posts ) 92 { 93 foreach( $posts as $post ) 94 if ( ! isset( $post->link ) ) 95 $remaining++; 96 } 97 } 98 99 if ( $remaining > 0 ) 100 { 101 $o->bc->message( sprintf( 'Deleted %d orphaned children. %d remaining.', $deleted, $remaining ) ); 102 $o->r .= $this->next_step( 'results' ); 103 } 104 else 105 { 106 $o->bc->message( 'The orphaned children have been deleted.' ); 107 } 73 108 return; 74 109 } -
threewp-broadcast/trunk/src/maintenance/checks/broadcast_data/traits/steps/step_results_fail_unnecessary_children.php
r1398263 r3491158 15 15 if ( $button->pressed() ) 16 16 { 17 // Delete all of the missing post broadcast datas. 18 foreach( $this->data->unnecessary_children as $id => $bcd ) 17 $batch_size = 200; 18 $processed = 0; 19 foreach( $this->data->unnecessary_children as $id => $ignore ) 19 20 { 21 $bcd = $this->data->broadcast_data->get( $id ); 22 if ( ! $bcd ) 23 { 24 $this->data->unnecessary_children->forget( $id ); 25 continue; 26 } 20 27 $bcd->remove_linked_children(); 21 28 $o->bc->set_post_broadcast_data( $bcd->blog_id, $bcd->post_id, $bcd ); 22 29 $this->data->unnecessary_children->forget( $id ); 30 $processed++; 31 if ( $processed >= $batch_size ) 32 break; 23 33 } 24 $o->bc->message( 'The broadcast data has been cleared of unnecessary children.' ); 34 $remaining = count( $this->data->unnecessary_children ); 35 if ( $remaining > 0 ) 36 { 37 $o->bc->message( sprintf( 'Removed unnecessary children for %d posts. %d remaining.', $processed, $remaining ) ); 38 $o->r .= $this->next_step( 'results' ); 39 } 40 else 41 { 42 $o->bc->message( 'The broadcast data has been cleared of unnecessary children.' ); 43 } 25 44 return; 26 45 } … … 34 53 $row->th()->text( 'Belonging to post' ); 35 54 36 foreach( $this->data->unnecessary_children as $id => $ bcd)55 foreach( $this->data->unnecessary_children as $id => $ignore ) 37 56 { 57 $bcd = $this->data->broadcast_data->get( $id ); 58 if ( ! $bcd ) 59 continue; 38 60 $row = $table->body()->row(); 39 61 $row->td()->text_( $id ); -
threewp-broadcast/trunk/src/maintenance/checks/simple_broadcast_data/check.php
r3445175 r3491158 59 59 global $wpdb; 60 60 $table = $this->broadcast()->broadcast_data_table(); 61 $query = $wpdb->prepare( 'SELECT * FROM %i LIMIT %d OFFSET %d',61 $query = $wpdb->prepare( 'SELECT * FROM %i WHERE `id` > %d ORDER BY `id` LIMIT %d', 62 62 [ 63 63 $table, 64 $this->data-> per_page,65 $this->data-> counter64 $this->data->last_id, 65 $this->data->per_page 66 66 ] ); 67 67 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- False positive. Prepared above. 68 68 $rows = $wpdb->get_results( $query ); 69 69 70 $r .= wpautop( sprintf( 'Checking from row %d.', $this->data->counter ) ); 70 if ( count( $rows ) < 1 ) 71 { 72 $r .= wpautop( sprintf( 'Finished checking %d rows.', $this->data->checked_rows ) ); 73 return $r; 74 } 75 76 $r .= wpautop( sprintf( 'Checking from row %d of %d.', $this->data->checked_rows, $this->data->count ) ); 71 77 72 78 foreach( $rows as $row ) 73 79 { 80 $this->data->last_id = max( $this->data->last_id, (int) $row->id ); 81 $this->data->checked_rows++; 74 82 $delete_query = $wpdb->prepare( "DELETE FROM %i WHERE `id` = %d", [ $table, $row->id ] ); 75 83 … … 109 117 } 110 118 111 if ( $this->data->counter > $this->data->count)112 $r .= wpautop( sprintf( 'Finished checking %d rows.', $this->data->c ounter) );119 if ( count( $rows ) < $this->data->per_page ) 120 $r .= wpautop( sprintf( 'Finished checking %d rows.', $this->data->checked_rows ) ); 113 121 else 114 {115 $this->data->counter += $this->data->per_page;116 122 $r .= $this->next_step( 'check_rows' ); 117 }118 123 119 124 return $r; … … 132 137 $count = $wpdb->get_var( $query ); 133 138 134 $this->data->counter = 0; 139 $this->data->last_id = 0; 140 $this->data->checked_rows = 0; 135 141 $this->data->count = $count; 136 142 $this->data->per_page = 100; -
threewp-broadcast/trunk/src/maintenance/checks/view_post_info/check.php
r3445175 r3491158 77 77 { 78 78 $json_decoded = json_decode( $value ); 79 $maybe_unserialized = maybe_unserialize( $value );79 $maybe_unserialized = @ unserialize( $value ); 80 80 81 81 $exportable = false; 82 if ( $json_decoded )82 if ( $json_decoded !== null ) 83 83 $exportable = $json_decoded; 84 if ( $maybe_unserialized ) 85 $exportable = $maybe_unserialized; 84 if ( ! $exportable ) 85 if ( $maybe_unserialized !== false ) 86 $exportable = $maybe_unserialized; 86 87 87 88 if ( $exportable ) 88 89 $value = var_export( $exportable, true ); 89 else 90 $value = htmlspecialchars( $value ); 90 91 $value = htmlspecialchars( $value ); 92 91 93 $metas [ $key ] []= $value; 92 94 } -
threewp-broadcast/trunk/src/traits/broadcasting.php
r3445175 r3491158 396 396 $this->debug( "Ignoring post's parent." ); 397 397 398 $broadcasting_data->existing_child_post = false; 398 399 // Insert new? Or update? Depends on whether the parent post was linked before or is newly linked? 399 400 $need_to_insert_post = true; … … 408 409 if ( is_a( $child_post, 'WP_Post' ) ) 409 410 { 411 $broadcasting_data->existing_child_post = $child_post; 410 412 $temp_post_data = $bcd->new_post; 411 413 $temp_post_data->ID = $child_post_id;
Note: See TracChangeset
for help on using the changeset viewer.