(1) The court shall, upon petition filed by a grandparent of a minor child, award
reasonable rights of visitation to the grandparent with respect to the child
when it is in the best interest of the minor child if:
(a) The marriage of the parents of the child has been dissolved;
(b) A parent of the child has deserted the child; or
(c) The minor child was born out of wedlock and not later determined to be a child born within wedlock as provided in s. 742.091.
(2) In determining the best interest of the minor child, the court shall consider:
(a) The willingness of the grandparent or grandparents to encourage a close relationship between the child and the parent or parents.
(b) The length and quality of the prior relationship between the child and the grandparent or grandparents.
(c) The preference of the child if the child is determined to be of sufficient maturity to express a preference.
(d) The mental and physical health of the child.
(e) The mental and physical health of the grandparent or grandparents.
(f) Such other factors as are necessary in the particular circumstances.