In 1912, two years before the start of World War I, the French and Spanish agreed to become “‘protecting powers’ for France’s puppet sultan” in Morocco. This agreement exemplified, as had been the case for numerous decades, that the Ottoman Empire was what Tsar Nicholas I called “the sick man of Europe.” When The Great War ended officially in the summer of 1919, the approximately 600-year-old empire soon ended as well.
Regarding Spain and France, the former didn’t fight in the war, while the latter suffered extensively from it. Spain was already in a weakened state, militarily and politically, before the war; France was weakened afterward. This was the setting for the Moroccan-based Rif War.