You should replace: the $item->save(); with below code
$item->getResource()->saveAttribute($item, 'visibility');:
$item->getResource()->saveAttribute($item, 'status');
$item->getResource()->saveAttribute($item, 'visibility');
$item->getResource()->saveAttribute($item, 'status');