Notifications
Clear all

Script wpForo hooks, where to get documentation?

10 Posts
3 Users
0 Reactions
622 Views
colaias
Posts: 7
Topic starter
(@cola)
Active Member
Joined: 2 months ago

I'm creating an open source AI moderation system for wpForo, I have got it working and am almost ready to share it. But things are holding me back. The before post/post_edit/topic hook actions ( such as 'wpforo_before_add_post') aren't running.

I just checked whether there is documentation on wpForo hooks for this stuff, before and after hooks. I didn't find anything. AI helped by getting a few but they don't work. Can you please make a documentation page on wpForo hooks, especially for post and topic life cycle: on before and after post , on before and after edit, on before and after delete. etc.


9 Replies
Sofy
Posts: 5643
 Sofy
Admin
(@sofy)
Support Team
Joined: 8 years ago

Hi,

You can find the documentation here: https://wpforo.com/docs/wpforo-v2/development/wpforo-hooks/

Total Hooks: 609 occurrences

  • Action Hooks: 227 unique hooks
  • Filter Hooks: 382 unique hooks

Reply
1 Reply
colaias
(@cola)
Joined: 2 months ago

Active Member
Posts: 7

@sofy Thanks, I have been developing the ai moderation plugin for wpforo, it is on github https://github.com/comingofflais-com/LLM-Moderator-for-wpForo but is currently not production ready and has bugs. 

ACTUALLY A FAIR WARNING! DONT USE IT! I do not know if the bad edit got pushed into the github but the current version iirc recursively tries to edit the post again and again, so don't use that github version.

My main problem is that I am using hooks that are not documented, but they are working fine,
``

add_action('wpforo_start_add_topic', 'wpforo_ai_before_moderate_topic', 100, 1);
add_filter('wpforo_after_add_topic_filter', 'wpforo_ai_moderate_topic', 10, 1);

add_action('wpforo_start_add_post', 'wpforo_ai_before_moderate_post', 100, 1);
add_filter('wpforo_after_add_post_filter', 'wpforo_ai_after_add_moderate_post', 100, 1);

add_action('wpforo_start_edit_post', 'wpforo_ai_before_moderate_post_edit', 100, 1);
add_filter('wpforo_edit_post_data_filter', 'wpforo_ai_after_add_moderate_post_edit', 10, 1);

add_action('wpforo_start_edit_topic', 'wpforo_ai_before_moderate_topic_edit', 100, 1);
add_filter('wpforo_edit_topic_data_filter', 'wpforo_ai_after_add_moderate_topic_edit', 100, 1);``

I had issues in the code appending the string message at the end, so I have to figure that out, in the mean time my question is, is it okay to use these hooks, or are they deprecated? Perhaps the documentation is incomplete or outdated. I am hoping the hooks I'm using are not deprecated, because otherwise I would have to done a lot of re-writing. 

(I initially used AI to source the hooks through the wpforo plugin when the documentation was not available online.) 

 

Reply
colaias
Posts: 7
Topic starter
(@cola)
Active Member
Joined: 2 months ago

Furthermore, due to the problem of not being able to append the message at the end of the post body, I am requesting a hook to programmatically filter the post data after it has been added. I am currently investigating the changes I need to make to use the current hook correctly


Reply
colaias
Posts: 7
Topic starter
(@cola)
Active Member
Joined: 2 months ago

Specifically, I am requesting a filter for after add topic, after add post, after add topic-edit, and after add post-edit. currently my code is unable to make changes to the topic or post body, hence I am unable to append the AI response at the end of the post.


Reply
Robert
Posts: 10604
Admin
(@robert)
Support Team
Joined: 10 years ago

Hi @cola ,

Thank you very much for your effort. The new major version of wpForo 3 is almost ready and the beta version will be released for early adopters very soon. This is an AI Edition of wpForo which includes 15 major AI features with about 50 AI sub-features. It covers all AI based moderation as well. During this active development and major release process we cannot play with the hooks and we'll be able to do core hook changes once the first beta is released.


Reply
2 Replies
colaias
(@cola)
Joined: 2 months ago

Active Member
Posts: 7

@robert Oh, thanks for replying back to me. I find this news rather upsetting as I spent quiet a lot of effort making the AI moderation plugin for wpForo over the past 3 months. Yesterday I did a major re-write of how the moderation will be handled with different hooks, which I haven't yet uploaded to github, because it would be without first testing it a bit. Perhaps will your team will be interested in contacting me, and look at how we did things differently? I was hoping to capitalize on the opportunity by creating a free plugin with a premium version. I did this after my website did not have any AI moderation features, and given that it has been 3 years since AI first became popularized, I reckoned that the AI moderation features were not in development.


Reply
Robert
Admin
(@robert)
Joined: 10 years ago

Support Team
Posts: 10604

@cola,

I see, thank you for your dedication and the effort you've put into this over the past 3 months, that kind of commitment to improving the wpForo ecosystem is genuinely appreciated, and we can see from your GitHub that you've thought through many important details like mute durations, user group management, and admin interfaces. We completely understand the frustration. 

To give some context: our AI features have actually been in active development for quite some time, but we kept things relatively quiet until we had a production-ready solution. The AI moderation module is part of a larger AI suite we've been building and now all integrated into wpForo's. We weren't aware of your work until now, and it's clear you identified a real need that our users have. The fact that you independently came to many of the same conclusions (real-time analysis, automatic user restrictions, admin oversight) validates that these are the right features to build.

wpForo AI solutions also has free credits and it doesn't requires external an external API key (OpenRouter) with its own ongoing costs, wpForo has AI infrastructure on AWS that costs people 15-20 times cheaper than the OpenRouter, the free plan of OpenRouter has lots of limits that in most cases become unusable and brings lots of interruptions (requests per minute, requests per day, tokens per requests...). So it's better to pay very small price but have reliable and high quality AI solution than use free with lots of community users disappointments and complaints. wpForo's built-in AI moderation is production-tested, fully integrated with the credit system, includes 10+ AI moderation levels and algorithm,  all with professional support and analytics graphics and details. 

 


Reply
Page 1 / 2