_item_size == relationships objects left. $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE ( object_id = %d AND term_taxonomy_id < %d ) OR ( object_id < %d ) ORDER BY object_id DESC, term_taxonomy_id DESC LIMIT %d", $last_object_enqueued['object_id'], $last_object_enqueued['term_taxonomy_id'], $last_object_enqueued['object_id'], 1 ) ); if ( 0 === (int) $count ) { return array( $items_enqueued_count, true ); } return array( $items_enqueued_count, $last_object_enqueued ); } /** * Return the initial last sent object. * * @return string|array initial status. */ public function get_initial_last_sent() { return array( 'object_id' => self::MAX_INT, 'term_taxonomy_id' => self::MAX_INT, ); } /** * Given the Module Full Sync Configuration and Status return the next chunk of items to send. * * @param array $config This module Full Sync configuration. * @param array $status This module Full Sync status. * @param int $chunk_size Chunk size. * * @return array|object|null */ public function get_next_chunk( $config, $status, $chunk_size ) { global $wpdb; return $wpdb->get_results( $wpdb->prepare( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships WHERE ( object_id = %d AND term_taxonomy_id < %d ) OR ( object_id < %d ) ORDER BY object_id DESC, term_taxonomy_id DESC LIMIT %d", $status['last_sent']['object_id'], $status['last_sent']['term_taxonomy_id'], $status['last_sent']['object_id'], $chunk_size ), ARRAY_A ); } /** * Return last_item to send for Module Full Sync Configuration. * * @param array $config This module Full Sync configuration. * * @return array|object|null */ public function get_last_item( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable global $wpdb; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery return $wpdb->get_results( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships ORDER BY object_id , term_taxonomy_id LIMIT 1", ARRAY_A ); } /** * * Enqueue all $items within `jetpack_full_sync_term_relationships` actions. * * @param array $items Groups of objects to sync. * @param array $previous_interval_end Last item enqueued. * * @return array Last enqueued object. */ public function bulk_enqueue_full_sync_term_relationships( $items, $previous_interval_end ) { $listener = Listener::get_instance(); $items_with_previous_interval_end = $this->get_chunks_with_preceding_end( $items, $previous_interval_end ); $listener->bulk_enqueue_full_sync_actions( 'jetpack_full_sync_term_relationships', $items_with_previous_interval_end ); $last_item = end( $items ); return end( $last_item ); } /** * Retrieve an estimated number of actions that will be enqueued. * * @access public * * @param array $config Full sync configuration for this sync module. * @return int Number of items yet to be enqueued. */ public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable global $wpdb; $query = "SELECT COUNT(*) FROM $wpdb->term_relationships"; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching $count = (int) $wpdb->get_var( $query ); return (int) ceil( $count / Settings::get_setting( 'term_relationships_full_sync_item_size' ) ); } /** * Retrieve the actions that will be sent for this module during a full sync. * * @access public * * @return array Full sync actions of this module. */ public function get_full_sync_actions() { return array( 'jetpack_full_sync_term_relationships' ); } /** * Expand the term relationships within a hook before they are serialized and sent to the server. * * @access public * * @param array $args The hook parameters. * @return array $args The expanded hook parameters. */ public function expand_term_relationships( $args ) { list( $term_relationships, $previous_end ) = $args; return array( 'term_relationships' => $term_relationships, 'previous_end' => $previous_end, ); } }
Fatal error: Uncaught Error: Class "Automattic\Jetpack\Sync\Modules\Term_Relationships" not found in /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php:142 Stack trace: #0 [internal function]: Automattic\Jetpack\Sync\Modules::load_module('Automattic\\Jetp...') #1 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php(126): array_map(Array, Array) #2 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php(67): Automattic\Jetpack\Sync\Modules::initialize_modules() #3 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php(86): Automattic\Jetpack\Sync\Modules::get_modules() #4 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php(76): Automattic\Jetpack\Sync\Listener->init() #5 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php(63): Automattic\Jetpack\Sync\Listener->__construct() #6 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php(759): Automattic\Jetpack\Sync\Listener::get_instance() #7 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php(146): Automattic\Jetpack\Sync\Actions::initialize_listener() #8 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-main.php(111): Automattic\Jetpack\Sync\Actions::init() #9 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\Jetpack\Sync\Main::on_plugins_loaded_late('') #10 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #11 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #12 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #13 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #14 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #15 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #16 /htdocs/index.php(17): require('/htdocs/wp-blog...') #17 {main} thrown in /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php on line 142