74% lava-ajax-search

Code Review | Lava Ajax Search

WordPress plugin Lava Ajax Search scored74%from 54 tests.

About plugin

  • Plugin page: lava-ajax-search
  • Plugin version: 1.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.9
  • WordPress version: 6.3.1
  • First release: Aug 17, 2017
  • Latest release: Feb 8, 2022
  • Number of updates: 22
  • Update frequency: every 74.7 days
  • Top authors: lavacode (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

800+ active /22,411 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.37MB] [CPU: ▼5.03ms] Passed 4 tests

An overview of server-side resources used by Lava Ajax Search
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4143.81 ▲6.06
Dashboard /wp-admin3.70 ▲0.4048.51 ▼1.57
Posts /wp-admin/edit.php3.75 ▲0.4055.75 ▲4.82
Add New Post /wp-admin/post-new.php6.22 ▲0.3485.91 ▼20.59
Media Library /wp-admin/upload.php3.56 ▲0.3437.91 ▼2.79
Lava Ajax Search /wp-admin/options-general.php?page=lava-ajax-search3.5939.15

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 47 new files
Database: 1 new table, 6 new options
New tables
wp_keyword_stack
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Lava Ajax Search: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.58 ▼0.791.66 ▼0.6940.52 ▼9.44
Dashboard /wp-admin2,213 ▲254.83 ▼1.07112.12 ▼2.3146.65 ▲7.31
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0141.49 ▲0.0836.56 ▲1.26
Add New Post /wp-admin/post-new.php1,535 ▲723.33 ▼0.18603.10 ▼51.5363.84 ▲15.78
Media Library /wp-admin/upload.php1,389 ▲74.25 ▲0.07102.11 ▼9.0644.59 ▲0.62
Lava Ajax Search /wp-admin/options-general.php?page=lava-ajax-search1,0892.0338.7429.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_keyword_stack
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/lava-ajax-search/templates/template-results.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/lava-ajax-search/templates/template-admin-index.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: shortcode, user search, buddypress, relevance search, live...

lava-ajax-search/lava-ajax-search.php 92% from 13 tests

The primary PHP file in "Lava Ajax Search" version 1.1.9 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
No dangerous file extensions were detected3,172 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP24469702,297
Sass2450342
CSS3116308
JavaScript5274219
JSON1006

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.26
▷ Minimum class complexity2.00
▷ Maximum class complexity71.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes210.53%
▷ Concrete classes1789.47%
▷ Final classes00.00%
Methods108
▷ Static methods109.26%
▷ Public methods8982.41%
▷ Protected methods98.33%
▷ Private methods109.26%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dist/images/no-image.png1.09KB0.16KB▼ 85.07%
assets/src/images/no-image.png1.09KB0.16KB▼ 85.07%