90% fermiac-siftscience-for-woocommerce

Code Review | Sift for WooCommerce

WordPress plugin Sift for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: fermiac-siftscien...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.2-5.7.2
  • WordPress version: 6.3.1
  • First release: Sep 22, 2016
  • Latest release: Jun 5, 2021
  • Number of updates: 55
  • Update frequency: every 31.3 days
  • Top authors: nabsul (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,349 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.44ms] Passed 4 tests

This is a short check of server-side resources used by Sift for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0251.53 ▲3.70
Dashboard /wp-admin3.32 ▲0.0249.06 ▼2.39
Posts /wp-admin/edit.php3.37 ▲0.0250.48 ▼5.70
Add New Post /wp-admin/post-new.php5.90 ▲0.0293.17 ▼12.59
Media Library /wp-admin/upload.php3.25 ▲0.0236.58 ▼1.08

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Sift for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.151.78 ▼0.1038.30 ▼7.49
Dashboard /wp-admin2,198 ▲215.67 ▲0.0289.45 ▼0.6636.46 ▼4.27
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0240.00 ▼3.4636.78 ▼1.22
Add New Post /wp-admin/post-new.php1,525 ▼1223.83 ▲5.68587.98 ▼72.2162.84 ▼7.67
Media Library /wp-admin/upload.php1,397 ▼04.22 ▲0.09100.80 ▼17.0646.12 ▼1.20

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: fermiac, sift, woocommerce, fraud

fermiac-siftscience-for-woocommerce/class-wc-siftscience-plugin.php 92% from 13 tests

"Sift for WooCommerce" version 1.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fermiac-siftscience-for-woocommerce.php" instead of "class-wc-siftscience-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected14,729 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61351,61412,485
PHP215191,5792,167
CSS29044
Markdown113022
YAML10010
Bourne Shell1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity9.95
▷ Minimum class complexity2.00
▷ Maximum class complexity29.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods160
▷ Static methods10.62%
▷ Public methods12175.62%
▷ Protected methods00.00%
▷ Private methods3924.38%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants39
▷ Global constants00.00%
▷ Class constants39100.00%
▷ Public constants2358.97%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/images/good-gray.png0.31KB0.27KB▼ 11.75%
dist/images/bad-gray.png0.44KB0.40KB▼ 8.65%
dist/images/clipboard.png0.48KB0.37KB▼ 24.14%
dist/images/upload.png0.27KB0.23KB▼ 15.11%
dist/images/bad.png0.39KB0.38KB▼ 3.24%