Recently, Constantinescu and Ilie proved a variant of the well-known periodicity theorem
of Fine and Wilf in the case of two relatively prime abelian periods and conjectured a
result for the case of two non-relatively prime abelian periods. In this paper, we answer
some open problems they suggested. We show that their conjecture is false but we give
bounds, that depend on the two abelian periods, such that the conjecture is true for all
words having length at least those bounds and show that some of them are optimal. We also
extend their study to the context of partial words, giving optimal lengths and describing
an algorithm for constructing optimal words.