WordPoints / wordpoints

Points plugin for WordPress
GNU General Public License v2.0
20 stars 15 forks source link

Warn when a module path is registered that doesn't point to the modules directory #431

Open JDGrimes opened 8 years ago

JDGrimes commented 8 years ago

When a module path is registered in WordPoints_Module_Paths::register(), it needs to be the path to the module in the modules directory. From that will we get the realpath. However, it is easy to forget this and register the wrong path, e.g. https://github.com/WordPoints/dev-lib/issues/143. We should probably give a _doing_it_wrong() notice when the realpath is passed instead of the modules directory path.

JDGrimes commented 8 years ago

I was going to wonder how this might affect code using multiple module directories (which is now theoretically possible, though probably not useful). However, I guess there is really no problem there, we'll just base this on whichever directory is "current" (since this would have to be controlled through a filter).