78% co-marquage-service-public

Code Review | Co-marquage service-public.fr

WordPress plugin Co-marquage service-public.fr scored78%from 54 tests.

About plugin

  • Plugin page: co-marquage-servi...
  • Plugin version: 0.5.71
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 8, 2015
  • Latest release: Apr 24, 2023
  • Number of updates: 70
  • Update frequency: every 41.3 days
  • Top authors: oncleroger (98.57%)Seb emendo (2.86%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active /21,805 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.12MB] [CPU: ▼2.65ms] Passed 4 tests

Analyzing server-side resources used by Co-marquage service-public.fr
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1641.55 ▲1.87
Dashboard /wp-admin3.43 ▲0.0953.28 ▼8.92
Posts /wp-admin/edit.php3.54 ▲0.1951.06 ▲4.54
Add New Post /wp-admin/post-new.php6.01 ▲0.1297.61 ▼5.36
Media Library /wp-admin/upload.php3.35 ▲0.1338.28 ▲1.83
Co-marquage SP /wp-admin/options-general.php?page=comarquage-options3.4137.06

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 159 new files
Database: no new tables, 17 new options
New WordPress options
comarquage_global_pivot_enable
comarquage_update_time
comarquage_global_poweredby
comarquage_global_js_leaflet_enable
comarquage_global_page_part
db_upgraded
comarquage_global_departement
comarquage_debug_enable
comarquage_global_code_insee
comarquage_global_page_pro
...

Browser metrics Passed 4 tests

A check of browser resources used by Co-marquage service-public.fr
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲14114.03 ▼0.336.35 ▲4.4747.66 ▲4.64
Dashboard /wp-admin2,207 ▲194.86 ▼0.02112.84 ▼21.5943.77 ▼4.93
Posts /wp-admin/edit.php2,096 ▲72.02 ▲0.0440.13 ▲4.1336.93 ▼0.36
Add New Post /wp-admin/post-new.php1,536 ▲1721.22 ▼1.97732.07 ▲140.3370.37 ▲21.35
Media Library /wp-admin/upload.php1,392 ▲14.20 ▲0.05105.32 ▲3.3045.82 ▲0.97
Co-marquage SP /wp-admin/options-general.php?page=comarquage-options1,7121.7129.4544.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 17 options in the database
    • comarquage_global_pivot_enable
    • comarquage_update_time
    • comarquage_global_page_part
    • can_compress_scripts
    • comarquage_global_poweredby
    • comarquage_global_page_pro
    • comarquage_global_code_insee
    • widget_recent-posts
    • db_upgraded
    • comarquage_global_departement
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 19× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/sousdossier.php
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/introduction.php
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/ficheliee.php
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/pourensavoirplus.php
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/image.php
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/lienexternecommente.php
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/dc/date.php
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/dossier.php
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/questionreponse.php
    • > /wp-content/plugins/co-marquage-service-public/templates/balises/ousadresser.php
  • 131× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/co-marquage-service-public/templates/balises/ousadresser.php on line 23
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/co-marquage-service-public/templates/balises/questionreponse.php on line 10
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/co-marquage-service-public/templates/balises/anoter.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/co-marquage-service-public/templates/models/questionsReponses.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/co-marquage-service-public/templates/balises/tableau.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/co-marquage-service-public/templates/balises/dc/description.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/co-marquage-service-public/templates/models/accueil-asso.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/co-marquage-service-public/templates/balises/contenuillustre.php on line 3
    • > PHP Notice
      Trying to get property 'NomCommune' of non-object in wp-content/plugins/co-marquage-service-public/templates/balises/organisme.php on line 49
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/co-marquage-service-public/templates/balises/description.php on line 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 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: public, comarquage, guide, service, service public...

co-marquage-service-public/emendo-comarquage.php 85% from 13 tests

The main file in "Co-marquage service-public.fr" v. 0.5.71 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 179 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("co-marquage-service-public.php" instead of "emendo-comarquage.php")

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
Everything looks great! No dangerous files found in this plugin5,056 lines of code in 116 files:
LanguageFilesBlank linesComment linesLines of code
PHP755143282,918
Sass215461,102
CSS35323561
SVG3400391
JavaScript2362284

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity9.25
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes16.25%
Methods61
▷ Static methods2134.43%
▷ Public methods5895.08%
▷ Protected methods00.00%
▷ Private methods34.92%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants964.29%
▷ Class constants535.71%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/leaflet/images/marker-shadow.png0.60KB1.16KB0.00%
vendor/leaflet/images/marker-icon-2x.png2.41KB2.52KB0.00%
assets/images/logo.png2.86KB1.66KB▼ 42.01%
vendor/leaflet/images/marker-icon.png1.43KB1.55KB0.00%
vendor/leaflet/images/layers.png0.68KB1.05KB0.00%