89% f12-wc-accessories

Code Review | F12 WooCommerce accessories

WordPress plugin F12 WooCommerce accessories scored89%from 54 tests.

About plugin

  • Plugin page: f12-wc-accessories
  • Plugin version: 1.42
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 18, 2021
  • Latest release: Oct 31, 2022
  • Number of updates: 30
  • Update frequency: every 13.6 days
  • Top authors: forge12 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,432 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.95ms] Passed 4 tests

Server-side resources used by F12 WooCommerce accessories
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.31 ▲5.75
Dashboard /wp-admin3.38 ▲0.0846.42 ▼0.38
Posts /wp-admin/edit.php3.43 ▲0.0848.86 ▲2.69
Add New Post /wp-admin/post-new.php5.96 ▲0.0882.93 ▼14.86
Media Library /wp-admin/upload.php3.30 ▲0.0837.36 ▲4.77
Dashboard /wp-admin/admin.php?page=f12-wc-accessories3.2732.23
Optional Accessories /wp-admin/admin.php?page=f12-wc-accessories_optional_accessoire3.2730.02
Cart /wp-admin/admin.php?page=f12-wc-accessories_cart3.2737.18
Required Accessories /wp-admin/admin.php?page=f12-wc-accessories_required_accessoire3.2731.18

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

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

Browser metrics Passed 4 tests

A check of browser resources used by F12 WooCommerce accessories
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲10513.25 ▼0.981.80 ▲0.0942.30 ▼0.76
Dashboard /wp-admin2,252 ▲614.84 ▼0.07107.08 ▲1.6444.11 ▲0.59
Posts /wp-admin/edit.php2,134 ▲422.00 ▲0.0141.56 ▼2.0234.74 ▼3.02
Add New Post /wp-admin/post-new.php1,576 ▲3418.16 ▲0.04598.62 ▼22.3356.77 ▲1.53
Media Library /wp-admin/upload.php1,431 ▲434.21 ▼0.0395.27 ▼5.8042.21 ▼2.49
Dashboard /wp-admin/admin.php?page=f12-wc-accessories8612.1824.4027.52
Optional Accessories /wp-admin/admin.php?page=f12-wc-accessories_optional_accessoire1,0542.0123.9829.06
Cart /wp-admin/admin.php?page=f12-wc-accessories_cart1,0182.0126.1229.71
Required Accessories /wp-admin/admin.php?page=f12-wc-accessories_required_accessoire1,1382.0223.4430.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 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 Passed 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
The SRP test was a success

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

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4, #5, #6 in f12-wc-accessories/assets to your readme.txt
  • Requires at least: Version not formatted correctly
  • Requires php: Version not formatted correctly
You can look at the official readme.txt

f12-wc-accessories/Accessories.class.php 92% from 13 tests

The primary PHP file in "F12 WooCommerce accessories" version 1.42 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("f12-wc-accessories.php" instead of "Accessories.class.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
There were no executable files found in this plugin2,431 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP224606572,163
CSS25617268

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity13.22
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods113
▷ Static methods2421.24%
▷ Public methods10290.27%
▷ Protected methods00.00%
▷ Private methods119.73%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants3
▷ Global constants3100.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 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/logo-forge12-dark.png18.66KB6.28KB▼ 66.37%
assets/logo-forge12.png10.04KB3.91KB▼ 61.10%