Use mp4 as the default file extension if none provided
Fix incorrect variable name
Fix page count
Fix php code sniff warnings