78% hookit-related-products

Code Review | Recomendação de moda

WordPress plugin Recomendação de moda scored78%from 54 tests.

About plugin

  • Plugin page: hookit-related-pr...
  • Plugin version: 0.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.3
  • WordPress version: 6.3.1
  • First release: Oct 20, 2015
  • Latest release: May 25, 2016
  • Number of updates: 28
  • Update frequency: every 8.2 days
  • Top authors: edpittol (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,335 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 gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.02ms] Passed 4 tests

A check of server-side resources used by Recomendação de moda
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.65 ▼8.56
Dashboard /wp-admin3.37 ▲0.0744.93 ▲1.22
Posts /wp-admin/edit.php3.49 ▲0.1349.67 ▲7.47
Add New Post /wp-admin/post-new.php5.98 ▲0.0984.14 ▼23.31
Media Library /wp-admin/upload.php3.30 ▲0.0736.28 ▲2.58
Settings /wp-admin/admin.php?page=hookit_recommended_products3.2833.76
Update Posts /wp-admin/admin.php?page=hookit_recommended_products_tool3.2935.15

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Recomendação de moda
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6514.26 ▼0.391.54 ▼0.0740.09 ▼4.54
Dashboard /wp-admin2,233 ▲535.67 ▲0.0697.32 ▲12.1442.66 ▲5.10
Posts /wp-admin/edit.php2,149 ▲492.11 ▲0.1039.59 ▲0.0439.79 ▲1.09
Add New Post /wp-admin/post-new.php1,556 ▲2823.23 ▲0.42672.85 ▲41.8461.98 ▲11.60
Media Library /wp-admin/upload.php1,435 ▲354.46 ▲0.2498.26 ▼1.3840.92 ▼0.47
Settings /wp-admin/admin.php?page=hookit_recommended_products1,0422.2632.2030.87
Update Posts /wp-admin/admin.php?page=hookit_recommended_products_tool8342.1025.0424.00

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 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
Please fix the following items
  • 12× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/hookit-related-products/admin/settings.php
    • > /wp-content/plugins/hookit-related-products/includes/filters.php
    • > /wp-content/plugins/hookit-related-products/admin/views/metabox.php
    • > /wp-content/plugins/hookit-related-products/admin/actions.php
    • > /wp-content/plugins/hookit-related-products/admin/functions.php
    • > /wp-content/plugins/hookit-related-products/admin/views/tool.php
    • > /wp-content/plugins/hookit-related-products/views/recommended-products.php
    • > /wp-content/plugins/hookit-related-products/admin/tool.php
    • > /wp-content/plugins/hookit-related-products/includes/actions.php
    • > /wp-content/plugins/hookit-related-products/hookit-recommended-products.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_screen() in wp-content/plugins/hookit-related-products/admin/views/header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_screen() in wp-content/plugins/hookit-related-products/admin/views/header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/hookit-related-products/init.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% 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
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
Please take inspiration from this readme.txt

hookit-related-products/hookit-recommended-products.php 85% from 13 tests

The principal PHP file in "Recomendação de moda" v. 0.6.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("hookit-related-products.php" instead of "hookit-recommended-products.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,345 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP16120185606
JavaScript38114458
CSS41618182
PO File1375288
SVG10011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/switch.png3.01KB0.64KB▼ 78.70%
assets/img/sign.png1.85KB0.91KB▼ 50.95%