Open joyously opened 3 years ago
TKT_MAINTENANCE_VERSION
because that constant might not be defined, for whatever reason, thus, we go safe and define a class property with the variable to be used thru the entire plugin. This value falls back to a default version just in case constant is not defined.Keeping this issue open for eventual followup after WPPB replies.
Since the entire Plugin is OOP
Many programmers think they are doing OOP, but it is really object-based, and a mess. You have no real objects, since none are needed in this plugin. And any object that needs a controller or outside thingy to "make it go" isn't designed as OOP. The WordPress environment, and PHP, are not the right place for OOP because you have to force it. I don't agree with using classes just to use classes, but if you choose to do that, don't call it OOP when it's not.
https://github.com/TukuToi/tkt-maintenance/blob/18c552f0089296be71e39d1c9521a61df0f6d6e1/includes/class-tkt-maintenance.php#L17
Maybe it's just me, but you shouldn't use the word "core" anywhere in a plugin.
https://github.com/TukuToi/tkt-maintenance/blob/18c552f0089296be71e39d1c9521a61df0f6d6e1/includes/class-tkt-maintenance.php#L22
This contradicts the fact that the plugin headers are in the main file and there is a
define
there for the version number.https://github.com/TukuToi/tkt-maintenance/blob/18c552f0089296be71e39d1c9521a61df0f6d6e1/includes/class-tkt-maintenance.php#L110
Why load both admin and front end for every request? It's either one or the other, not both.
https://github.com/TukuToi/tkt-maintenance/blob/18c552f0089296be71e39d1c9521a61df0f6d6e1/includes/class-tkt-maintenance.php#L155
Why do you need a whole class for a single function call?
https://github.com/TukuToi/tkt-maintenance/blob/18c552f0089296be71e39d1c9521a61df0f6d6e1/includes/class-tkt-maintenance.php#L140
Why is the loader separate? You have a main class to load the loader. Weird.