78% elasticommerce-search-form

Code Review | Elasticommerce Search Form

WordPress plugin Elasticommerce Search Form scored78%from 54 tests.

About plugin

  • Plugin page: elasticommerce-se...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 3, 2016
  • Latest release: Apr 7, 2016
  • Number of updates: 22
  • Update frequency: every 1.6 days
  • Top authors: horike (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,191 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.12ms] Passed 4 tests

This is a short check of server-side resources used by Elasticommerce Search Form
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0338.41 ▼5.05
Dashboard /wp-admin3.34 ▼0.0148.52 ▼17.33
Posts /wp-admin/edit.php3.39 ▲0.0349.66 ▲0.57
Add New Post /wp-admin/post-new.php5.92 ▲0.0394.35 ▼6.66
Media Library /wp-admin/upload.php3.26 ▲0.0339.97 ▲6.90
Elasticommerce Services /wp-admin/options-general.php?page=wp_elasticsearch3.2033.07

Server storage [IO: ▲1.87MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Checking browser requirements for Elasticommerce Search Form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲13813.43 ▼0.977.79 ▲6.1442.78 ▼0.58
Dashboard /wp-admin2,196 ▲165.51 ▼0.1589.10 ▼2.4839.57 ▼8.12
Posts /wp-admin/edit.php2,104 ▲42.08 ▲0.1134.56 ▼1.7935.19 ▼0.31
Add New Post /wp-admin/post-new.php1,541 ▲1317.92 ▼5.08639.74 ▼33.6785.13 ▲21.86
Media Library /wp-admin/upload.php1,404 ▲44.20 ▲0.0298.07 ▲0.1444.69 ▲3.09
Elasticommerce Services /wp-admin/options-general.php?page=wp_elasticsearch8022.0223.4326.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_elasticsearch
    • > Notice in wp-content/plugins/elasticommerce-search-form/elasticommerce-search-form.php+72
    Trying to access array offset on value of type bool

SRP 50% 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
The following issues need your attention
  • 386× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Elastica\\Test\\Base' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/RangeTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Elastica\\Filter\\AbstractFilter' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/lib/Elastica/Filter/Range.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Elastica\\Test\\Base' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/test/lib/Elastica/Test/Suggest/TermTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Elastica\\Rescore\\AbstractRescore' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/lib/Elastica/Rescore/Query.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Elastica\\Connection\\Strategy\\StrategyInterface' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/lib/Elastica/Connection/Strategy/CallbackStrategy.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Elastica\\Test\\Aggregation\\BaseAggregationTest' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/test/lib/Elastica/Test/Aggregation/DateHistogramTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Elastica\\Response' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/lib/Elastica/Bulk/Response.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Elastica\\Query\\AbstractQuery' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/lib/Elastica/Query/HasParent.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Elastica\\Test\\Base' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/test/lib/Elastica/Test/Bulk/ActionTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Elastica\\Param' not found in wp-content/plugins/elasticommerce-search-form/vendor/ruflin/elastica/lib/Elastica/Aggregation/AbstractAggregation.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (Setting Screen.)
You can take inspiration from this readme.txt

elasticommerce-search-form/elasticommerce-search-form.php 85% from 13 tests

The main PHP script in "Elasticommerce Search Form" version 1.1 is automatically included on every request by WordPress
The following require your attention:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected32,926 lines of code in 478 files:
LanguageFilesBlank linesComment linesLines of code
PHP4407,50116,06729,866
CSS233511,143
Markdown836601,022
JSON610246
Bourne Shell22815131
JavaScript43225128
YAML63424127
make13622125
XML40093
Dockerfile4201844
Groovy1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity3.59
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces54
Interfaces8
Traits2
Classes427
▷ Abstract classes235.39%
▷ Concrete classes40494.61%
▷ Final classes00.00%
Methods2,580
▷ Static methods451.74%
▷ Public methods2,42093.80%
▷ Protected methods1425.50%
▷ Private methods180.70%
Functions15
▷ Named functions320.00%
▷ Anonymous functions1280.00%
Constants175
▷ Global constants31.71%
▷ Class constants17298.29%
▷ Public constants172100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
screenshot-1.png26.68KB7.58KB▼ 71.60%
css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%