84% gnu-terry-pratchett

Code Review | GNU Terry Pratchett

WordPress plugin GNU Terry Pratchett scored 84% from 54 tests.

About plugin

  • Plugin page: gnu-terry-pratchett
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Mar 15, 2015
  • Latest release: Jul 22, 2023
  • Number of updates: 50
  • Update frequency: every 61.0 days
  • Top authors: modernnerd (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active / 13,393 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.03MB] [CPU: ▼1.18ms] Passed 4 tests

An overview of server-side resources used by GNU Terry Pratchett
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0247.62 ▲8.32
Dashboard /wp-admin3.33 ▲0.0348.57 ▼1.73
Posts /wp-admin/edit.php3.38 ▲0.0345.55 ▲2.44
Add New Post /wp-admin/post-new.php5.91 ▲0.0383.26 ▼9.81
Media Library /wp-admin/upload.php3.25 ▲0.0336.70 ▲4.37
GNU Terry Pratchett /wp-admin/options-general.php?page=gnu-terry-pratchett3.2230.14

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for GNU Terry Pratchett
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲7014.80 ▲0.521.98 ▲0.2642.72 ▲1.67
Dashboard /wp-admin2,210 ▲195.86 ▲0.92107.38 ▲2.6241.99 ▲0.87
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0333.89 ▼0.1433.85 ▼0.93
Add New Post /wp-admin/post-new.php1,517 ▼217.45 ▼5.83669.83 ▼38.2254.24 ▼1.33
Media Library /wp-admin/upload.php1,392 ▲74.23 ▲0.0094.06 ▼8.3644.35 ▼1.42
GNU Terry Pratchett /wp-admin/options-general.php?page=gnu-terry-pratchett7802.0325.3124.68

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

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 | 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 server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/gnu-terry-pratchett/options.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === gnu-terry-pratchett === )
You can take inspiration from this readme.txt

gnu-terry-pratchett/gnu-terry-pratchett.php Passed 13 tests

"GNU Terry Pratchett" version 0.4.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
90 characters long description:
Adds an X-Clacks-Overhead HTTP header set to 'GNU Terry Pratchett' on all non-admin pages.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin88 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2163088

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin