83% octolio

Code Review | WooCommerce Smart Coupons

WordPress plugin WooCommerce Smart Coupons scored83%from 54 tests.

About plugin

  • Plugin page: octolio
  • Plugin version: 0.0.6
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Apr 18, 2020
  • Latest release: Sep 16, 2020
  • Number of updates: 67
  • Update frequency: every 2.3 days
  • Top authors: octolio (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /1,355 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.81MB] [CPU: ▲2.54ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Smart Coupons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7546.76 ▲5.43
Dashboard /wp-admin4.13 ▲0.8353.95 ▲2.34
Posts /wp-admin/edit.php4.20 ▲0.8459.98 ▲11.76
Add New Post /wp-admin/post-new.php6.77 ▲0.8996.94 ▼5.63
Media Library /wp-admin/upload.php4.05 ▲0.8342.39 ▲8.00
Automatic Actions /wp-admin/edit.php?post_type=octolio_workflow4.1647.14
Manual Actions /wp-admin/edit.php?post_type=octolio_bulkaction4.1642.01

Server storage [IO: ▲0.42MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • Illegal file modification detected: 1 file (0.89KB) outside of "wp-content/plugins/octolio/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 45 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
octolio_init
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Smart Coupons
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲8914.47 ▲0.091.71 ▼0.3342.33 ▼2.75
Dashboard /wp-admin2,230 ▲394.88 ▼1.02109.22 ▼14.0344.33 ▼5.15
Posts /wp-admin/edit.php2,110 ▲212.00 ▼0.0539.66 ▲1.4136.33 ▲3.05
Add New Post /wp-admin/post-new.php1,553 ▲1623.28 ▲5.11629.56 ▼25.2558.09 ▲2.53
Media Library /wp-admin/upload.php1,415 ▲334.22 ▲0.0296.81 ▼1.6042.69 ▲1.14
Automatic Actions /wp-admin/edit.php?post_type=octolio_workflow1,6382.0135.6031.83
Manual Actions /wp-admin/edit.php?post_type=octolio_bulkaction1,6382.0333.9631.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • octolio_init
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 23× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/octolio/inc/admin/views/bulkaction/listing.php
    • > /wp-content/plugins/octolio/inc/classes/workflow.php
    • > /wp-content/plugins/octolio/octolio.php
    • > /wp-content/plugins/octolio/inc/library/class.php
    • > /wp-content/plugins/octolio/inc/helpers/post.php
    • > /wp-content/plugins/octolio/inc/library/integration.php
    • > /wp-content/plugins/octolio/inc/integrations/page.php
    • > /wp-content/plugins/octolio/inc/type/operator.php
    • > /wp-content/plugins/octolio/inc/admin/admin.php
    • > /wp-content/plugins/octolio/inc/helpers/helper.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
  • Screenshots: Add a description for screenshot #4 in octolio/assets to your readme.txt
The official readme.txt is a good inspiration

octolio/octolio.php 92% from 13 tests

"WooCommerce Smart Coupons" version 0.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin7,507 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP231,5451,1245,141
CSS4436842,128
JavaScript18624224
SVG10014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.94
▷ Minimum class complexity1.00
▷ Maximum class complexity135.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes32
▷ Abstract classes412.50%
▷ Concrete classes2887.50%
▷ Final classes00.00%
Methods404
▷ Static methods61.49%
▷ Public methods37292.08%
▷ Protected methods00.00%
▷ Private methods327.92%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/admin/assets/lib/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.32KB0.18KB▼ 44.00%
inc/admin/assets/lib/jquery/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%
inc/admin/assets/lib/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png0.38KB0.12KB▼ 67.68%
inc/admin/assets/lib/jquery/images/ui-icons_cd0a0a_256x240.png4.57KB4.18KB▼ 8.43%
inc/admin/assets/lib/jquery/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%