77% d7sms

Code Review | D7SMS for Woocommerce

WordPress plugin D7SMS for Woocommerce scored 77% from 54 tests.

About plugin

  • Plugin page: d7sms
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.1.1
  • WordPress version: 5.8.1
  • First release: May 9, 2019
  • Latest release: Oct 23, 2019
  • Number of updates: 15
  • Update frequency: every 11.2 days
  • Top authors: direct7networks (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 827 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.15MB] [CPU: ▼153.97ms] Passed 4 tests

Server-side resources used by D7SMS for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1344.35 ▲16.39
Dashboard /wp-admin2.99 ▼0.0732.23 ▼15.37
Posts /wp-admin/edit.php3.04 ▼0.0734.49 ▼10.05
Add New Post /wp-admin/post-new.php4.98 ▼0.4681.24 ▼587.74
Media Library /wp-admin/upload.php2.99 ▼0.0133.06 ▼2.72

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 115 new files
Database: no new tables, 1 new option
New WordPress options
d7_recently_activated

Browser metrics Passed 4 tests

An overview of browser requirements for D7SMS for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.83 ▲0.289.12 ▲0.3146.93 ▼2.72
Dashboard /wp-admin2,967 ▲305.88 ▼0.30141.72 ▼11.49116.84 ▼6.06
Posts /wp-admin/edit.php2,736 ▼32.69 ▼0.0072.22 ▼1.0597.57 ▲1.87
Add New Post /wp-admin/post-new.php1,500 ▼18318.75 ▲0.04401.77 ▲8.87115.43 ▼6.46
Media Library /wp-admin/upload.php1,807 ▼35.07 ▲0.03144.18 ▼16.77125.33 ▼0.37

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • d7_recently_activated

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/d7sms/plugin-fw/lib/d7-cpt-unlimited.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/d7sms/plugin-fw/templates/fields/sidebars.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/d7sms/plugin-fw/templates/panel/woocommerce/woocommerce-option-row.php:13
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/d7sms/plugin-fw/templates/fields/icons.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/d7sms/plugin-options/providers.php:4
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/d7sms/plugin-fw/templates/fields/sidebars.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/d7sms/plugin-fw/templates/panel/woocommerce/woocommerce-panel.php:9
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/d7sms/plugin-fw/templates/fields/sidebars.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/d7sms/plugin-fw/templates/fields/sidebars.php:17
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/d7sms/plugin-fw/templates/metaboxes/types/icon-list.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/d7sms/plugin-fw/templates/panel/woocommerce/woocommerce-form.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add a description for screenshot #6 in d7sms/assets to your readme.txt
You can look at the official readme.txt

d7sms/run.php 77% from 13 tests

The principal PHP file in "D7SMS for Woocommerce" v. 1.0.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Domain Path: The domain path folder was not found ("/languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("d7sms.php" instead of "run.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 359 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin18,244 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
PHP772,2821,0808,865
JavaScript101,0885567,309
CSS8400792,007
Markdown112063

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity31.65
▷ Minimum class complexity2.00
▷ Maximum class complexity202.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes14.35%
▷ Concrete classes2295.65%
▷ Final classes00.00%
Methods250
▷ Static methods3112.40%
▷ Public methods22288.80%
▷ Protected methods72.80%
▷ Private methods218.40%
Functions88
▷ Named functions8798.86%
▷ Anonymous functions11.14%
Constants14
▷ Global constants14100.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
17 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/select2.png0.60KB0.99KB0.00%
plugin-fw/assets/images/licence-error.png1.61KB0.94KB▼ 41.62%
plugin-fw/assets/images/x.png0.70KB0.71KB0.00%
plugin-fw/assets/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
plugin-fw/assets/images/double-sidebar.png0.95KB0.12KB▼ 87.73%