I think the advice “do whatever you have to do to publish and graduate” is good advice. Whether this is better achievable through secondary authorships (which also are very valuable for networking—you’ll need a job once you get your Ph.D.) or through focusing on your thesis, I can’t say. It depends on your field and the specifics of your situation. But you need to be focused on graduating—“almost there but not quite” for many years is a very common failure mode for grad students.
I think the advice “do whatever you have to do to publish and graduate” is good advice. Whether this is better achievable through secondary authorships (which also are very valuable for networking—you’ll need a job once you get your Ph.D.) or through focusing on your thesis, I can’t say. It depends on your field and the specifics of your situation. But you need to be focused on graduating—“almost there but not quite” for many years is a very common failure mode for grad students.