84% better-search-replace

Code Review | Better Search Replace

WordPress plugin Better Search Replace scored84%from 54 tests.

About plugin

  • Plugin page: better-search-rep...
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 6, 2015
  • Latest release: Sep 5, 2023
  • Number of updates: 104
  • Update frequency: every 30.4 days
  • Top authors: deliciousbrains (40.38%)mattshaw (37.5%)ExpandedFronts (24.04%)

Code review

54 tests

User reviews

501 reviews

Install metrics

1,000,000+ active /10,647,387 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼11.70ms] Passed 4 tests

A check of server-side resources used by Better Search Replace
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0237.09 ▼6.95
Dashboard /wp-admin3.33 ▲0.0346.92 ▼3.49
Posts /wp-admin/edit.php3.38 ▲0.0248.59 ▼11.06
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.95 ▼25.28
Media Library /wp-admin/upload.php3.25 ▲0.0238.40 ▲2.17
Better Search Replace /wp-admin/tools.php?page=better-search-replace3.2840.79

Server storage [IO: ▲0.29MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 57 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Better Search Replace: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.06 ▼0.231.90 ▲0.2344.00 ▲4.83
Dashboard /wp-admin2,196 ▲165.54 ▼0.1086.30 ▲0.8146.94 ▲5.72
Posts /wp-admin/edit.php2,104 ▲41.94 ▼0.0135.20 ▼6.8734.80 ▼2.51
Add New Post /wp-admin/post-new.php1,529 ▲323.09 ▼0.05680.69 ▲17.7353.34 ▼7.49
Media Library /wp-admin/upload.php1,404 ▲44.20 ▼0.00100.76 ▼8.2745.64 ▲2.17
Better Search Replace /wp-admin/tools.php?page=better-search-replace1,2411.7828.4960.55

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/better-search-replace/templates/sidebar.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: update database urls, update live url, search and replace, search replace database, better search replace...

better-search-replace/better-search-replace.php Passed 13 tests

The main PHP file in "Better Search Replace" ver. 1.4.3 adds more information about the plugin and also serves as the entry point for this plugin
71 characters long description:
A small plugin for running a search/replace on your WordPress database.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected2,420 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PO File38392310

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity15.40
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
▷ Static methods1526.32%
▷ Public methods5291.23%
▷ Protected methods00.00%
▷ Private methods58.77%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ Global constants675.00%
▷ Class constants225.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
assets/css/images/ui-bg_glass_100_fdf5ce_1x400.png0.34KB0.16KB▼ 54.02%
assets/css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
assets/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.27KB0.14KB▼ 47.84%
assets/css/images/ui-bg_glass_100_f6f6f6_1x400.png0.26KB0.12KB▼ 53.44%