Mi pare tutto corretto,
l'unica proverei ad utilizzare la file_exist() anzichè is_file().

PS: $MAX_ARTICLES è > 0?

Ciao