10% decoupled-preview

Code Review | Decoupled Preview

WordPress plugin Decoupled Preview scored 10% from 54 tests.

About plugin

  • Plugin page: decoupled-preview
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 12, 2023
  • Latest release: Aug 30, 2023
  • Number of updates: 6
  • Update frequency: every 23.3 days
  • Top authors: getpantheon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 4,051 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'Pantheon\DecoupledPreview\set_default_options' not found or invalid function name

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

A check of server-side resources used by Decoupled Preview
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1349.99 ▼4.62
Dashboard /wp-admin3.45 ▲0.1564.72 ▼0.05
Posts /wp-admin/edit.php3.57 ▲0.2165.71 ▲7.31
Add New Post /wp-admin/post-new.php6.04 ▲0.15123.73 ▲9.38
Media Library /wp-admin/upload.php3.38 ▲0.1543.52 ▼10.77
Preview Sites /wp-admin/options-general.php?page=preview_sites3.3742.06
Preview Sites /wp-admin/admin.php?page=delete_preview_site3.3239.25
/wp-admin/options-general.php?page=add_preview_sites3.3237.65

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Decoupled Preview
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲914.81 ▲1.161.90 ▼0.0147.11 ▼4.22
Dashboard /wp-admin2,215 ▲324.83 ▼1.08116.56 ▼3.7043.38 ▼0.24
Posts /wp-admin/edit.php2,101 ▲122.06 ▲0.0239.94 ▼3.0934.68 ▼8.10
Add New Post /wp-admin/post-new.php1,542 ▲921.07 ▼1.95744.18 ▲64.5861.25 ▲11.84
Media Library /wp-admin/upload.php1,397 ▲124.19 ▲0.05123.71 ▼3.4354.99 ▲1.55
Preview Sites /wp-admin/options-general.php?page=preview_sites9712.0528.1334.00
Preview Sites /wp-admin/admin.php?page=delete_preview_site6661.537.2130.88
/wp-admin/options-general.php?page=add_preview_sites6671.1410.6325.20

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'Pantheon\DecoupledPreview\delete_default_options' not found or invalid function name
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Pantheon\\DecoupledPreview\\wp_verify_nonce() in wp-content/plugins/decoupled-preview/templates/preview-template.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/decoupled-preview/src/class-list-table.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: preview, decoupled, nextjs, headless

decoupled-preview/wp-decoupled-preview.php 77% from 13 tests

The main PHP file in "Decoupled Preview" ver. 1.0.5 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("decoupled-preview.php" instead of "wp-decoupled-preview.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,137 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4103325679
Markdown1580281
Bourne Shell12111119
JavaScript121633
CSS14125

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.49
Average class complexity50.00
▷ Minimum class complexity17.00
▷ Maximum class complexity83.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods3096.77%
▷ Protected methods00.00%
▷ Private methods13.23%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected