• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

If I disable an addon does that kill it's negative effect?

=MGN=RedEagle

Well-known member
#1
If I disable an addon does that kill it's negative effects? Is there any addon that changes the core code in such a way that it is not reversible with either disable or install options?
 

woei

Well-known member
#2
Depends on the add-on. When installing an add-on there can be mysql queries executed that damage or alter the database. So I always test the before installing them into a live environment.

But it all depends on the add-on. Most add-ons create custom tables in your database to work and don't alter the original xenforo structure or tables, but it all depends on the add-on. So can't say it enough, test! test test :p
 

borbole

Well-known member
#4
Thanks! Any easy way to check for addons that alter the database?
All add ons that modfiy the database usually come with an install file where all the db stuff that that add on adds/modifies are added. Simply view that file to see how that particular add on affects your db.
 

Chris D

XenForo developer
Staff member
#6
Also, if a developer follows best practise it should never affect the database in a negative way.

Some of the best practise includes:
  • Prefixing tables and columns with something unique to the developer or add-on. As we have seen, not doing this will cause clashes with other add-ons or core upgrades. As an option, you could still prefix your table with xf_ as long as something unique follows it. Tables prefixed with xf_ will be removed if a person decides to do a clean install of XenForo via the Install system.
  • All changes should be removed upon uninstall with no exception. This should include removing orphaned data such as permissions, content type data (e.g. likes, attachments).
  • Always include a default value on any added column. Don't just handle the default value in the DataWriter as that will only work while the add-on is enabled. Some column types do not allow a default value (e.g. BLOB), in these cases NULL should be allowed.
 

Alfa1

Well-known member
#9
make a mandatory field in the resource manager to fill in database changes, another one for the table prefix used.
Don't allow creation of tables, fields or columns without first defining a prefix.
 

Chris D

XenForo developer
Staff member
#10
The first one would be useful.

The second one is just something that cannot be controlled. Even if there was some sort of helper that did some sort of validation (that would be pretty complicated), it wouldn't prevent people still doing their own thing. It's just not possible to reliably control it.
 

Brogan

XenForo moderator
Staff member
#11
It also doesn't address the problem of the uninstall code correctly removing/reverting everything.

In short it comes down to individual developers to do things as well as they can, from writing the code, to creating the resource content, documenting changes, etc.
 

Brogan

XenForo moderator
Staff member
#13
It's basically common sense.
Any competent developer should know what to do.

The table prefix issue has been posted about numerous times, yet some developers still ignore it.
So again, any sort of guide would still be ignored by some.
 

Alfa1

Well-known member
#14
If there would be an official guidance, then users could point developers to the guidance if they do not follow best practices. That would have some beneficial effect. In the past I have asked addon developers to apply some of the best practices listed above. But I am just an addon user with an opinion. It has much more weight if its an official practice that is expected of developers.

One thing that could be of use is to add a simple tickbox to the RM to select if the best practices guidelines have been followed. (with a link to the guidelines)
This way all addon developers are certainly aware of the best practices.
 

=MGN=RedEagle

Well-known member
#15
If there would be an official guidance, then users could point developers to the guidance if they do not follow best practices. That would have some beneficial effect. In the past I have asked addon developers to apply some of the best practices listed above. But I am just an addon user with an opinion. It has much more weight if its an official practice that is expected of developers.

One thing that could be of use is to add a simple tickbox to the RM to select if the best practices guidelines have been followed. (with a link to the guidelines)
This way all addon developers are certainly aware of the best practices.
Good idea!