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

Dismiss button closes all warnings #135

Closed
stklcode opened this issue Nov 16, 2023 · 0 comments · Fixed by #136
Closed

Dismiss button closes all warnings #135

stklcode opened this issue Nov 16, 2023 · 0 comments · Fixed by #136
Labels
Milestone

Comments

@stklcode
Copy link
Contributor

stklcode commented Nov 16, 2023

Describe the bug

Originally reported by @ilijagl here: https://wordpress.org/support/topic/bug-in-the-new-version-2/

There is a bug in the new version. If the warnings are in a row, then when you press DIsmiss, they all close and you have to start scanning again

To Reproduce

  1. Install AntiVirus 1.5.0 on a test site (e.g. fresh WP 6.4 setup)
  2. Add more than 1 potentially evil line to any file of the active theme, e.g.
// file_get_contents( 'test-1' );
// eval( 'test-2' );
  1. Trigger manual theme file scan
  2. See a warning with 2 highlighted lines and 2 "Dismiss" buttons
    antivirus_135_001
  3. Click one one of the buttons
  4. See the file row turning green with status "OK" and both "Dismiss" buttons disappear.
    antivirus_135_002
  5. Trigger the scan again
  6. See the second issue popping up again
    antivirus_135_003

Expected behavior

2 "Dismiss" buttons indicate that both warnings can be dismissed independently, so as a user I would expect that only the line I've clicked is gone and the file is still highlighted red, if another line exists.

System:

  • AntiVIrus 1.5.0
  • WordPress 6.4.1 (official Docker image)
@stklcode stklcode added the bug label Nov 16, 2023
@stklcode stklcode added this to the 1.5.1 milestone Nov 16, 2023
stklcode added a commit that referenced this issue Nov 16, 2023
When multiple issues are present in a single file, clicking on "dismiss"
should only hide the corresponding line and the file should only be
marked as "OK" and turned green, if there are no more issues present.

Refactor the response handler and only remove the parent element to
resolve this issue.
stklcode added a commit that referenced this issue Nov 16, 2023
When multiple issues are present in a single file, clicking on "dismiss"
should only hide the corresponding line and the file should only be
marked as "OK" and turned green, if there are no more issues present.

Refactor the response handler and only remove the parent element to
resolve this issue.
stklcode added a commit that referenced this issue Nov 17, 2023
When multiple issues are present in a single file, clicking on "dismiss"
should only hide the corresponding line and the file should only be
marked as "OK" and turned green, if there are no more issues present.

Refactor the response handler and only remove the parent element to
resolve this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant