84% wp-spid-italia

Code Review | WP SPID Italia

WordPress plugin WP SPID Italia scored84%from 54 tests.

About plugin

  • Plugin page: wp-spid-italia
  • Plugin version: 2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.4
  • WordPress version: 6.3.1
  • First release: Nov 14, 2017
  • Latest release: Oct 25, 2023
  • Number of updates: 59
  • Update frequency: every 36.8 days
  • Top authors: Milmor (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /9,589 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.81ms] Passed 4 tests

A check of server-side resources used by WP SPID Italia
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1440.56 ▲2.76
Dashboard /wp-admin3.44 ▲0.1446.37 ▲2.11
Posts /wp-admin/edit.php3.55 ▲0.2050.18 ▼2.62
Add New Post /wp-admin/post-new.php6.02 ▲0.1384.29 ▼9.50
Media Library /wp-admin/upload.php3.36 ▲0.1337.01 ▲3.41
SPID /wp-admin/options-general.php?page=spid_menu3.3530.70

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 96 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
spid_version
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WP SPID Italia
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲12913.43 ▼0.928.73 ▲6.8843.45 ▲0.12
Dashboard /wp-admin2,196 ▲225.51 ▼0.0989.50 ▲4.8636.11 ▼4.08
Posts /wp-admin/edit.php2,101 ▲42.00 ▲0.0235.66 ▼1.8833.18 ▼1.68
Add New Post /wp-admin/post-new.php1,528 ▼723.10 ▲5.05667.04 ▼31.7757.88 ▼13.09
Media Library /wp-admin/upload.php1,407 ▲74.16 ▼0.0595.36 ▼8.4043.18 ▼3.62
SPID /wp-admin/options-general.php?page=spid_menu9892.1723.8069.88

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

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

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
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Italia\\Spid\\Spid\\Interfaces\\ResponseInterface' not found in wp-content/plugins/wp-spid-italia/lib/src/Spid/Saml/In/Response.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-spid-italia/user.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'Italia\\Spid\\Spid\\Interfaces\\ResponseInterface' not found in wp-content/plugins/wp-spid-italia/lib/src/Spid/Saml/In/LogoutResponse.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Italia\\Spid\\Spid\\Interfaces\\SAMLInterface' not found in wp-content/plugins/wp-spid-italia/lib/src/Spid/Saml.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Italia\\Spid\\Spid\\Saml\\Out\\Base' not found in wp-content/plugins/wp-spid-italia/lib/src/Spid/Saml/Out/LogoutRequest.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Italia\\Spid\\Spid\\Interfaces\\ResponseInterface' not found in wp-content/plugins/wp-spid-italia/lib/src/Spid/Saml/In/LogoutRequest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Italia\\Spid\\Spid\\Saml\\Out\\Base' not found in wp-content/plugins/wp-spid-italia/lib/src/Spid/Saml/Out/LogoutResponse.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-spid-italia/wp-spid-italia.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Italia\\Spid\\Spid\\Interfaces\\IdpInterface' not found in wp-content/plugins/wp-spid-italia/lib/src/Spid/Saml/Idp.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Italia\\Spid\\Spid\\Saml\\Out\\Base' not found in wp-content/plugins/wp-spid-italia/lib/src/Spid/Saml/Out/AuthnRequest.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Requires php: Version not formatted correctly
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-spid-italia/wp-spid-italia.php Passed 13 tests

"WP SPID Italia" version 2.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
45 characters long description:
SPID - Sistema Pubblico di Identità Digitale

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
Everything looks great! No dangerous files found in this plugin7,010 lines of code in 79 files:
LanguageFilesBlank linesComment linesLines of code
PHP376211,0314,298
SVG1746111,202
XML1780923
CSS1842398
Markdown231074
JSON20063
JavaScript251137
YAML14015

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.41
Average class complexity25.56
▷ Minimum class complexity1.00
▷ Maximum class complexity156.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces9
Interfaces4
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods180
▷ Static methods2513.89%
▷ Public methods15485.56%
▷ Protected methods10.56%
▷ Private methods2513.89%
Functions42
▷ Named functions1842.86%
▷ Anonymous functions2457.14%
Constants49
▷ Global constants918.37%
▷ Class constants4081.63%
▷ Public constants40100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.22MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/no.png1.86KB1.75KB▼ 5.82%
img/spid-logo-wp.png37.93KB16.75KB▼ 55.85%
img/spid-ico-circle-bb.png11.58KB5.30KB▼ 54.27%
img/spid-agid-logo-lb.png50.62KB24.91KB▼ 50.78%
img/ils.png6.00KB2.91KB▼ 51.51%