78% soumettre-fr

Code Review | Soumettre.fr

WordPress plugin Soumettre.fr scored78%from 54 tests.

About plugin

  • Plugin page: soumettre-fr
  • Plugin version: 2.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Nov 9, 2020
  • Latest release: Jul 26, 2022
  • Number of updates: 17
  • Update frequency: every 36.9 days
  • Top authors: soumettre (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

8,000+ active /13,332 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.51MB] [CPU: ▲3.61ms] Passed 4 tests

An overview of server-side resources used by Soumettre.fr
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5145.53 ▲4.95
Dashboard /wp-admin3.82 ▲0.5159.29 ▲8.26
Posts /wp-admin/edit.php3.87 ▲0.5153.91 ▲5.63
Add New Post /wp-admin/post-new.php6.43 ▲0.5489.55 ▼4.41
Media Library /wp-admin/upload.php3.74 ▲0.5148.71 ▲11.75

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Soumettre.fr
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.41 ▲0.061.78 ▲0.0845.17 ▲4.28
Dashboard /wp-admin2,200 ▲265.56 ▼0.0289.07 ▼9.1879.20 ▲38.23
Posts /wp-admin/edit.php2,120 ▲201.99 ▼0.0134.64 ▼3.3833.16 ▼3.51
Add New Post /wp-admin/post-new.php1,695 ▲16922.00 ▼1.62680.55 ▲75.8261.86 ▲9.96
Media Library /wp-admin/upload.php1,414 ▲144.20 ▲0.00102.15 ▼21.5166.74 ▲18.83

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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 fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/soumettre-fr/public/partials/soumettre-public-display.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/image.php' (include_path='.:/usr/share/php') in wp-content/plugins/soumettre-fr/includes/class-soumettre-post.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/soumettre-fr/admin/partials/soumettre-admin-display.php:17
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/soumettre-fr/includes/class-soumettre-post.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/soumettre-fr/public/rest/class-soumettre-rest-route.php:8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/soumettre-fr/includes/class-soumettre-post.php on line 8

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

Often overlooked, readme.txt is one of the most important files in your plugin
No tags were found

soumettre-fr/soumettrefr.php 85% from 13 tests

This is the main PHP file of "Soumettre.fr" version 2.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("soumettre-fr.php" instead of "soumettrefr.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin3,416 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP217259302,993
CSS1504230
PO File17082193

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity29.00
▷ Minimum class complexity1.00
▷ Maximum class complexity249.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods178
▷ Static methods42.25%
▷ Public methods14682.02%
▷ Protected methods2312.92%
▷ Private methods95.06%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants26
▷ Global constants26100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/soumettre-icon.png2.10KB0.34KB▼ 83.92%
images/logo-soumettre-transparent.png27.41KB11.82KB▼ 56.89%
images/soumettre-favicon.png1.35KB1.04KB▼ 22.55%
images/logo-soumettre-450x129.png16.48KB7.05KB▼ 57.23%