89% first-order-discount-woocommerce

Code Review | First Order Discount Woocommerce

WordPress plugin First Order Discount Woocommerce scored89%from 54 tests.

About plugin

  • Plugin page: first-order-disco...
  • Plugin version: 1.21
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Aug 18, 2017
  • Latest release: Jul 11, 2023
  • Number of updates: 64
  • Update frequency: every 33.6 days
  • Top authors: vidishp (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

2,000+ active /33,801 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: ▼11.89ms] Passed 4 tests

An overview of server-side resources used by First Order Discount Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.77 ▼2.20
Dashboard /wp-admin3.31 ▼0.0446.71 ▼10.10
Posts /wp-admin/edit.php3.36 ▲0.0047.61 ▼1.98
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.95 ▼32.89
Media Library /wp-admin/upload.php3.23 ▲0.0034.35 ▼2.35

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by First Order Discount Woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.70 ▼0.091.61 ▼0.1638.34 ▼2.51
Dashboard /wp-admin2,189 ▲125.51 ▼0.2083.55 ▼3.4742.14 ▼2.15
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0238.97 ▲0.2234.85 ▼0.69
Add New Post /wp-admin/post-new.php1,526 ▼023.14 ▲0.00684.66 ▲8.9352.72 ▲1.62
Media Library /wp-admin/upload.php1,400 ▼04.25 ▲0.0796.00 ▼16.1341.37 ▼6.22

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 does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
No output text or server-side errors detected on direct access of PHP files

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: woocommerce discount, first order discount, order discount, discount, free gift

first-order-discount-woocommerce/first-order-discount-woocommerce.php 85% from 13 tests

The main file in "First Order Discount Woocommerce" v. 1.21 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 207 characters long)
  • Requires at least: The required version number must match the one declared in readme.txt ("3.0.1" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin5,538 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript21,2743274,865
PHP46250433
CSS3389240

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin