94% better-footnotes

Code Review | Better Footnotes

WordPress plugin Better Footnotes scored 94% from 54 tests.

About plugin

  • Plugin page: better-footnotes
  • Plugin version: 1.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 5.8.1
  • First release: Jul 24, 2019
  • Latest release: Oct 22, 2020
  • Number of updates: 11
  • Update frequency: every 41.6 days
  • Top authors: alex-ye (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active / 1,534 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
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Better Footnotes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1637.52 ▲11.18
Dashboard /wp-admin3.09 ▲0.0347.51 ▲0.10
Posts /wp-admin/edit.php3.14 ▲0.0344.47 ▲0.71
Add New Post /wp-admin/post-new.php5.45 ▲0.0194.37 ▼559.06
Media Library /wp-admin/upload.php3.03 ▲0.0332.57 ▲1.52
Better Footnotes /wp-admin/options-general.php?page=better_footnotes3.0028.74

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Better Footnotes: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲11215.78 ▼0.198.03 ▼3.4548.46 ▼10.01
Dashboard /wp-admin2,975 ▲445.89 ▼0.07134.18 ▲1.5299.62 ▼13.55
Posts /wp-admin/edit.php2,744 ▲82.69 ▲0.0066.78 ▲0.9197.62 ▲10.71
Add New Post /wp-admin/post-new.php1,501 ▼36917.18 ▼2.25344.24 ▼20.28104.48 ▼7.80
Media Library /wp-admin/upload.php1,815 ▲55.05 ▲0.02146.11 ▲3.75121.54 ▲4.05
Better Footnotes /wp-admin/options-general.php?page=better_footnotes1,1282.0953.5686.00

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

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 | 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 items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/better-footnotes/main.php:36

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 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3 in better-footnotes/assets to your readme.txt
The official readme.txt is a good inspiration

better-footnotes/main.php 92% from 13 tests

The main file in "Better Footnotes" v. 1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("better-footnotes.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected927 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP12151385687
JavaScript3200144
PO File1161659
JSON20024
CSS20013

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.83
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods49
▷ Static methods816.33%
▷ Public methods4693.88%
▷ Protected methods00.00%
▷ Private methods36.12%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ Global constants4100.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
PNG images were not found in this plugin