83% logo-des-partis-politiques-francais

Code Review | Logos des partis politiques francais

WordPress plugin Logos des partis politiques francais scored 83% from 54 tests.

About plugin

  • Plugin page: logo-des-partis-p...
  • Plugin version: 1.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.2.3
  • WordPress version: 5.8.1
  • First release: Jun 14, 2013
  • Latest release: Sep 24, 2019
  • Number of updates: 30
  • Update frequency: every 76.5 days
  • Top authors: bastho (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 890 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼647.63ms] Passed 4 tests

This is a short check of server-side resources used by Logos des partis politiques francais
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0132.83 ▼2.52
Dashboard /wp-admin3.07 ▲0.0243.72 ▲1.23
Posts /wp-admin/edit.php3.12 ▲0.0143.43 ▼7.50
Add New Post /wp-admin/post-new.php5.43 ▼0.0090.13 ▼2,581.72
Media Library /wp-admin/upload.php3.01 ▲0.0133.59 ▲3.53

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 1 new option
New WordPress options
widget_logosppf_widget

Browser metrics Passed 4 tests

Checking browser requirements for Logos des partis politiques francais
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲4216.29 ▲0.839.58 ▼2.5749.45 ▼0.13
Dashboard /wp-admin2,973 ▲365.92 ▼0.20137.96 ▼6.80107.16 ▼4.11
Posts /wp-admin/edit.php2,739 ▲32.70 ▼0.0262.60 ▼5.5788.17 ▲2.54
Add New Post /wp-admin/post-new.php1,876 ▲20419.16 ▲0.38383.83 ▲17.98103.05 ▼2.66
Media Library /wp-admin/upload.php1,807 ▼35.01 ▼0.03148.56 ▲8.47125.43 ▲12.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_logosppf_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/logo-des-partis-politiques-francais/widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/logo-des-partis-politiques-francais/logos-ppf.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
1 plugin tags: widget

logo-des-partis-politiques-francais/logos-ppf.php 85% from 13 tests

The main PHP file in "Logos des partis politiques francais" ver. 1.6.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • 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
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("logo-des-partis-politiques-francais.php" instead of "logos-ppf.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
Good job! No executable or dangerous file extensions detected453 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP23218356
PO File1111141
CSS14039
JavaScript10117

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity51.00
▷ Minimum class complexity14.00
▷ Maximum class complexity88.00
Average method complexity8.14
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods964.29%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
14 PNG files occupy 0.53MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
logos/EM_en-marche.fr.png4.03KB3.74KB▼ 7.36%
logos/UDB_udb-bzh.net.png34.80KB26.04KB▼ 25.18%
logos/LR_republicains.fr.png34.45KB13.28KB▼ 61.45%
logos/EELV-2_eelv.fr.png58.12KB20.23KB▼ 65.20%
logos/UDI_parti-udi.fr.png5.10KB2.62KB▼ 48.65%