The 2009 champion at Roland Garros, despite being broken early in the match, beat French wild card Maxime Teixeira 6-3, 6-0, 6-2 to reach the third round. Teixeira is 1-1 at the French Open after winning his first tour-level match on Sunday.
"He fought hard, and afterwards he was trying to get the best score," Federer said of his 22-year-old opponent. "The score was balanced for 1½ sets, but even then he fought hard."
Later Wednesday, Novak Djokovic was scheduled to be back on court in the second round, as well as 2010 French Open champion Francesca Schiavone.
Federer didn't face a single break point in his opening match, and Teixeira managed only one on Wednesday — and he converted it. After the Frenchman held to go to 3-3, Federer dominated and didn't lose another game until the Teixeira made it 4-1 in the third set.
"During 1½ sets you're really well focused, and after this you can relax a little at the end of the match. And it was a bit simpler as well at the end," Federer said. "Now I'm very happy with these types of matches. I can practice more and so on, but now I'm really in the tournament, which is a good thing."
Teixeira had beaten another French wild card, Vincent Millot, in the first round.
"I gave it all. I did what I could," Teixeira said. "To play against Roger is an incredible experience. I'll never forget it and it will be great memories."
Federer will face 29th-seeded Janko Tipsarevic, who beat Pere Riba of Spain 6-1, 6-3, 6-0. Tipsarevic took Federer to five sets in the third round of the 2008 Australian Open, eventually losing 10-8.
"I think he's a dangerous player on the big courts against the big players. He played really well against these players, so let's be careful," Federer said. "Let's be ready in advance, because he can vary his game on hard courts, on clay as well. He can do all sorts of things."
Ferrer advanced by beating Julien Benneteau 6-3, 6-4, 6-2. The Spaniard has twice reached the quarterfinals at Roland Garros, in 2005 and '08.
No. 31 Sergiy Stakhovsky of Ukraine also made it through.
Wozniacki beat Aleksandra Wozniak of Canada 6-3, 7-6 (6). The Dane trailed 6-3 in the tiebreaker but won the final five points, saving three set points to reach the third round.
"I started off really well, and everything was going the way I wanted it to," said Wozniacki, who is still chasing her first Grand Slam title. "Second set, she played better. I started to play a little bit worse."
Wozniacki, who won despite hitting nine fewer winners than her opponent, again played with a bandage on her left thigh.
"It's preventative," Wozniacki said. "I felt it a little bit last week and I didn't want to make it worse, so I just do it for protection, because, I mean, there is no reason to make it worse."
Stosur, who lost to Schiavone in last year's final at Roland Garros, advanced to the third round by beating Simona Halep 6-0, 6-2. The eighth-seeded Stosur had 21 winners and broke her opponent six times before she served out the match at love.
No. 10 Jelena Jankovic of Serbia, No. 13 Svetlana Kuznetsova of Russia, No. 14 Anastasia Pavlyuchenkova of Russia, No. 17 Julia Goerges of Germany and No. 28 Daniela Hantuchova of Slovakia also won. Gisela Dulko of Argentina eliminated No. 32 Tsvetana Pironkova of Bulgaria.