10% digirisk

Code Review | Digirisk

WordPress plugin Digirisk scored10%from 54 tests.

About plugin

  • Plugin page: digirisk
  • Plugin version: 7.7.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0.2
  • WordPress version: 6.3.1
  • First release: Apr 27, 2016
  • Latest release: Nov 14, 2022
  • Number of updates: 213
  • Update frequency: every 11.3 days
  • Top authors: Evarisk (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /9,647 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/digirisk/core/helper/util.helper.php+44
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲1.28MB] [CPU: ▼14.09ms] Passed 4 tests

A check of server-side resources used by Digirisk
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.44 ▲1.9839.39 ▼2.46
Dashboard /wp-admin5.02 ▲1.7130.33 ▼17.86
Posts /wp-admin/edit.php5.48 ▲2.1255.75 ▲10.19
Add New Post /wp-admin/post-new.php5.25 ▼0.6443.66 ▼46.21
Media Library /wp-admin/upload.php5.30 ▲2.0748.97 ▲18.80
Minimize menu /wp-admin/admin.php?page=minimize-menu5.2441.13
Tableau de bord /wp-admin/admin.php?page=go-to-wp-admin5.2436.96

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 1,623 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
digi_cap_init
theysaidso_admin_options
widget_recent-posts
_digirisk_accronym

Browser metrics Passed 4 tests

Checking browser requirements for Digirisk
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,571 ▼21513.89 ▼0.469.44 ▲7.4141.74 ▲2.19
Dashboard /wp-admin1,864 ▼3166.06 ▲0.4684.79 ▼9.6379.33 ▲39.13
Posts /wp-admin/edit.php2,224 ▲1242.42 ▲0.4537.86 ▲0.7734.24 ▼1.72
Add New Post /wp-admin/post-new.php1,442 ▼8418.45 ▼5.08671.98 ▼15.4631.88 ▼36.44
Media Library /wp-admin/upload.php1,565 ▲1655.05 ▲0.87122.47 ▲10.3486.55 ▲39.50
Minimize menu /wp-admin/admin.php?page=minimize-menu7592.4630.5420.47
Tableau de bord /wp-admin/admin.php?page=go-to-wp-admin7592.4530.0113.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • digi_cap_init
    • db_upgraded
    • widget_theysaidso_widget
    • _digirisk_accronym
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=go-to-wp-admin
    • > Notice in wp-content/plugins/digirisk/core/external/eo-framework/modules/wpeo-custom-menu/class/class-custom-menu-handler.php+104
    Undefined index: logo
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=go-to-wp-admin
    • > Notice in wp-content/plugins/digirisk/core/external/eo-framework/modules/wpeo-custom-menu/class/class-custom-menu-handler.php+104
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=go-to-wp-admin
    • > Notice in wp-content/plugins/digirisk/core/external/eo-framework/modules/wpeo-custom-menu/view/content.view.php+36
    Uninitialized string offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=go-to-wp-admin
    • > Warning in wp-content/plugins/digirisk/core/external/eo-framework/modules/wpeo-custom-menu/view/content.view.php+39
    call_user_func() expects parameter 1 to be a valid callback, function '' not found or invalid function name

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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/digirisk/modules/corrective_task/view/move-to.view.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'eoxia\\View_Util' not found in wp-content/plugins/digirisk/modules/setting/view/accronym/form.view.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_attachment_url() in wp-content/plugins/digirisk/modules/signature/view/button-only-content.view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql2date() in wp-content/plugins/digirisk/core/assets/js/define-string.js.php:2

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

digirisk/digirisk.php 85% from 13 tests

The primary PHP file in "Digirisk" version 7.7.6 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 199 characters long)
  • Git Repository: Please do not include Git repositories in your plugin

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 detected86,681 lines of code in 987 files:
LanguageFilesBlank linesComment linesLines of code
PHP6339,32118,26838,899
CSS191,76171511,272
JavaScript822,6035,70710,975
Sass16481925710,655
SVG3008,611
PO File31,2152,3782,248
HTML19281361,922
JSON593201,910
Markdown51110189

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity11.65
▷ Minimum class complexity1.00
▷ Maximum class complexity553.00
Average method complexity3.91
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes334
▷ Abstract classes10.30%
▷ Concrete classes33399.70%
▷ Final classes00.00%
Methods1,199
▷ Static methods181.50%
▷ Public methods1,09291.08%
▷ Protected methods826.84%
▷ Private methods252.09%
Functions49
▷ Named functions2142.86%
▷ Anonymous functions2857.14%
Constants66
▷ Global constants6598.48%
▷ Class constants11.52%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
164 PNG files occupy 2.82MB with 0.83MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/assets/images/preconisations/avertissements/dangerElectrique_xs.png0.50KB0.42KB▼ 16.63%
core/assets/images/typeDeTravaux/large/meuleuse-large.png91.11KB35.45KB▼ 61.09%
core/assets/images/preconisations/avertissements/dangerGeneral_xs.png0.49KB0.41KB▼ 16.30%
core/assets/images/preconisations/avertissements/dangerMatieresComburantes_s.png0.94KB0.84KB▼ 10.32%
core/assets/images/typeDeTravaux/chalumeau.png0.87KB0.50KB▼ 42.31%