Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite extension, call API manually, take advantage of features not supported by the current library #24

Merged
merged 23 commits into from
Jan 4, 2022

Conversation

rafaucau
Copy link
Contributor

@rafaucau rafaucau commented Dec 22, 2021

Resolves #2405

Changes proposed in this pull request:

This PR updates the entire extension. It will not use a library that has not been updated for years, so it should work with newer versions of PHP.
Additionally, it sends more information to the Akismet API to make spam detection more accurate.
The Akismet class can be used by other extensions.

Todo:

  • Convert frontend to TypeScript
  • Call Akismet API manually
  • Option to remove blatant spam
  • Permission to bypass Akismet
  • Sending additional parameters like is_test

Nice to have, but can be left for another PR:

  • Suspend obvious spamers
  • Send blog_lang parameter
  • Checking post edits

Sponsored by forum.android.com.pl

Reviewers should focus on:

Everything

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

@rafaucau rafaucau changed the title [WIP] Rewrite extension, call API manually, take advantage of features not supported by the current library Rewrite extension, call API manually, take advantage of features not supported by the current library Dec 28, 2021
@rafaucau rafaucau marked this pull request as ready for review December 28, 2021 18:29
Copy link
Sponsor Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your hard work on this! Left some review comments below.

js/src/forum/index.ts Outdated Show resolved Hide resolved
src/Akismet.php Outdated Show resolved Hide resolved
src/Akismet.php Outdated Show resolved Hide resolved
src/Akismet.php Outdated Show resolved Hide resolved
src/Akismet.php Outdated Show resolved Hide resolved
src/Listener/ValidatePost.php Outdated Show resolved Hide resolved
src/Listener/ValidatePost.php Outdated Show resolved Hide resolved
src/Listener/ValidatePost.php Outdated Show resolved Hide resolved
src/Listener/ValidatePost.php Outdated Show resolved Hide resolved
src/Provider/AkismetProvider.php Outdated Show resolved Hide resolved
src/Akismet.php Outdated Show resolved Hide resolved
src/Akismet.php Outdated Show resolved Hide resolved
Copy link
Sponsor Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

witParams should be withParams, but otherwise LGTM!

src/Akismet.php Outdated Show resolved Hide resolved
Copy link
Member

@SychO9 SychO9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, haven't tested it locally though.

Just a minor comment.

src/Akismet.php Outdated Show resolved Hide resolved
@askvortsov1
Copy link
Sponsor Member

Confirmed to work locally. Thanks again so much for this!

@askvortsov1 askvortsov1 merged commit 02605b0 into flarum:master Jan 4, 2022
@rafaucau rafaucau deleted the rewrite branch January 5, 2022 15:18
@iPurpl3x
Copy link

iPurpl3x commented Jan 6, 2022

Thank you @rafaucau for dealing with this ! 🙏🏻

askvortsov1 pushed a commit that referenced this pull request Mar 11, 2022
…supported by the current library (#24)

This PR updates the entire extension. It will not use a library that has not been updated for years, so it should work with newer versions of PHP.
Additionally, it sends more information to the Akismet API to make spam detection more accurate.
The Akismet class can be used by other extensions.

Todo:
- [x] Convert frontend to TypeScript
- [x] Call Akismet API manually
- [x] Option to remove blatant spam
- [x] Permission to bypass Akismet
- [x] Sending additional parameters like `is_test`

Nice to have, but can be left for another PR:
- [ ] Suspend obvious spamers
- [ ] Send  `blog_lang` parameter
- [ ] Checking post edits

Sponsored by [forum.android.com.pl](https://forum.android.com.pl/)
askvortsov1 pushed a commit that referenced this pull request May 10, 2022
…supported by the current library (#24)

This PR updates the entire extension. It will not use a library that has not been updated for years, so it should work with newer versions of PHP.
Additionally, it sends more information to the Akismet API to make spam detection more accurate.
The Akismet class can be used by other extensions.

Todo:
- [x] Convert frontend to TypeScript
- [x] Call Akismet API manually
- [x] Option to remove blatant spam
- [x] Permission to bypass Akismet
- [x] Sending additional parameters like `is_test`

Nice to have, but can be left for another PR:
- [ ] Suspend obvious spamers
- [ ] Send  `blog_lang` parameter
- [ ] Checking post edits

Sponsored by [forum.android.com.pl](https://forum.android.com.pl/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Akismet] Call API manually, take advantage of features not supported by the current library
4 participants