68% wdv-ajax-search

Code Review | WDV Ajax Search

WordPress plugin WDV Ajax Search scored68%from 54 tests.

About plugin

  • Plugin page: wdv-ajax-search
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Apr 28, 2022
  • Latest release: May 22, 2023
  • Number of updates: 9
  • Update frequency: every 43.2 days
  • Top authors: vrpr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /392 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.12MB] [CPU: ▼7.53ms] Passed 4 tests

Server-side resources used by WDV Ajax Search
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1438.04 ▲0.20
Dashboard /wp-admin3.43 ▲0.0947.50 ▼11.92
Posts /wp-admin/edit.php3.55 ▲0.1942.26 ▼8.77
Add New Post /wp-admin/post-new.php6.01 ▲0.1380.55 ▼9.61
Media Library /wp-admin/upload.php3.36 ▲0.1336.44 ▲3.88

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 71 new files
Database: 1 new table, 7 new options
New tables
wp_wdv_ajax_search_forms
New WordPress options
wdv_ajax_search_db_version
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WDV Ajax Search
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,920 ▲15913.51 ▼0.9014.18 ▲12.6040.13 ▼0.13
Dashboard /wp-admin2,209 ▲295.59 ▼0.0984.94 ▼13.0337.70 ▼0.72
Posts /wp-admin/edit.php2,111 ▲111.98 ▼0.0635.65 ▼2.3034.20 ▼0.74
Add New Post /wp-admin/post-new.php1,538 ▲323.74 ▲5.50596.48 ▼33.9559.35 ▼17.03
Media Library /wp-admin/upload.php1,414 ▲204.21 ▼0.0795.08 ▼4.5840.05 ▼3.25

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 uninstall procedure failed, leaving 1 table in the database
    • wp_wdv_ajax_search_forms
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • wdv_ajax_search_db_version
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wdv-ajax-search/admin/partials/wdv-ajax-search-admin-display.php
    • > /wp-content/plugins/wdv-ajax-search/public/partials/wdv-ajax-search-public-display.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wdv-ajax-search/admin/partials/wdv-ajax-search-admin-dashboard-display.php:19
    • > PHP Fatal error
      Uncaught Error: Call to a member function prepare() on null in wp-content/plugins/wdv-ajax-search/public/partials/wdv-ajax-search-public-shortcode-display.php:21
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wdv-ajax-search/public/partials/wdv-ajax-search-public-shortcode-display.php on line 18
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wdv-ajax-search/public/partials/wdv-ajax-search-public-shortcode-display.php on line 19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: ajax, live, search plugin, live search, search

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

This is the main PHP file of "WDV Ajax Search" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 448 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected18,880 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
SVG50128,884
CSS163,564938,294
PHP17335774957
JavaScript6201196745

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.40
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods37
▷ Static methods25.41%
▷ Public methods2978.38%
▷ Protected methods38.11%
▷ Private methods513.51%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/partials/img/placeholder1.png1.91KB0.79KB▼ 58.34%
admin/partials/img/logo-new-green.png23.16KB11.21KB▼ 51.58%
admin/partials/img/placeholder.png9.19KB3.65KB▼ 60.26%
admin/partials/img/logo-new.png23.52KB11.20KB▼ 52.39%
admin/partials/img/placeholder3.png20.96KB11.63KB▼ 44.51%