Only consider files ending in ".php" to restrict widgets and avoid load wrong files. It should fix #2761