83% woocommerce-safircod

Code Review | WooCommerce SafirCOD

WordPress plugin WooCommerce SafirCOD scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-safircod
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3
  • WordPress version: 6.3.1
  • First release: Jan 16, 2014
  • Latest release: Oct 21, 2015
  • Number of updates: 40
  • Update frequency: every 16.1 days
  • Top authors: Domanjiri (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

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

A check of server-side resources used by WooCommerce SafirCOD
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1543.64 ▼6.72
Dashboard /wp-admin3.46 ▲0.1558.04 ▼0.26
Posts /wp-admin/edit.php3.57 ▲0.2156.43 ▲5.87
Add New Post /wp-admin/post-new.php6.04 ▲0.1596.38 ▼3.23
Media Library /wp-admin/upload.php3.38 ▲0.1542.30 ▲3.56

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce SafirCOD
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.25 ▼0.111.99 ▼0.1046.85 ▲3.42
Dashboard /wp-admin2,195 ▲155.61 ▼0.0588.45 ▼3.8039.56 ▲1.16
Posts /wp-admin/edit.php2,103 ▲62.03 ▲0.0939.07 ▲2.4937.25 ▲2.87
Add New Post /wp-admin/post-new.php1,538 ▲1022.85 ▼0.36638.73 ▲5.7759.44 ▲4.76
Media Library /wp-admin/upload.php1,400 ▼04.28 ▲0.1199.97 ▼17.3243.97 ▼5.86

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 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 50% from 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
Please fix the following
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/woocommerce-safircod/lib/nusoap/class.soapclient.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/woocommerce-safircod/lib/nusoap/class.soap_parser.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/woocommerce-safircod/lib/nusoap/class.xmlschema.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/woocommerce-safircod/safircod.php:25
    • > PHP Fatal error
      require_once(): Failed opening required 'Mail/mimeDecode.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-safircod/lib/nusoap/nusoapmime.php on line 42
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/woocommerce-safircod/lib/nusoap/class.soap_transport_http.php:15
    • > PHP Warning
      require_once(Mail/mimeDecode.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-safircod/lib/nusoap/nusoapmime.php on line 42
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/woocommerce-safircod/lib/nusoap/class.soap_server.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/woocommerce-safircod/lib/nusoap/class.wsdl.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/woocommerce-safircod/lib/nusoap/class.soap_fault.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt might help

woocommerce-safircod/safircod.php 85% from 13 tests

The principal PHP file in "WooCommerce SafirCOD" v. 1.6.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-safircod.php" instead of "safircod.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin15,080 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP171,2515,17715,066
CSS11113
JavaScript10191

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity74.53
▷ Minimum class complexity1.00
▷ Maximum class complexity388.00
Average method complexity8.63
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes38
▷ Abstract classes00.00%
▷ Concrete classes38100.00%
▷ Final classes00.00%
Methods366
▷ Static methods00.00%
▷ Public methods36599.73%
▷ Protected methods00.00%
▷ Private methods10.27%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected