Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Simple:Press > The Events Calendar sp_get_option(), response
Avatar
Thorsten B
Member
sp_UserOfflineSmall Offline
Dec 17, 2013 - 2:56 am

Just a quick note that I posted in the TEC support forum concerning this error (when activating S:P after TEC):

Fatal error: Cannot redeclare sp_get_option() in public_html/ecourses/wp-content/plugins/simple-press/sp-api/sp-api-primitives.php on line 81

Here's what they had to say:

Howdy, Thank you for reporting this. You have activated the plugins in the correct order and should be in good sorts going forward. Upon activation our plugin checks to see if there there is a conflict and resolves it. Unfortunately the S:P plugin does not check for conflicts. So if S:P is activated second it will generate an error. Only S:P would be able to detect/problem-with-post-edit-buttonandle that error. Does that make sense? Definitely let us know if you experience any issues resulting from this, but now that you have activated it in the right order you should be fine. - Brook

Alas, they are saying this isn't their problem.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 17, 2013 - 3:51 am

Thorsten B said
Alas, they are saying this isn't their problem.

That is NOT how I read that response. What they seem to me to be saying is that as long as you activate plugins in the right order then things will be fine. Order is actually important but something that rarely gets discussed. WordPress will 'include' the code form each plugin in the order in which they are activated. Changing that order can often clear up minor issues.

So - they say that in the right order it self-detects the issue. This means they perform a 'function-exists' check. How they then run the functions they wanted to run I have no idea of course - without looking at their code. But clearly they state they do this. And they are right. We do not. If we put one of these checks around every function it would seriously add to the bulk of the code as well as take a performance hit.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2013 - 10:54 pm

sorry, check if the function exists makes no sense either...  if we checked and did not declare our function, we would instead call their function and you would have a whole slew of new problems...  we would not get the data returned needed... and frankly, that would be very hard troubleshoot - much easier to get a duplicate error and know what the problem is...

unfortunately, with plugins and themes, you will always run the risk of duplicate functions - thats the reason most plugins prefix the functions, variables, etc... in this case, bad luck, we both prefixed it the same... 

Avatar
Thorsten B
Member
sp_UserOfflineSmall Offline
Dec 18, 2013 - 10:48 am

My question rather is why a plugin called The Events Calendar prefixes a function with sp_ and not, say, tec_. Oh well. I'll just keep the activation order in mind for future troubleshooting.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 18, 2013 - 11:17 am

Only they could tell you that. The WP recommendation is to use the initials of the plugin name but it is just a guideline. As Steve said - clashes and conflicts of this nature will happen even if rarely.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 617
Members: 17348
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10119
Posts: 79604