84% subpages-in-context

Code Review | Subpages in Context

WordPress plugin Subpages in Context scored 84% from 54 tests.

About plugin

  • Plugin page: subpages-in-context
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4.1
  • WordPress version: 5.9.2
  • First release: Jul 5, 2012
  • Latest release: Jul 12, 2012
  • Number of updates: 12
  • Update frequency: every 0.6 days
  • Top authors: brendaegeland (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active / 4,046 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼300.02ms] Passed 4 tests

Server-side resources used by Subpages in Context
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.4357.52 ▲36.91
Dashboard /wp-admin3.44 ▲0.0333.67 ▼8.54
Posts /wp-admin/edit.php3.67 ▲0.0336.39 ▼3.64
Add New Post /wp-admin/post-new.php6.91 ▼0.0697.09 ▼1,186.37
Media Library /wp-admin/upload.php3.32 ▲0.0324.70 ▼1.53

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 1 new option
New WordPress options
widget_subpages-in-context

Browser metrics Passed 4 tests

This is an overview of browser requirements for Subpages in Context
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,781 ▲3715.93 ▲0.196.17 ▼4.122.58 ▲0.14
Dashboard /wp-admin2,878 ▲206.10 ▼0.17118.56 ▼26.59185.63 ▲21.17
Posts /wp-admin/edit.php2,657 ▼373.24 ▲0.0065.18 ▲1.10137.60 ▼10.21
Add New Post /wp-admin/post-new.php1,668 ▼4319.00 ▼2.46429.97 ▼4.82199.81 ▲14.68
Media Library /wp-admin/upload.php1,698 ▲35.54 ▲0.01135.36 ▼19.75234.11 ▲10.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_subpages-in-context

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× 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/subpages-in-context/subpages-in-context.php:64

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === subpages-in-context === )
  • Screenshots: Add an image for screenshot #1 (The Subpages In Context Widget)
The official readme.txt is a good inspiration

subpages-in-context/subpages-in-context.php Passed 13 tests

"Subpages in Context" version 0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
92 characters long description:
Lists pages and subpages for a given page, or the top ancestor of the current page (default)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin152 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15795152

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.02MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png15.56KB14.68KB▼ 5.69%