83% product-of-origin

Code Review | Product of Origin

WordPress plugin Product of Origin scored 83% from 54 tests.

About plugin

  • Plugin page: product-of-origin
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.1.0
  • WordPress version: 6.3.1
  • First release: Dec 10, 2021
  • Latest release: Dec 21, 2022
  • Number of updates: 5
  • Update frequency: every 75.2 days
  • Top authors: viralmehta (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 863 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Product of Origin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.62 ▼1.17
Dashboard /wp-admin3.31 ▲0.0057.05 ▲7.76
Posts /wp-admin/edit.php3.36 ▲0.0045.56 ▼3.71
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.66 ▼10.82
Media Library /wp-admin/upload.php3.23 ▲0.0034.81 ▼3.25

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: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product of Origin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.26 ▼0.102.11 ▲0.5644.35 ▲2.47
Dashboard /wp-admin2,203 ▲155.83 ▲0.91118.32 ▲11.1441.16 ▼1.59
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0437.33 ▼2.5735.21 ▲1.37
Add New Post /wp-admin/post-new.php1,535 ▲223.32 ▲0.06597.68 ▼28.6058.22 ▼44.99
Media Library /wp-admin/upload.php1,388 ▲64.21 ▼0.00100.52 ▼10.3542.26 ▼1.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/product-of-origin/admin/partials/product-of-origin-admin-display.php
    • > /wp-content/plugins/product-of-origin/public/partials/product-of-origin-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === product-of-origin === )
  • Screenshots: Add images for these screenshots: #1 (screenshot-1 Select country from drop down list and check mark to show country.), #2 (screenshot-2 Show country of origin on product detail page.), #3 (screenshot-3 Show country of origin on cart page), #4 (screenshot-4 Show country of origin on checkoout page), #5 (screenshot-5 Show country of origin on order detail page)
You can look at the official readme.txt

product-of-origin/product-of-origin.php 92% from 13 tests

This is the main PHP file of "Product of Origin" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 225 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin531 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13153611525
JavaScript24546
CSS2080

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.57
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.37
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods30
▷ Static methods26.67%
▷ Public methods2583.33%
▷ Protected methods00.00%
▷ Private methods516.67%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG images were found in this plugin