Integration Hooks Report

Started by emanuele, January 08, 2012, 09:56:03 AM

Previous topic - Next topic

emanuele

Complete credit for this mod goes to [SiNaN] (to me only the blames for having uploaded it only after several months...sorry everybody)

This mod adds an admin page where all the active hooks are presented.

Starting with version 1.3 it's possible to disable active hooks.
Please note disable hooks will most likely remove functionalities added by mods and in certain cases could break your forum! Do it only if you are absolutely sure of what you are doing
...I know this warning is useless and someone will eventually break it... :P ...well, it's not my fault.

The mod is also available at github: https://github.com/emanuele45/IntegrationHooks

Translations not yet in the package

Version log

  • 1.0: initial release (thanks [SiNaN])
  • 1.1: added recursive scan of $sourcedir (see Feline's comment)
  • 1.2: fixed a couple of issues (thanks [SiNaN]) and added Russian translation (thanks Bugo)
  • 1.3: added inactivation of hooks and filter by hook - fixed issues reported by Bugo and updated Russian translation (thanks Bugo)
  • 1.4: fixed undefined index error reported by phantomm; added Spanish Latin (thanks 4Kstore) and Polish translations (thanks phantomm); fixed another error (wrong icon for delete)
  • 1.5: fixed the enabling/disabling and removal of hooks that were broken...
  • 1.5.1: restored the filter, added Italian translation, ignoring backup files, other minor fixes
  • 1.5.2: fixed hooks to be php 5.4 friendly; fixed (again) hooks filter function that was breaking the disabling of hooks; update Russian translation (thanks Bugo)
  • 1.5.3: added Dutch translation (by Yoshi2889)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Norv

Thank you, Emanuele, I think this mod will be useful for admins to know what hooks did mods add and eventually remove those they may not want or need (such as a menu/submenu item they may find to add too much to their menus). As a step towards a true menu editor, that. ;)

Or, if a hooked function is causing problems, the admin interface for hooks may allow to see which it is - unless the problematic function is affecting admin panel itself, of course.

I wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

ascaland

Quote from: Norv on January 08, 2012, 12:12:00 PM
I wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?

Enable/disable hooks from being executed? Create hooks? Modify existing hooks using the interface?

feline

#3
That mod don't work correct ... it will only find files in the Source folder, but not in a subfolder of the Source folder.
Because may mods don't install all in the Source folder (like SimpleDesk, PortaMx) many active hooks will shown as Missing  :(
Also the Filename which hold the hook function would be interest ...

emanuele

Hi feline,

thank you for the report.
See if version 1.1 fixes this issue. :)

If you can confirm I'll remove 1.0 from download.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Bugo

Great mod. What about a short description for every hook? Like help hint.

Please add russian translation.

feline

Quote from: emanuele on January 08, 2012, 02:57:52 PM
thank you for the report.
See if version 1.1 fixes this issue. :)
Thanks emanuele .. worked  :)

live627

Sweet mod! Bit geeky, though.

QuoteI wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?
Use red for missing (error class IIRC) and green for exists (no class for that)

[SiNaN]

It feels nostalgic to see this mod again. You may want to get rid of the last two lines of hooks_admin_areas() and hooks_modify_modifications() functions now, as they were meant to be a workaround for this bug. Also, not sure where that uninstall.php file came from but install.php file should take care of uninstalling as well.


Quote from: Project Evolution on January 08, 2012, 12:24:49 PM
Quote from: Norv on January 08, 2012, 12:12:00 PM
I wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?

Enable/disable hooks from being executed? Create hooks? Modify existing hooks using the interface?

The next version of the mod was supposed to do all those but I never got around to coding it.

Quote from: feline on January 08, 2012, 12:27:09 PM
That mod don't work correct ... it will only find files in the Source folder, but not in a subfolder of the Source folder.
Because may mods don't install all in the Source folder (like SimpleDesk, PortaMx) many active hooks will shown as Missing  :(
Also the Filename which hold the hook function would be interest ...

The reason why it didn't consider that in the first place was that having a sub-directory in Sources directory is not something that's common.

Quote from: emanuele on January 08, 2012, 02:57:52 PM
Hi feline,

thank you for the report.
See if version 1.1 fixes this issue. :)

If you can confirm I'll remove 1.0 from download.

You may want to change "recoursive" as "recursive" though.

Quote from: live627 on January 08, 2012, 05:03:10 PM
Sweet mod! Bit geeky, though.

QuoteI wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?
Use red for missing (error class IIRC) and green for exists (no class for that)

I guess you could say it looks geeky. Still, it turned out to be a good example for the use of generic lists. And yeah, using classes sounds better, if applied for the "Exists" field only.
Former SMF Core Developer | My Mods | SimplePortal

emanuele

Quote from: [SiNaN] on January 11, 2012, 04:31:02 AM
It feels nostalgic to see this mod again. You may want to get rid of the last two lines of hooks_admin_areas() and hooks_modify_modifications() functions now, as they were meant to be a workaround for this bug.
Done thanks! ;)

Quote from: [SiNaN] on January 11, 2012, 04:31:02 AM
Also, not sure where that uninstall.php file came from but install.php file should take care of uninstalling as well.
Simple explanation: I forgot to delete it...

Quote from: [SiNaN] on January 11, 2012, 04:31:02 AM
You may want to change "recoursive" as "recursive" though.
Yups...

Fixed and added Russian translation (thanks Bugo).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Arantor

You know, if the install process is just adding hooks, you can do that in package-info.xml directly by using a <code> block with the inline parameter... Doesn't help so much with the install process as a manual install might do, but it's something to consider.
Holder of controversial views, all of which my own.

Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

emanuele

Quote from: Project Evolution on January 08, 2012, 12:24:49 PM
Enable/disable hooks from being executed?
This is done (waiting for a bit of testing :P) along with the possibility to filter the list by hook.

Quote from: Project Evolution on January 08, 2012, 12:24:49 PM
Create hooks? Modify existing hooks using the interface?
Next round.

* emanuele is quite slow as developer... ::)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Bugo

I think you need replace <list> with <ul> (in Subs-IntegrationHooks.php)

Remove link doesn't work.

Updated russian translation in attachments.

emanuele

#14
Thanks for the report and for the new translation.

File removed in the meantime, will check what the issue is.

Fixed both! (hopefully :P)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

4Kstore

is a great and useful mod, I can only help with the spanish translation
regards

¡¡NEW MOD: Sparkles User Names!!!

emanuele

Thanks!
I'll add it to the package in few days!
In the meantime I put a link to your post in the mod's page. :)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Adrek

Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

emanuele

Thanks phantomm, link added! :)

* emanuele should probably add the Italian too... :P


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Adrek

I found this in logs:
/index.php?action=admin;area=modsettings;sa=hooks;a3f732d9de=fbcb6de2f6a87aefb127b7ec0b53b319
8: Undefined index: Subs.php
File: /public_html/Sources/Subs-IntegrationHooks.php
Line: 296


/index.php?action=admin;area=modsettings;sa=hooks;a3f732d9de=fbcb6de2f6a87aefb127b7ec0b53b319
8: Undefined index: Subs-SimpleSpoiler.php
File: /public_html/Sources/Subs-IntegrationHooks.php
Line: 296


Line 296 is:
$current_hook = $temp_data['include'][$hook_status[$hook][$function]['in_file']];
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Advertisement: