74% cm-idin

Code Review | CM iDIN for WooCommerce

WordPress plugin CM iDIN for WooCommerce scored 74% from 54 tests.

About plugin

  • Plugin page: cm-idin
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7.2
  • WordPress version: 5.8.1
  • First release: Jun 7, 2017
  • Latest release: Jun 2, 2021
  • Number of updates: 13
  • Update frequency: every 112.4 days
  • Top authors: remcotolsma (69.23%)pronamic (38.46%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 809 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.29MB] [CPU: ▼142.12ms] Passed 4 tests

Analyzing server-side resources used by CM iDIN for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.05 ▲0.2235.58 ▲0.25
Dashboard /wp-admin3.42 ▲0.3643.54 ▲0.83
Posts /wp-admin/edit.php3.47 ▲0.3647.80 ▲1.62
Add New Post /wp-admin/post-new.php5.71 ▲0.2886.84 ▼567.86
Media Library /wp-admin/upload.php3.30 ▲0.3033.88 ▼1.71
Dashboard /wp-admin/admin.php?page=cm-idin3.2831.80
CM iDIN /wp-admin/options-general.php?page=cm-idin-options3.2734.64
Transactions /wp-admin/admin.php?page=cm-idin-transactions3.3131.51
Settings /wp-admin/admin.php?page=cm-idin-settings3.2733.21

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 45 new files
Database: 1 new table, 1 new option
New tables
wp_cm_idin_transactions
New WordPress options
cm_idin_version

Browser metrics Passed 4 tests

An overview of browser requirements for CM iDIN for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,766 ▲17015.83 ▼0.228.80 ▼1.2645.93 ▲0.86
Dashboard /wp-admin3,034 ▲1005.93 ▼0.13158.64 ▲8.70113.01 ▲4.08
Posts /wp-admin/edit.php2,800 ▲612.73 ▲0.0164.50 ▼4.3393.54 ▲3.14
Add New Post /wp-admin/post-new.php1,700 ▲1718.86 ▲0.85394.68 ▼0.95104.32 ▼2.06
Media Library /wp-admin/upload.php1,872 ▲655.06 ▲0.04149.66 ▼7.11115.78 ▼4.94
Dashboard /wp-admin/admin.php?page=cm-idin1,2662.1656.2190.89
CM iDIN /wp-admin/options-general.php?page=cm-idin-options1,2772.1758.3084.42
Transactions /wp-admin/admin.php?page=cm-idin-transactions1,2822.0953.7164.00
Settings /wp-admin/admin.php?page=cm-idin-settings1,2772.1055.2293.55

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_cm_idin_transactions
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • cm_idin_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, 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
Almost there! Just fix the following items
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cm-idin/admin/page-dashboard.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/cm-idin/classes/class-transactions-list-table.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cm-idin/admin/page-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-idin/cm-idin.php:21
    • > PHP Notice
      Trying to get property 'status_response' of non-object in wp-content/plugins/cm-idin/admin/page-transaction.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cm-idin/templates/age-verification.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cm-idin/admin/page-transaction.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cm-idin/admin/page-transactions.php:2
    • > PHP Notice
      Undefined variable: transaction in wp-content/plugins/cm-idin/admin/page-transaction.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cm-idin/templates/register-login.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: age, webshop, idin, cm, identification...

cm-idin/cm-idin.php Passed 13 tests

The primary PHP file in "CM iDIN for WooCommerce" version 1.0.2 is used by WordPress to initiate all plugin functionality
94 characters long description:
With iDIN a merchant can identify the consumers name and address and verify if the age is 18+.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected3,098 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP348326122,712
PO File1120141269
CSS201160
JSON20055
SVG2002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity19.50
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes16.25%
Methods133
▷ Static methods1712.78%
▷ Public methods12493.23%
▷ Protected methods10.75%
▷ Private methods86.02%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin