Cyber sale! 35% Off use code EVO-CYBER23 Shop Now
ends midnight 12/2 PST
As the subject says, the latest version of EventON Weekly View does not work with recent versions of EventON core. It will deactivate itself automatically. I have written a patch to fix this:
— eventon-weekly-view.php 2023-09-07 16:33:18
+++ eventon-weekly-view-modified.php 2023-09-07 16:33:14
@@ -32,13 +32,17 @@
return self::$_instance;
}
public function __construct(){
+ $this->super_init();
+ add_action(‘plugins_loaded’, array($this, ‘plugin_init’));
+ }
+
+ public function plugin_init(){
// check if eventon exists with addon class
if( !isset($GLOBALS[‘eventon’]) || !class_exists(‘evo_addons’) ){
add_action(‘admin_notices’, array($this, ‘notice’));
return false;
}
– $this->super_init();
$this->addon = new evo_addons($this->addon_data);
if($this->addon->evo_version_check()){
No newline at end of file
thats odd as it works on our test sites. are you using eventon core 4.4.4
Yup, I have EventOn 4.4.4 and EventON – Weekly View 2.0.1.
The Weekly View plugin displays this message without my patch:
EventON WeeklyView is NOT active! – You do not have EventON main plugin, which is REQUIRED.
My patch basically mimics the way the RSVP add-on handles checking for the core plugin.
I’m not sure if it has anything to do with the fact that with the way we install plugins, EventON core gets installed to an eventon
directory instead of eventON
(because Composer requires package names be all lowercase) and maybe that messes up the order of loading plugins. But with my patch making the weekly view add-on check for core the same way the other add-ons do it fixes it.
Hello,
Thank you for the info! I am going to assign this ticket to Ashan, so he can check your solution.
Could you tell us about this:
…because Composer requires package names be all lowercase…
How do you install plugins? EventON should be installed into eventON folder.
We manage a large number of client websites, so we have our own private repository from where plugins and WordPress core are installed via composer, however composer requires packages to have an all lowercase name/directory so it is not possible for us to install EventON core to the “eventON” directory, it has to be “eventon”.
A WordPress plugin should not care about what it’s directory name is (this is standard with most plugins out there), and as I said before, your other plugins handle this nicely by using the plugins_loaded
hook to check for the existence of the eventon
global variable after all plugins have been loaded. The weekly-view add-on is the only plugin that has this problem and doesn’t do things like your other add-ons. The patch I came up with was copied directly from your RSVP add-on and works nicely in the weekly-view add-on.
I could just continue patching your plugin every time we install it but that would be silly. Ideally you guys would just release a 2.0.2 version of the weekly-view add-on with my patch updates applied (only 5 lines of code added and 1 line removed).
Thank you for the info! Ashan will check this ASAP.
Hey Artem, any updates?
No new updates, I am afraid. Ashan will check this ASAP.
Thank you for sharing the code modification, in fact that is very close to the codes we use in our other addons, weeklyview was not updated with that. We will release this new update right now.
Again Kodie many thanks for sharing this code changes!
Done https://x.com/myeventon/status/1704238383344804280?s=20 🙂
Thank you and your welcome!
If you have a moment, we would greatly appreciate if you could kindly leave us a review at myeventon/my-account!. Cheers!