Total different taxonomies terms in system - 13000. I`m updating 150 terms in cycle.
foreach ( $region_city as $region => $city ){
$args = [
'slug' => sanitize_title($city),
'parent'=> $region_term_id,
];
wp_update_term( $city_term_id, 'location', $args );
}
Single wp_update_term execution is up to one second. But cycle is taking over 10 minutes.
When I`m trying to break cycle in few steps the feeling is each next wp_update_term execution time is increasing.
What can be possible reason? Is there some function or $wpdb cache?
May be there is accumulation of data in function hooks/filter?
ps. This script was perfectly working before. Recent changes on server is php upgrade 5.6 > 7.3 . Opcache is enabled.