83% elasticommerce-related-items

Code Review | Elasticommerce Related Items

WordPress plugin Elasticommerce Related Items scored83%from 54 tests.

About plugin

  • Plugin page: elasticommerce-re...
  • Plugin version: 0.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2016
  • Latest release: May 6, 2016
  • Number of updates: 6
  • Update frequency: every 10.5 days
  • Top authors: hideokamoto (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /583 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼4.79ms] Passed 4 tests

Server-side resources used by Elasticommerce Related Items
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1538.29 ▼4.36
Dashboard /wp-admin3.53 ▲0.2251.32 ▲0.33
Posts /wp-admin/edit.php3.58 ▲0.2250.25 ▲2.11
Add New Post /wp-admin/post-new.php6.05 ▲0.1688.22 ▼17.23
Media Library /wp-admin/upload.php3.39 ▲0.1637.31 ▲2.95
Elasticommerce Services /wp-admin/options-general.php?page=escr_related3.3634.33

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_esc_relateditems
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Elasticommerce Related Items
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.73 ▲0.151.92 ▲0.0843.09 ▲2.21
Dashboard /wp-admin2,202 ▲255.70 ▲0.1184.83 ▼6.3242.52 ▲0.31
Posts /wp-admin/edit.php2,101 ▼22.05 ▲0.0835.49 ▼4.4438.08 ▼1.29
Add New Post /wp-admin/post-new.php1,529 ▼317.57 ▼5.61653.68 ▲11.7362.38 ▲4.53
Media Library /wp-admin/upload.php1,404 ▲74.19 ▼0.2397.86 ▼6.4042.47 ▼1.55
Elasticommerce Services /wp-admin/options-general.php?page=escr_related8622.0222.9128.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_esc_relateditems
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/elasticommerce-related-items/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/elasticommerce-related-items/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/elasticommerce-related-items/elasticommerce-relateditem.php:159
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/elasticommerce-related-items/vendor/psr/log/Psr/Log/NullLogger.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: woocommerce, elasticsearch, recommend

elasticommerce-related-items/elasticommerce-relateditem.php 77% from 13 tests

"Elasticommerce Related Items" version 0.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("elasticommerce-related-items.php" instead of "elasticommerce-relateditem.php")

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
Success! There were no dangerous files found in this plugin1,354 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP232149371,205
JSON200116
Markdown112033

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.11
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces2
Traits2
Classes15
▷ Abstract classes213.33%
▷ Concrete classes1386.67%
▷ Final classes00.00%
Methods109
▷ Static methods87.34%
▷ Public methods9385.32%
▷ Protected methods00.00%
▷ Private methods1614.68%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants110.00%
▷ Class constants990.00%
▷ Public constants9100.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
There were not PNG files found in your plugin