New York Mets' Neil Walker is congratulated in the dugout...

New York Mets' Neil Walker is congratulated in the dugout after hitting a two-run home run against the Detroit Tigers during the ninth inning of an interleague baseball game Sunday, Aug. 7, 2016, in Detroit. Credit: AP / Duane Burleson

For the first time in his life, Neil Walker is set to become a free agent.

But will he get a chance to test the market?

On Tuesday, Sandy Alderson said the Mets, encouraged by Walker’s recent hot streak at the plate, would be open to negotiating a contract extension before the end of the season.

“He’s certainly been very productive over the last couple of weeks at a time when we needed that productivity with some of the injuries and other issues,” said Alderson, whose club has placed Yoenis Cespedes, Jose Reyes, Juan Lagares and Asdrubal Cabrera on the disabled list in the last two weeks. “I have not had any conversations with his agent at this point. I expect that there will be some conversations before the end of the season.”

Walker, 30, has hit .469 with three home runs over his last 12 games to raise his season marks to .268 and 19 — after a prolonged midseason slump forced Terry Collins to bench the second baseman two straight days near the end of July. Walker’s 2.7 wins above replacement ranked fourth among National League second basemen before Tuesday’s games (Daniel Murphy led the group with 4.4).

“Neil’s had a very nice season for us, no question about that,” Alderson said.

But as productive as Walker has been, his leadership as a newcomer to the defending NL champions has been immeasurable — especially considering David Wright’s absence and Michael Cuddyer’s retirement.

“There’s a tough time once in a while during a game where some things will go on and I’ll tell you, Neil Walker speaks up,” Terry Collins said. “Guys respond when their teammates have something to say, and people listen. He’s been that for us, and I’ll tell you, with David being down and not on the road we’ve got to have somebody that’s been a take-charge guy.”

Said Alderson: “He’s been excellent in the clubhouse.”

Walker, who went to arbitration four times with his hometown Pittsburgh Pirates, said he always focuses on the day-to-day activities during the season. But he also said he was “sure those [contract] conversations will happen at some point this year moving into September and October.

“It certainly is interesting to think about what could happen this offseason as far as teams’ interest and things like that,” Walker said. “But when you look at the big picture and what’s going on here and you look at at how I fit in here and how happy I’ve been with the camaraderie and the front office and the coaching staff and the players, this is a really good fit for me. We’ll see how things come about, but I’m very, very open to [an extension].”

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 5 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME