Make WordPress Core

Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#59143 closed enhancement (fixed)

Plugin Search Bug: Plugin Search Page (%20 is being added to the searched keyword on page refresh)

Reported by: nithi22's profile nithi22 Owned by: swissspidy's profile swissspidy
Milestone: 6.4 Priority: normal
Severity: normal Version:
Component: Plugins Keywords: has-patch
Focuses: Cc:

Description

There is a strange bug inside "Add plugins page" while searching for a plugin.
If the search string has a space, then reloading the page will replace the space with a "%20". This is inside the search input field.

Environment

  • WordPress: 6.3
  • PHP: 8.2.0
  • Server: Apache/2.4.54 (Unix) OpenSSL/1.0.2u PHP/8.2.0 mod_wsgi/3.5 Python/2.7.18 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.30.1
  • Database: mysqli (Server: 5.7.39 / Client: mysqlnd 8.2.0)
  • Browser: Firefox 116.0 (macOS)
  • Theme: Twenty Twenty-Three 1.0
  • MU-Plugins: None activated
  • Plugins:
    • WordPress Beta Tester 3.5.3

Steps to Reproduce

  1. Access the WordPress backend.
  2. Navigate to the Plugins-> Add New.
  3. In the search box, enter keywords with space, e.g., "awsm team"
  4. Press Enter or click the Search button.
  5. Refresh the page.
  6. Observe that the "%20" is being added to the searched keyword on page refresh(awsm%20team).

Expected Results

  1. Search input field should not contain "%20"

Actual Results

  1. %20 added to spaces inside the search input field

Attachments (8)

59143.diff (1.1 KB) - added by adhun 18 months ago.
This patch will show the decoded search keyword on plugins install page.
Screenshot 2023-08-18 at 10.27.08 PM.png (258.0 KB) - added by nithi22 18 months ago.
After the page refresh
Screenshot 2023-08-18 at 10.27.08 PM.2.png (258.0 KB) - added by nithi22 18 months ago.
Before patch
Screenshot 2023-08-18 at 10.41.00 PM.png (256.4 KB) - added by nithi22 18 months ago.
After patch
Before patch.png (507.4 KB) - added by deepakvijayan 18 months ago.
After patch.png (473.6 KB) - added by deepakvijayan 18 months ago.
Before Patch applied.png (162.9 KB) - added by iammehedi1 18 months ago.
After Patch applied.png (161.7 KB) - added by iammehedi1 18 months ago.

Change History (19)

@adhun
18 months ago

This patch will show the decoded search keyword on plugins install page.

This ticket was mentioned in PR #5035 on WordPress/wordpress-develop by code-boss.


18 months ago
#1

  • Keywords has-patch added

Fix : Plugin Search Bug: Plugin Search Page (%20 is being added to the searched keyword on page refresh)

Trac ticket: https://core.trac.wordpress.org/ticket/59143

@nithi22
18 months ago

After the page refresh

#2 @nithi22
18 months ago

Test Report

This report validates that the indicated patch addresses the issue.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/5035

Environment

  • WordPress: 6.3
  • PHP: 8.2.0
  • Server: Apache/2.4.54 (Unix) OpenSSL/1.0.2u PHP/8.2.0 mod_wsgi/3.5 Python/2.7.18 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.30.1
  • Database: mysqli (Server: 5.7.39 / Client: mysqlnd 8.2.0)
  • Browser: Firefox 116.0 (macOS)
  • Theme: Twenty Twenty-Three 1.0
  • MU-Plugins: None activated
  • Plugins:
    • WordPress Beta Tester 3.5.3

Actual Results

  1. ✅ Issue resolved with patch.

#3 @huzaifaalmesbah
18 months ago

  • Keywords needs-testing added

#4 @deepakvijayan
18 months ago

  • Keywords needs-testing removed

I tested this on WordPress 6.3
The issue seems to be gone after applying the patch.

Below is the test report. Attaching images for reference as well.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/5035

Environment

  • WordPress: 6.3
  • PHP: 8.2.0
  • Server: Apache/2.4.54 (Unix) OpenSSL/1.0.2u PHP/8.2.0 mod_wsgi/3.5 Python/2.7.18 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.30.1
  • Database: mysqli (Server: 5.7.39 / Client: mysqlnd 8.2.0)
  • Browser: Firefox 116.0 (macOS)
  • Theme: Twenty Twenty-Three 1.0
  • MU-Plugins: None activated
  • Plugins:
    • WordPress Beta Tester 3.5.3

Actual Results

  1. ✅ Issue resolved with patch.

This ticket was mentioned in Slack in #core by zunaid321. View the logs.


18 months ago

#6 @zunaid321
18 months ago

Test Report

This report validates that the indicated patch addresses the issue.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/5035

Environment

  • OS: Windows 11 (22H2)
  • Web Server: nginx/1.25.1
  • PHP: 7.4.33
  • WordPress: 6.4-alpha-56267-src
  • Browser: Chrome Version 113.0.5672.126 (Official Build) (64-bit)
  • Theme: Twenty Twenty-Three

Before Applying The Patch

  • Followed the instructions of @nithi22
  • ❌ "%20" does show up.

After Applying The Patch

  • Followed the same instructions.
  • ✅ "%20" does not show up anymore.

Supplemental Artifacts

Before: https://prnt.sc/ISXSBaxaQPD1
After: https://prnt.sc/b9iG1O1Lonri

#7 @iammehedi1
18 months ago

Test Report

This report validates that the indicated patch addresses the issue.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/5035

Environment

  • OS: Windows 11 Pro (22H2)
  • Web Server: nginx/1.25.1
  • PHP: 7.4.33
  • WordPress: 6.4-alpha-56267-src
  • Browser: Chrome Version 116.0.5845.98 (Official Build) (64-bit)
  • Theme: Twenty Twenty-Three

Prior to Applying the Patch

  • Followed the provided guidelines of
  • ❌ '%20' appears if we refresh the plugin page after searching

After Applying The Patch

  • Followed the same guidelines
  • ✅ '%20' doesn't show up anymore - it's FIXED

Screenshots

Before: https://prnt.sc/kEipuoID9XPz

After: https://prnt.sc/ndyonHKKmAem

Version 0, edited 18 months ago by iammehedi1 (next)

#8 @swissspidy
18 months ago

  • Milestone changed from Awaiting Review to 6.4
  • Owner set to swissspidy
  • Status changed from new to reviewing

Originally reported at https://wordpress.slack.com/archives/C02RQBWTW/p1676398669968419

Probably a regression from r53844, which was then thought to be fixed in #57174 / r54904 but that only affected the installed plugins search.

#9 @swissspidy
18 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 56446:

Plugins: Correctly display spaces in new plugins search results.

Ensures the encoded search term in the input field is correctly decoded again.

Follow-up to [53844] and [54904].

Props adhun, nithi22, huzaifaalmesbah, deepakvijayan, zunaid321, iammehedi1.
Fixes #59143.

This ticket was mentioned in Slack in #core by zunaid321. View the logs.


18 months ago

Note: See TracTickets for help on using tickets.