100% headless-wp

Code Review | Headless WordPress

WordPress plugin Headless WordPress scored 100% from 54 tests.

About plugin

  • Plugin page: headless-wp
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 5.9.2
  • First release: Apr 20, 2021
  • Latest release: Feb 2, 2022
  • Number of updates: 5
  • Update frequency: every 57.8 days
  • Top authors: cyberlord92 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 519 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼292.09ms] Passed 4 tests

An overview of server-side resources used by Headless WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2486.89 ▲26.77
Dashboard /wp-admin3.59 ▲0.1836.48 ▲2.28
Posts /wp-admin/edit.php3.81 ▲0.1741.89 ▲3.14
Add New Post /wp-admin/post-new.php7.06 ▲0.0894.74 ▼1,181.32
Media Library /wp-admin/upload.php3.47 ▲0.1732.09 ▲7.56

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 30 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Headless WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,787 ▲3315.52 ▼0.536.84 ▲0.152.33 ▼0.38
Dashboard /wp-admin2,917 ▲496.34 ▲0.22128.98 ▼54.32197.00 ▲25.83
Posts /wp-admin/edit.php2,694 ▲93.25 ▲0.02107.85 ▲38.83155.94 ▼58.80
Add New Post /wp-admin/post-new.php1,677 ▼1320.43 ▼0.46449.21 ▼11.97233.73 ▲22.01
Media Library /wp-admin/upload.php1,718 ▲235.72 ▲0.20165.15 ▼1.13286.59 ▲51.99

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: disable frontend, headless, headless cms, headless wp, rest api

headless-wp/headless-site.php 92% from 13 tests

The principal PHP file in "Headless WordPress" v. 1.0.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("headless-wp.php" instead of "headless-site.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
There were no executable files found in this plugin15,140 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
CSS51,236259,488
JavaScript61,1426404,423
PHP10310241,229

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity16.60
▷ Minimum class complexity1.00
▷ Maximum class complexity98.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods51
▷ Static methods1937.25%
▷ Public methods4894.12%
▷ Protected methods00.00%
▷ Private methods35.88%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/logo.png2.84KB1.59KB▼ 44.03%
admin/images/miniorange.png0.44KB0.35KB▼ 18.61%
admin/images/flags16.png61.80KB19.90KB▼ 67.79%