78% childpages

Code Review | Child pages

WordPress plugin Child pages scored78%from 54 tests.

About plugin

  • Plugin page: childpages
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 6.3.1
  • First release: May 29, 2015
  • Latest release: Jun 6, 2015
  • Number of updates: 12
  • Update frequency: every 0.7 days
  • Top authors: janhenckens (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,771 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.72ms] Passed 4 tests

Server-side resources used by Child pages
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0839.19 ▼2.68
Dashboard /wp-admin3.37 ▲0.0745.10 ▼3.32
Posts /wp-admin/edit.php3.48 ▲0.1348.53 ▲2.25
Add New Post /wp-admin/post-new.php5.97 ▲0.0885.71 ▼4.64
Media Library /wp-admin/upload.php3.29 ▲0.0635.11 ▼0.23

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

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

Browser metrics Passed 4 tests

Child pages: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲15213.57 ▼0.814.59 ▲2.6741.15 ▼5.09
Dashboard /wp-admin2,213 ▲224.87 ▼0.00110.54 ▲6.2138.11 ▼7.80
Posts /wp-admin/edit.php2,090 ▲12.06 ▲0.0740.16 ▼0.1236.16 ▼0.25
Add New Post /wp-admin/post-new.php1,521 ▲223.22 ▼0.12634.19 ▼61.2755.58 ▼5.18
Media Library /wp-admin/upload.php1,395 ▲164.19 ▲0.0098.16 ▼5.3143.12 ▼1.42

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/childpages/public/partials/wp-childpages-public-display.php
    • > /wp-content/plugins/childpages/admin/partials/wp-childpages-admin-display.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/childpages/includes/class-wp-childpages-widget.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === childpages === )
You can take inspiration from this readme.txt

childpages/wp-childpages.php 85% from 13 tests

The main PHP script in "Child pages" version 1.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("childpages.php" instead of "wp-childpages.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
No dangerous file extensions were detected253 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13132572247
JavaScript24546
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity1.75
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.21
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions4
▷ Named functions4100.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
There are no PNG files in this plugin