A well plug for use in a wellbore comprising: - a ball valve disposed in a central straight passage along the plug's main axis of rotation, - a flexible expandable seal and a metallic gripping member operable by rotating a hollow leadscrew around the main axis and relative to an outer housing, - a transmission shaft (120, 140, 220) rotatable about the main axis and having a through axial bore forming part of the passage, characterized in that the transmission shaft (120, 140, 220) and the leadscrew, are connected by at least one peg (161, 231) on one of them slidably inserted in at least one groove in the other, which groove extends perpendicular to the main axis along a circumference and defines an angle of free motion wherein the transmission shaft (120, 140, 220) can be rotated relative to the leadscrew, at least one peg (161, 231) being slidably inserted in at least one cam track on an activating sleeve, which cam track comprises a middle part extending perpendicular to the main axis along part of the circumference of the sleeve and two ends (221 a, 221 b) at an axial distance from the middle part, the activating sleeve being connected to the ball of the ball valve through means (225, 230) for converting axial movement of the activating sleeve to rotation of the ball, wherein the ball valve is open when the at least one peg (161, 231) is near an end (221 a, 221 b) of the at least one cam track and closed when the at least one peg (161, 231) is near the middle part of the at least one cam track. - a ball valve disposed in a central straight passage along the plug's main axis of rotation, - a flexible expandable seal and a metallic gripping member operable by rotating a hollow leadscrew around the main axis and relative to an outer housing, - a transmission shaft (120, 140, 220) rotatable about the main axis and having a through axial bore forming part of the passage, characterized in that the transmission shaft (120, 140, 220) and the leadscrew, are connected by at least one peg (161, 231) on one of them slidably inserted in at least one groove in the other, which groove extends perpendicular to the main axis along a circumference and defines an angle of free motion wherein the transmission shaft (120, 140, 220) can be rotated relative to the leadscrew, at least one peg (161, 231) being slidably inserted in at least one cam track on an activating sleeve, which cam track comprises a middle part extending perpendicular to the main axis along part of the circumference of the sleeve and two ends (221 a, 221 b) at an axial distance from the middle part, the activating sleeve being connected to the ball of the ball valve through means (225, 230) for converting axial movement of the activating sleeve to rotation of the ball, wherein the ball valve is open when the at least one peg (161, 231) is near an end (221 a, 221 b) of the at least one cam track and closed when the at least one peg (161, 231) is near the middle part of the at least one cam track. the transmission shaft (120, 140, 220) and the leadscrew, are connected by at least one peg (161, 231) on one of them slidably inserted in at least one groove in the other, which groove extends perpendicular to the main axis along a circumference and defines an angle of free motion wherein the transmission shaft (120, 140, 220) can be rotated relative to the leadscrew, at least one peg (161, 231) being slidably inserted in at least one cam track on an activating sleeve, which cam track comprises a middle part extending perpendicular to the main axis along part of the circumference of the sleeve and two ends (221 a, 221 b) at an axial distance from the middle part, the activating sleeve being connected to the ball of the ball valve through means (225, 230) for converting axial movement of the activating sleeve to rotation of the ball, wherein the ball valve is open when the at least one peg (161, 231) is near an end (221 a, 221 b) of the at least one cam track and closed when the at least one peg (161, 231) is near the middle part of the at least one cam track.