83% search-products-pro

Code Review | Search Products PRO

WordPress plugin Search Products PRO scored 83% from 54 tests.

About plugin

  • Plugin page: search-products-pro
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.6
  • WordPress version: 6.3.1
  • First release: Dec 18, 2020
  • Latest release: Dec 18, 2020
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: searchproducts (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 409 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.81ms] Passed 4 tests

An overview of server-side resources used by Search Products PRO
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.04 ▼5.64
Dashboard /wp-admin3.31 ▲0.0042.47 ▼6.02
Posts /wp-admin/edit.php3.36 ▲0.0044.05 ▼1.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.47 ▼9.26
Media Library /wp-admin/upload.php3.23 ▲0.0030.52 ▼2.31

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Search Products PRO: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.19 ▼1.211.81 ▼0.1740.61 ▲0.90
Dashboard /wp-admin2,206 ▲215.78 ▲0.8696.13 ▼8.3836.85 ▼1.65
Posts /wp-admin/edit.php2,086 ▲181.99 ▼0.0234.48 ▼0.7235.07 ▲2.74
Add New Post /wp-admin/post-new.php1,533 ▼1023.11 ▲0.25642.48 ▲1.3453.61 ▼5.87
Media Library /wp-admin/upload.php1,385 ▼04.19 ▲0.0494.75 ▼5.5543.45 ▼0.88

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/search-products-pro/includes/integrations/elementor.php:12

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 90% 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
7 plugin tags: ajax, search, products, pro, woocommerce...

search-products-pro/search-products.php 77% from 13 tests

The principal PHP file in "Search Products PRO" v. 1.0.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("search-products-pro.php" instead of "search-products.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.0" instead of "4.5")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin4,024 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript267642,236
PHP8427721,722
SVG30161
CSS4004
XML1001

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 107)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity45.67
▷ Minimum class complexity1.00
▷ Maximum class complexity190.00
Average method complexity4.31
▷ Minimum method complexity1.00
▷ Maximum method complexity107.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods81
▷ Static methods1113.58%
▷ Public methods7491.36%
▷ Protected methods22.47%
▷ Private methods56.17%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/settings/images/srchpro.png9.76KB4.69KB▼ 51.95%
includes/settings/images/nc-on.png7.86KB2.56KB▼ 67.45%
includes/settings/images/nc-off.png7.05KB2.32KB▼ 67.05%