| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | protected function result() { |
||
| 23 | |||
| 24 | Jetpack::init(); |
||
| 25 | /** This action is documented in class.jetpack.php */ |
||
| 26 | |||
| 27 | $sync_queue = Jetpack_Sync_Client::getInstance()->get_sync_queue(); |
||
| 28 | |||
| 29 | // lock sending from the queue while we compare checksums with the server |
||
| 30 | $result = $sync_queue->lock( 30 ); // tries to acquire the lock for up to 30 seconds |
||
| 31 | |||
| 32 | if ( !$result ) { |
||
| 33 | return new WP_Error( 'unknown_error', 'Unknown error trying to lock the sync queue' ); |
||
| 34 | } |
||
| 35 | |||
| 36 | if ( is_wp_error( $result ) ) { |
||
| 37 | return $result; |
||
| 38 | } |
||
| 39 | |||
| 40 | $store = new Jetpack_Sync_WP_Replicastore(); |
||
| 41 | |||
| 42 | return $store->checksum_all(); |
||
| 43 | |||
| 44 | } |
||
| 45 | } |
||
| 46 |
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.