68% smart-id

Code Review | eID Easy

WordPress plugin eID Easy scored68%from 54 tests.

About plugin

  • Plugin page: smart-id
  • Plugin version: 4.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8
  • WordPress version: 6.3.1
  • First release: Jul 13, 2016
  • Latest release: Feb 10, 2023
  • Number of updates: 90
  • Update frequency: every 26.7 days
  • Top authors: smartid (96.67%)eideasy (4.44%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,983 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.15MB] [CPU: ▲8.64ms] Passed 4 tests

A check of server-side resources used by eID Easy
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3353.38 ▲12.14
Dashboard /wp-admin3.44 ▲0.1055.27 ▼4.52
Posts /wp-admin/edit.php3.56 ▲0.2059.82 ▲12.45
Add New Post /wp-admin/post-new.php6.03 ▲0.14106.17 ▲14.51
Media Library /wp-admin/upload.php3.37 ▲0.1448.07 ▲14.47

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 26 new files
Database: 1 new table, 16 new options
New tables
wp_idcard_users
New WordPress options
lveid_enabled
theysaidso_admin_options
smartid_pt-id-card_enabled
widget_recent-posts
smartid_smartid_enabled
smartid_idcard_enabled
can_compress_scripts
widget_recent-comments
eideasy-eparaksts-mobile_enabled
eideasy-itsme-login-standard_enabled
...

Browser metrics Passed 4 tests

Checking browser requirements for eID Easy
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲2214.38 ▼0.191.96 ▼0.0632.84 ▼10.41
Dashboard /wp-admin2,208 ▲345.57 ▲0.0384.13 ▼16.6541.92 ▼1.45
Posts /wp-admin/edit.php2,116 ▲191.95 ▼0.0141.15 ▲5.7936.86 ▲3.32
Add New Post /wp-admin/post-new.php1,550 ▲2118.42 ▼4.52626.30 ▼61.7078.18 ▲20.18
Media Library /wp-admin/upload.php1,410 ▲74.20 ▲0.0297.03 ▼11.9141.72 ▼0.85

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_idcard_users
  • Zombie WordPress options were found after uninstall: 16 options
    • smartid_mobileid_enabled
    • widget_theysaidso_widget
    • smartid_lt-id-card_enabled
    • eideasy-eparaksts-mobile_enabled
    • eideasy-itsme-login-standard_enabled
    • widget_recent-posts
    • lveid_enabled
    • db_upgraded
    • widget_recent-comments
    • smartid_pt-id-card_enabled
    • ...

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/smart-id/api_manual_setup.php
    • > /wp-content/plugins/smart-id/iframe_break_free_errorhandler.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/smart-id/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/smart-id/templates/checkbox-template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/smart-id/smart-id.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/smart-id/templates/login-button-template.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (20 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

smart-id/smart-id.php Passed 13 tests

The main file in "eID Easy" v. 4.9.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
100 characters long description:
Allow your visitors to login to Wordpress ID-card, Mobile-ID, Smart-ID mobile app and other methods.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,065 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP1115250875
HTML11410141
JavaScript19447
SVG2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity22.25
▷ Minimum class complexity11.00
▷ Maximum class complexity46.00
Average method complexity4.15
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27100.00%
▷ Public methods2592.59%
▷ Protected methods00.00%
▷ Private methods27.41%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
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
9 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/Smart-ID_login_btn.png3.46KB2.07KB▼ 40.14%
img/eid_mobiilid_mark.png16.52KB6.37KB▼ 61.46%
img/latvia_eid.png3.99KB2.12KB▼ 46.70%
img/latvia-id-card.png5.99KB6.02KB0.00%
img/lithuania_eid.png2.45KB1.68KB▼ 31.21%