84% ffc-football-co2-calculator

Code Review | FFC Football CO2 Calculator Plugin

WordPress plugin FFC Football CO2 Calculator Plugin scored84%from 54 tests.

About plugin

  • Plugin page: ffc-football-co2-...
  • Plugin version: 2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Mar 25, 2022
  • Latest release: Nov 8, 2023
  • Number of updates: 59
  • Update frequency: every 10.1 days
  • Top authors: olympia07 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,869 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼14.78ms] Passed 4 tests

An overview of server-side resources used by FFC Football CO2 Calculator Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.98 ▲1.12
Dashboard /wp-admin3.31 ▼0.0345.62 ▼18.48
Posts /wp-admin/edit.php3.36 ▲0.0143.08 ▼5.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.66 ▼34.48
Media Library /wp-admin/upload.php3.24 ▲0.0133.33 ▼0.80

Server storage [IO: ▲1.68MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by FFC Football CO2 Calculator Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲13613.43 ▼0.899.42 ▲7.8041.21 ▼5.43
Dashboard /wp-admin2,192 ▲215.63 ▲0.1195.17 ▲7.5142.57 ▼2.08
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0735.77 ▼0.2332.69 ▼2.15
Add New Post /wp-admin/post-new.php1,535 ▲625.00 ▲1.97641.16 ▲48.4771.68 ▲19.73
Media Library /wp-admin/upload.php1,397 ▼34.31 ▲0.13100.21 ▲4.4840.90 ▼0.34

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please take a closer look at the following
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/ffc-football-co2-calculator/2.5/ffc-football-co2-calculator.php
    • > /wp-content/plugins/ffc-football-co2-calculator/shortcodes/co2calculator.php
    • > /wp-content/plugins/ffc-football-co2-calculator/init/plugin.php
    • > /wp-content/plugins/ffc-football-co2-calculator/2.5/init/plugin.php
    • > /wp-content/plugins/ffc-football-co2-calculator/ffc-football-co2-calculator.php
    • > /wp-content/plugins/ffc-football-co2-calculator/2.5/shortcodes/co2calculator.php

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed: Please take inspiration from this readme.txt

ffc-football-co2-calculator/ffc-football-co2-calculator.php Passed 13 tests

Analyzing the main PHP file in "FFC Football CO2 Calculator Plugin" version 2.7
113 characters long description:
FFC Football CO2 Calculator is a plugin for calculating CO2-emissions in terms of football related CO2 emissions.

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
There were no executable files found in this plugin320 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP568102198
JavaScript14578
PO File1141444

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods50
▷ Static methods00.00%
▷ Public methods2448.00%
▷ Protected methods00.00%
▷ Private methods2652.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 1.63MB with 1.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
init/images/tree.png111.04KB38.84KB▼ 65.02%
2.5/init/images/Sports-4-Future-Logo.png56.18KB17.18KB▼ 69.42%
init/images/pftp-projects/YucatanRestoration.png294.72KB108.54KB▼ 63.17%
2.5/init/images/pftp-projects/OneStudentOneTree.png374.52KB107.28KB▼ 71.35%
init/images/pftp-projects/OneStudentOneTree.png374.52KB107.28KB▼ 71.35%