10% digirisk

Code Review | Digirisk

WordPress plugin Digirisk scored 10% from 54 tests.

About plugin

  • Plugin page: digirisk
  • Plugin version: 7.7.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8.1
  • WordPress version: 5.9.2
  • First release: Apr 27, 2016
  • Latest release: Nov 8, 2021
  • Number of updates: 209
  • Update frequency: every 9.7 days
  • Top authors: Evarisk (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active / 8,589 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > 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.58MB] [CPU: ▼339.92ms] Passed 4 tests

Server-side resources used by Digirisk
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.79 ▼0.739.41 ▼41.12
Dashboard /wp-admin2.81 ▼0.6010.53 ▼23.55
Posts /wp-admin/edit.php2.81 ▼0.8310.76 ▼27.47
Add New Post /wp-admin/post-new.php2.81 ▼4.169.76 ▼1,267.52
Media Library /wp-admin/upload.php2.81 ▼0.4911.14 ▼15.13
Minimize menu /wp-admin/admin.php?page=minimize-menu2.8110.88
Tableau de bord /wp-admin/admin.php?page=go-to-wp-admin2.819.88

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 1,620 new files
Database: no new tables, 2 new options
New WordPress options
digi_cap_init
_digirisk_accronym

Browser metrics Passed 4 tests

A check of browser resources used by Digirisk
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,343 ▼40116.97 ▲1.3910.77 ▲3.522.19 ▼0.01
Dashboard /wp-admin2,350 ▼5116.88 ▲0.72130.93 ▼11.60188.10 ▲15.05
Posts /wp-admin/edit.php2,809 ▲1183.79 ▲0.5475.01 ▲9.18161.45 ▲24.14
Add New Post /wp-admin/post-new.php1,704 ▼1320.39 ▼0.88422.37 ▼24.30177.31 ▲18.95
Media Library /wp-admin/upload.php1,854 ▲1566.47 ▲0.95132.86 ▼28.46207.33 ▲16.76
Minimize menu /wp-admin/admin.php?page=minimize-menu9943.2859.2867.61
Tableau de bord /wp-admin/admin.php?page=go-to-wp-admin9943.2659.8363.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/digirisk/core/helper/util.helper.php+44
    Array and string offset access syntax with curly braces is deprecated
  • This plugin does not fully uninstall, leaving 2 options in the database
    • digi_cap_init
    • _digirisk_accronym

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=go-to-wp-admin
    • > Deprecated in wp-content/plugins/digirisk/core/helper/util.helper.php+44
    Array and string offset access syntax with curly braces is deprecated
  • 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 | 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
Please take a closer look at the following
  • 1× PHP files output text 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: Call to undefined function mysql2date() in wp-content/plugins/digirisk/core/assets/js/define-string.js.php:2
    • > 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: Class 'eoxia\\View_Util' not found in wp-content/plugins/digirisk/modules/setting/view/accronym/form.view.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt might help

digirisk/digirisk.php 85% from 13 tests

The main file in "Digirisk" v. 7.7.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 199 characters long)
  • Git Repository: An alternative Git repository was detected

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 detected86,496 lines of code in 985 files:
LanguageFilesBlank linesComment linesLines of code
PHP6319,27418,16338,714
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
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity11.60
▷ Minimum class complexity1.00
▷ Maximum class complexity553.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes334
▷ Abstract classes10.30%
▷ Concrete classes33399.70%
▷ Final classes00.00%
Methods1,190
▷ Static methods181.51%
▷ Public methods1,08391.01%
▷ Protected methods826.89%
▷ Private methods252.10%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
164 PNG files occupy 2.82MB with 0.76MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/assets/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
core/assets/css/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
core/assets/images/preconisations/avertissements/dangerRayonnementLaser_s.png0.91KB0.80KB▼ 11.42%
core/assets/images/preconisations/epc/preconisations_epc_vs.png1.37KB1.38KB0.00%
core/assets/images/categorieDangers/chuteH_PictoCategorie_v2.png2.59KB1.42KB▼ 45.04%