84% mon-laboratoire

Code Review | Mon Laboratoire

WordPress plugin Mon Laboratoire scored84%from 54 tests.

About plugin

  • Plugin page: mon-laboratoire
  • Plugin version: 4.6
  • PHP compatiblity: 7.0.33+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Feb 20, 2020
  • Latest release: Nov 6, 2023
  • Number of updates: 36
  • Update frequency: every 38.0 days
  • Top authors: suaudeau (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,950 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.96MB] [CPU: ▲6.89ms] Passed 4 tests

Analyzing server-side resources used by Mon Laboratoire
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.50 ▲1.0349.55 ▲9.00
Dashboard /wp-admin4.17 ▲0.8655.53 ▲8.36
Posts /wp-admin/edit.php4.62 ▲1.2653.96 ▲7.54
Add New Post /wp-admin/post-new.php7.05 ▲1.1692.45 ▲5.26
Media Library /wp-admin/upload.php4.03 ▲0.8041.81 ▲6.40
Configuration /wp-admin/admin.php?page=MonLabo_config4.4947.80
Documentation /wp-admin/admin.php?page=MonLabo4.0545.88
Publications cache /wp-admin/admin.php?page=MonLabo_config_cache4.3347.49
Persons and structures /wp-admin/admin.php?page=MonLabo_edit_members_and_groups5.0250.98

Server storage [IO: ▲1.46MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 92 new files
Database: 8 new tables, 15 new options
New tables
wp_MonLabo_units
wp_MonLabo_teams_thematics
wp_MonLabo_persons
wp_MonLabo_thematics
wp_MonLabo_teams
wp_MonLabo_teams_members
wp_MonLabo_mentors
wp_MonLabo_units_directors
New WordPress options
widget_recent-posts
widget_theysaidso_widget
MonLabo_settings_group1
MonLabo_settings_group3
MonLabo_settings_group7
MonLabo_settings_group4
can_compress_scripts
MonLabo_settings_group5
MonLabo_settings_group6
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for Mon Laboratoire
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲8914.30 ▼0.411.69 ▲0.0244.77 ▲3.69
Dashboard /wp-admin2,234 ▲575.56 ▼0.0687.02 ▼2.4867.40 ▲27.21
Posts /wp-admin/edit.php2,154 ▲541.96 ▼0.0334.73 ▼4.0030.56 ▼3.02
Add New Post /wp-admin/post-new.php1,582 ▲5618.37 ▼4.61740.01 ▲47.1053.86 ▲3.65
Media Library /wp-admin/upload.php1,448 ▲484.08 ▼0.1398.09 ▼13.6274.25 ▲30.02
Configuration /wp-admin/admin.php?page=MonLabo_config1,2083.5750.8184.49
Documentation /wp-admin/admin.php?page=MonLabo2,2623.6148.95101.45
Publications cache /wp-admin/admin.php?page=MonLabo_config_cache1,0683.4043.3075.76
Persons and structures /wp-admin/admin.php?page=MonLabo_edit_members_and_groups1,7853.9560.3679.32

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

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
  • 45× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/mon-laboratoire/Lib/class-app.php
    • > /wp-content/plugins/mon-laboratoire/Lib/class-db.php
    • > /wp-content/plugins/mon-laboratoire/Frontend/Api_Pub_Repo/class-api-hal-publications-list.php
    • > /wp-content/plugins/mon-laboratoire/Lib/Person_Or_Structure/class-unit.php
    • > /wp-content/plugins/mon-laboratoire/Frontend/class-contact-webservices.php
    • > /wp-content/plugins/mon-laboratoire/Frontend/Api_Pub_Repo/class-api-hal.php
    • > /wp-content/plugins/mon-laboratoire/Lib/Person_Or_Structure/Groups/class-persons-group.php
    • > /wp-content/plugins/mon-laboratoire/Lib/class-access-data.php
    • > /wp-content/plugins/mon-laboratoire/Lib/Person_Or_Structure/class-person.php
    • > /wp-content/plugins/mon-laboratoire/mon-laboratoire.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: science, lab, user

mon-laboratoire/mon-laboratoire.php 92% from 13 tests

The entry point to "Mon Laboratoire" version 4.6 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("5.6" instead of "7.0.33")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin12,698 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP491,2925,54010,740
PO File1334400873
CSS312669848
JavaScript249145237

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity40.61
▷ Minimum class complexity1.00
▷ Maximum class complexity171.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes41
▷ Abstract classes49.76%
▷ Concrete classes3790.24%
▷ Final classes00.00%
Methods477
▷ Static methods316.50%
▷ Public methods30864.57%
▷ Protected methods163.35%
▷ Private methods15332.08%
Functions27
▷ Named functions2592.59%
▷ Anonymous functions27.41%
Constants20
▷ Global constants15.00%
▷ Class constants1995.00%
▷ Public constants19100.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
27 PNG files occupy 0.53MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Admin/images/fr.png0.53KB0.63KB0.00%
Admin/images/1.png8.44KB0.42KB▼ 94.99%
Admin/images/alumni_list2.png37.52KB37.48KB0.12%
Frontend/images/photo_par_defaut.png4.50KB4.60KB0.00%
Admin/images/teams_list.png27.67KB27.42KB▼ 0.91%