72% ajax-search-lite

Code Review | Ajax Search Lite

WordPress plugin Ajax Search Lite scored72%from 54 tests.

About plugin

  • Plugin page: ajax-search-lite
  • Plugin version: 4.11.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Nov 17, 2012
  • Latest release: Sep 12, 2023
  • Number of updates: 281
  • Update frequency: every 14.1 days
  • Top authors: wpdreams (100%)

Code review

54 tests

User reviews

198 reviews

Install metrics

70,000+ active /1,310,384 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.32MB] [CPU: ▲4.98ms] Passed 4 tests

Analyzing server-side resources used by Ajax Search Lite
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.85 ▲1.3947.00 ▲6.85
Dashboard /wp-admin4.66 ▲1.3659.47 ▲9.67
Posts /wp-admin/edit.php4.71 ▲1.3659.51 ▲13.46
Add New Post /wp-admin/post-new.php7.18 ▲1.2989.91 ▼10.08
Media Library /wp-admin/upload.php4.51 ▲1.2951.87 ▲20.30
Help & Support /wp-admin/admin.php?page=asl_help_and_support4.9046.15
Compatibility Settings /wp-admin/admin.php?page=asl_compatibility4.9146.76
Analytics Integration /wp-admin/admin.php?page=asl_analytics5.0247.75
Go PRO /wp-admin/admin.php?page=asl_go_pro4.8946.70
Ajax Search Lite /wp-admin/admin.php?page=asl_settings5.0452.31
Performance options /wp-admin/admin.php?page=asl_performance_options4.9073.32
Maintenance /wp-admin/admin.php?page=asl_maintenance4.9047.15

Server storage [IO: ▲2.28MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 290 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
can_compress_scripts
asl_debug_data
asl_options
widget_recent-posts
asl_version
theysaidso_admin_options
db_upgraded
widget_ajaxsearchlitewidget
widget_theysaidso_widget

Browser metrics Passed 4 tests

Ajax Search Lite: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲13013.36 ▼1.043.35 ▲1.7035.58 ▼1.29
Dashboard /wp-admin2,242 ▲505.82 ▲0.92110.87 ▲0.7076.90 ▲32.10
Posts /wp-admin/edit.php2,143 ▲542.03 ▲0.0439.77 ▲4.8837.83 ▲1.41
Add New Post /wp-admin/post-new.php1,706 ▲17322.11 ▼1.22636.81 ▼14.2954.68 ▼18.00
Media Library /wp-admin/upload.php1,430 ▲424.22 ▼0.1695.17 ▼9.0146.35 ▲2.45
Help & Support /wp-admin/admin.php?page=asl_help_and_support1,2764.33101.0972.58
Compatibility Settings /wp-admin/admin.php?page=asl_compatibility1,4243.7665.9085.66
Analytics Integration /wp-admin/admin.php?page=asl_analytics1,7273.9254.03103.37
Go PRO /wp-admin/admin.php?page=asl_go_pro1,1473.7846.9789.51
Ajax Search Lite /wp-admin/admin.php?page=asl_settings6,7574.65280.28222.91
Performance options /wp-admin/admin.php?page=asl_performance_options1,2223.7650.3697.17
Maintenance /wp-admin/admin.php?page=asl_maintenance1,2703.9550.3991.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • asl_version
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • asl_options
    • widget_recent-posts
    • asl_debug_data
    • widget_ajaxsearchlitewidget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 59× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/ajax-search-lite/includes/classes/search/class-asl-search.php
    • > /wp-content/plugins/ajax-search-lite/includes/classes/filters/filters.inc.php
    • > /wp-content/plugins/ajax-search-lite/includes/classes/actions/actions.inc.php
    • > /wp-content/plugins/ajax-search-lite/includes/classes/core/class-asl-shortcodes.php
    • > /wp-content/plugins/ajax-search-lite/backend/sidebar.php
    • > /wp-content/plugins/ajax-search-lite/includes/classes/shortcodes/class-asl-search.php
    • > /wp-content/plugins/ajax-search-lite/includes/classes/core/class-asl-manager.php
    • > /wp-content/plugins/ajax-search-lite/includes/classes/core/class-asl-dbman.php
    • > /wp-content/plugins/ajax-search-lite/backend/whypro.php
    • > /wp-content/plugins/ajax-search-lite/includes/classes/filters/class-asl-formoverride.php
  • 74× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ajax-search-lite/backend/tabs/instance/advanced/kw_exceptions.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'wpdreamsType' not found in wp-content/plugins/ajax-search-lite/backend/settings/class/categories.class.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'wpdreamsYesNo' not found in wp-content/plugins/ajax-search-lite/backend/tabs/compatibility/query_options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ajax-search-lite/backend/tabs/instance/layout_options.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'wpdreamsCustomSelect' not found in wp-content/plugins/ajax-search-lite/backend/tabs/compatibility/cssjs_options.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'wpdreamsType' not found in wp-content/plugins/ajax-search-lite/backend/settings/class/colorpickerdummy.class.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'wpdreamsType' not found in wp-content/plugins/ajax-search-lite/backend/settings/class/customposttypes.class.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wd_asl() in wp-content/plugins/ajax-search-lite/backend/settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ajax-search-lite/backend/tabs/instance/advanced/accessibility.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ajax-search-lite/backend/tabs/instance/general/behavior.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=asl_maintenance
    • > Rendering (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1 The specified value "!" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (48 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

ajax-search-lite/ajax-search-lite.php Passed 13 tests

Analyzing the main PHP file in "Ajax Search Lite" version 4.11.4
79 characters long description:
The lite version of the most powerful ajax powered search engine for WordPress.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin32,400 lines of code in 175 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript331,3871,07413,446
PHP1211,4492,85010,813
CSS161,0681266,893
PO File25016541,220
SVG319228

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 108)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity21.50
▷ Minimum class complexity1.00
▷ Maximum class complexity413.00
Average method complexity5.67
▷ Minimum method complexity1.00
▷ Maximum method complexity108.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes66
▷ Abstract classes710.61%
▷ Concrete classes5989.39%
▷ Final classes00.00%
Methods291
▷ Static methods7927.15%
▷ Public methods23982.13%
▷ Protected methods3010.31%
▷ Private methods227.56%
Functions44
▷ Named functions4295.45%
▷ Anonymous functions24.55%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
67 PNG files occupy 0.36MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
backend/settings/assets/theme/simple-blue.png2.58KB1.02KB▼ 60.22%
backend/settings/assets/icons/upload-before.png0.99KB0.20KB▼ 79.51%
backend/settings/assets/icons/icon-desktop-white.png1.94KB0.29KB▼ 84.83%
backend/settings/assets/icons/delete.png1.25KB0.48KB▼ 61.80%
img/magnifier.png3.73KB0.83KB▼ 77.78%