dirname() is a slow function compared with __DIR__ and using
'/../'. Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code. This allows those required includes to perform as
best as possible in this situation.
Thanks to Tõnis Tartes for part of this solution.
When force format was selected in the options, trying to view the
wiki would redirect to the front page with a message saying that
you do not have permission to edit this page. Students had no way
of viewing any entries or creating the first page.
When in force format it skips a page , which would be considered
uncessary for students, but this means that the group id is not set
and this is what is causing most of the problems.
I also have included a check to see if the title is default and whether
the user has permission to view all groups. In these situations the
intermediate page is displayed.