77% alsoviewed-for-woocommerce

Code Review | Alsoviewed for woocommerce

WordPress plugin Alsoviewed for woocommerce scored77%from 54 tests.

About plugin

  • Plugin page: alsoviewed-for-wo...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-3.4
  • WordPress version: 6.3.1
  • First release: Oct 14, 2015
  • Latest release: Oct 14, 2015
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: abadahenno (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /662 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.41ms] Passed 4 tests

Analyzing server-side resources used by Alsoviewed for woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.43 ▲0.16
Dashboard /wp-admin3.31 ▲0.0144.40 ▼6.57
Posts /wp-admin/edit.php3.36 ▲0.0149.08 ▲6.14
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.90 ▲0.21
Media Library /wp-admin/upload.php3.23 ▲0.0137.15 ▲4.57

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Alsoviewed for woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.32 ▼1.431.70 ▼0.2244.04 ▼1.73
Dashboard /wp-admin2,206 ▲184.85 ▼0.15113.18 ▼4.3740.18 ▼1.04
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0639.60 ▲5.2435.52 ▲0.70
Add New Post /wp-admin/post-new.php1,533 ▼023.19 ▲0.02647.13 ▼33.5054.82 ▼1.87
Media Library /wp-admin/upload.php1,391 ▲64.15 ▼0.0995.40 ▼6.7141.24 ▼6.41

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/alsoviewed-for-woocommerce/woocommerce-also-viewed.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/alsoviewed-for-woocommerce/views/product/tpl.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Preview), #2 (Admin settings)
Please take inspiration from this readme.txt

alsoviewed-for-woocommerce/woocommerce-also-viewed.php 69% from 13 tests

This is the main PHP file of "Alsoviewed for woocommerce" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/lang/" does not exist
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version does not match the one declared in readme.txt ("3.0.1" instead of "4.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("alsoviewed-for-woocommerce.php" instead of "woocommerce-also-viewed.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected2,829 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4222241,366
CSS531681,090
PHP516671327
PO File1141446

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bkg_rating.png0.74KB0.59KB▼ 20.69%
css/grabbing.png0.11KB0.14KB0.00%