78% wp-rest-headless

Code Review | WP Headless CMS Framework

WordPress plugin WP Headless CMS Framework scored78%from 54 tests.

About plugin

  • Plugin page: wp-rest-headless
  • Plugin version: 1.15
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.4
  • WordPress version: 6.3.1
  • First release: Jan 31, 2019
  • Latest release: Apr 6, 2020
  • Number of updates: 11
  • Update frequency: every 39.3 days
  • Top authors: ben.moody (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /2,889 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.09MB] [CPU: ▼10.58ms] Passed 4 tests

This is a short check of server-side resources used by WP Headless CMS Framework
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.10 ▼0.3622.44 ▼17.21
Dashboard /wp-admin3.59 ▲0.2846.22 ▼0.30
Posts /wp-admin/edit.php3.64 ▲0.2845.68 ▼2.03
Add New Post /wp-admin/post-new.php6.10 ▲0.2281.14 ▼22.78
Media Library /wp-admin/upload.php3.45 ▲0.2236.22 ▲3.66

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Headless CMS Framework
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,435 ▼31113.10 ▼1.490.49 ▼1.570.10 ▼43.36
Dashboard /wp-admin2,225 ▲404.89 ▼0.9799.96 ▼0.0340.32 ▼3.03
Posts /wp-admin/edit.php2,105 ▲132.06 ▲0.0536.14 ▼5.6833.03 ▼0.76
Add New Post /wp-admin/post-new.php1,546 ▲2723.08 ▼0.06659.44 ▲14.4376.16 ▲23.71
Media Library /wp-admin/upload.php1,404 ▲164.21 ▼0.0395.78 ▼12.1046.80 ▲0.07

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-rest-headless/template-parts/settings_main-help.php
    • > /wp-content/plugins/wp-rest-headless/template-parts/quick_start-help.php
  • 23× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-rest-headless/includes/security/class-wp-headless-disable-front-end.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Headless_Rest_Api_Cleanup' not found in wp-content/plugins/wp-rest-headless/template-parts/rest_cleanup-help.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-rest-headless/includes/gutenberg/class-wp-headless-rest-gutenberg-blocks.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Headless_Settings' not found in wp-content/plugins/wp-rest-headless/includes/settings/class-wp-headless-settings-disable-frontend.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Headless_Jwt_Rest_Api' not found in wp-content/plugins/wp-rest-headless/template-parts/rest_jwt-help.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-rest-headless/includes/class-wp-headless-core.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-rest-headless/includes/jwt-auth/class-wp-headless-jwt-users.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Headless_Rest_Api_Cors' not found in wp-content/plugins/wp-rest-headless/template-parts/request_headers-help.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-rest-headless/includes/security/class-wp-headless-rest-api-nonce.php:52
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Headless_Settings' not found in wp-content/plugins/wp-rest-headless/includes/settings/class-wp-headless-settings-rest-gutenberg.php:10

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

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: wordpress as a headless cms, rest, headless, headless cms, cms...

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

The main PHP script in "WP Headless CMS Framework" version 1.15 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 261 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected2,387 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP388091,7832,135
Markdown1320168
JSON30084

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity10.25
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods108
▷ Static methods3128.70%
▷ Public methods9285.19%
▷ Protected methods00.00%
▷ Private methods1614.81%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin