78% ns-ajax-products-search

Code Review | NS Ajax Products Search

WordPress plugin NS Ajax Products Search scored78%from 54 tests.

About plugin

  • Plugin page: ns-ajax-products-...
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.9
  • WordPress version: 6.3.1
  • First release: Aug 9, 2016
  • Latest release: Feb 8, 2022
  • Number of updates: 54
  • Update frequency: every 37.2 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,861 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.12ms] Passed 4 tests

An overview of server-side resources used by NS Ajax Products Search
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.80 ▲3.15
Dashboard /wp-admin3.34 ▲0.0350.83 ▼1.30
Posts /wp-admin/edit.php3.45 ▲0.0949.26 ▼5.49
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.03 ▼12.85
Media Library /wp-admin/upload.php3.26 ▲0.0341.23 ▲5.66
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.2031.89
Ajax Product /wp-admin/admin.php?page=ns-ajax-products-search/ns-admin-options/ns_admin_option_dashboard.php3.2636.12
/wp-admin/admin.php?page=plugineye2203.2232.85

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_ns_search_product_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for NS Ajax Products Search
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,984 ▲22313.59 ▼0.7711.13 ▲9.4437.30 ▼0.78
Dashboard /wp-admin2,223 ▲435.64 ▼0.0390.30 ▲2.1084.99 ▲43.34
Posts /wp-admin/edit.php2,128 ▲281.99 ▲0.0439.94 ▼3.7535.35 ▼5.82
Add New Post /wp-admin/post-new.php1,704 ▲17822.43 ▼0.61708.32 ▲98.0771.15 ▲16.07
Media Library /wp-admin/upload.php1,428 ▲284.14 ▼0.16104.44 ▼2.4776.08 ▲17.69
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version6891.127.0720.18
Ajax Product /wp-admin/admin.php?page=ns-ajax-products-search/ns-admin-options/ns_admin_option_dashboard.php9331.9922.9937.08
/wp-admin/admin.php?page=plugineye2209162.0124.8424.83

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_ns_search_product_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=how-to-install-premium-version
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP 50% 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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ns-ajax-products-search/ns_search_products.widget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-ajax-products-search/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Example widget), #2 (Example shortcode), #3 (Search results), #4 (Widget search), #5 (Widget search results)
Please take inspiration from this readme.txt

ns-ajax-products-search/ns_search_products.plugin.php 92% from 13 tests

This is the main PHP file of "NS Ajax Products Search" version 1.4.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ns-ajax-products-search.php" instead of "ns_search_products.plugin.php")

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 detected1,336 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP14102212744
CSS46110479
JavaScript3389113

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity13.00
▷ Minimum class complexity6.00
▷ Maximum class complexity20.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods939.13%
▷ Protected methods00.00%
▷ Private methods1460.87%
Functions20
▷ Named functions1050.00%
▷ Anonymous functions1050.00%
Constants2
▷ Global constants2100.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
10 PNG files occupy 0.35MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ns-admin-options/img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%
asset/backend-sidebar-icon.png0.67KB0.52KB▼ 21.44%
screenshot-4.png96.49KB26.58KB▼ 72.46%
screenshot-3.png38.44KB10.78KB▼ 71.95%
screenshot-1.png19.55KB6.34KB▼ 67.54%