94% mentions-legales

Code Review | WordPress Mentions Légales

WordPress plugin WordPress Mentions Légales scored 94% from 54 tests.

About plugin

  • Plugin page: mentions-legales
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.5
  • WordPress version: 5.8.1
  • First release: Feb 29, 2016
  • Latest release: Apr 18, 2016
  • Number of updates: 35
  • Update frequency: every 1.4 days
  • Top authors: jaramend (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active / 16,676 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼145.91ms] Passed 4 tests

Analyzing server-side resources used by WordPress Mentions Légales
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0131.06 ▲7.31
Dashboard /wp-admin3.09 ▲0.0339.83 ▲4.72
Posts /wp-admin/edit.php3.18 ▲0.0731.05 ▲1.01
Add New Post /wp-admin/post-new.php5.45 ▲0.0269.14 ▼589.69
Media Library /wp-admin/upload.php3.04 ▲0.0322.45 ▲0.33

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 32 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Mentions Légales
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,706 ▲9516.41 ▲0.675.12 ▼3.5176.15 ▼2.70
Dashboard /wp-admin2,970 ▲746.83 ▲0.76119.94 ▼11.70172.16 ▼3.17
Posts /wp-admin/edit.php2,783 ▲403.02 ▼0.3365.94 ▲4.67142.85 ▲6.49
Add New Post /wp-admin/post-new.php2,349 ▼1,38116.39 ▼2.88426.43 ▼25.86161.60 ▼11.03
Media Library /wp-admin/upload.php1,792 ▲406.04 ▲0.50137.79 ▼1.03180.91 ▼0.00

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/mentions-legales/mentions-legales.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/mentions-legales/admin/partials/mentions-legales-admin-form-part.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/mentions-legales/admin/partials/mentions-legales-admin-form-pro.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mentions-legales/includes/class-mentions-legales-widget.php:13

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 Passed 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
4 plugin tags: legales, site internet, mentions legales, mentions

mentions-legales/mentions-legales.php Passed 13 tests

The main PHP file in "WordPress Mentions Légales" ver. 1.2.3 adds more information about the plugin and also serves as the entry point for this plugin
77 characters long description:
Un plugin pour générer automatiquement les mentions légales de votre site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected7,372 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31,5451,6006,699
PHP1280390637
CSS431136

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.80
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods24
▷ Static methods14.17%
▷ Public methods2083.33%
▷ Protected methods00.00%
▷ Private methods416.67%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_highlight-soft_50_dddddd_1x100.png0.27KB0.14KB▼ 48.21%
admin/css/images/ui-bg_highlight-soft_25_1274a8_1x100.png0.34KB0.18KB▼ 46.53%
admin/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
admin/css/images/ui-icons_666666_256x240.png6.82KB4.17KB▼ 38.82%
admin/css/images/ui-icons_ff0084_256x240.png4.44KB4.17KB▼ 6.02%