83% wuxt-headless-wp-api-extensions

Code Review | WUXT Headless WordPress API Extensions

WordPress plugin WUXT Headless WordPress API Extensions scored83%from 54 tests.

About plugin

  • Plugin page: wuxt-headless-wp-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.2.2
  • WordPress version: 6.3.1
  • First release: May 20, 2019
  • Latest release: May 20, 2019
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: danielauener (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /1,719 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.69MB] [CPU: ▼20.36ms] Passed 4 tests

Server-side resources used by WUXT Headless WordPress API Extensions
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.66 ▲0.56
Dashboard /wp-admin3.32 ▼0.0345.89 ▼15.37
Posts /wp-admin/edit.php3.37 ▲0.0146.97 ▲0.90
Add New Post /wp-admin/post-new.php3.13 ▼2.7635.26 ▼67.10
Media Library /wp-admin/upload.php3.24 ▲0.0135.20 ▲0.46

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WUXT Headless WordPress API Extensions
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.57 ▼0.711.73 ▲0.2337.67 ▼4.49
Dashboard /wp-admin2,206 ▲205.85 ▲0.94107.75 ▼13.8138.75 ▼3.42
Posts /wp-admin/edit.php2,089 ▼02.14 ▲0.1139.09 ▼3.4334.06 ▼3.50
Add New Post /wp-admin/post-new.php1,514 ▼2817.60 ▼0.87656.76 ▲0.3463.47 ▲8.27
Media Library /wp-admin/upload.php1,388 ▼04.16 ▼0.0298.01 ▼4.5540.41 ▼3.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • 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)
Good news, no errors were detected

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
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wuxt-headless-wp-api-extensions/extensions/relation.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wuxt-headless-wp-api-extensions/extensions/geo.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wuxt-headless-wp-api-extensions/extensions/menu.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wuxt-headless-wp-api-extensions/extensions/front-page.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wuxt-headless-wp-api-extensions/extensions/slug.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wuxt-headless-wp-api-extensions/extensions/meta.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wuxt-headless-wp-api-extensions/extensions/front-page.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wuxt-headless-wp-api-extensions === )
  • Screenshots: Please add images for these screenshots: #1 (Posts request extended with meta-fields from ACF and Yoast WordPress SEO), #2 (New menu endpoint), #3 (New front-page endpoint)
You can take inspiration from this readme.txt

wuxt-headless-wp-api-extensions/wuxt-headless-wp-api-extensions.php 92% from 13 tests

The main PHP script in "WUXT Headless WordPress API Extensions" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 213 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin334 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP813387334

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity41.00
▷ Minimum class complexity41.00
▷ Maximum class complexity41.00
Average method complexity6.71
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods342.86%
▷ Public methods571.43%
▷ Protected methods228.57%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.24MB with 0.17MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png95.98KB27.59KB▼ 71.26%
screenshot-3.png56.51KB17.08KB▼ 69.77%
screenshot-1.png90.82KB23.32KB▼ 74.32%