83% cc-child-pages

Code Review | CC Child Pages

WordPress plugin CC Child Pages scored83%from 54 tests.

About plugin

  • Plugin page: cc-child-pages
  • Plugin version: 1.45
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 20, 2014
  • Latest release: Mar 15, 2023
  • Number of updates: 139
  • Update frequency: every 22.1 days
  • Top authors: caterhamcomputing (100%)

Code review

54 tests

User reviews

44 reviews

Install metrics

10,000+ active /123,260 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 gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.77ms] Passed 4 tests

Server-side resources used by CC Child Pages
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0444.46 ▲0.47
Dashboard /wp-admin3.33 ▲0.0353.42 ▼8.96
Posts /wp-admin/edit.php3.39 ▲0.0350.61 ▼1.95
Add New Post /wp-admin/post-new.php5.91 ▲0.0386.76 ▼18.95
Media Library /wp-admin/upload.php3.25 ▲0.0335.88 ▼1.21
CC Child Pages /wp-admin/options-general.php?page=cc-child-pages3.2230.94

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_ccchildpages_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
cc_child_pages
theysaidso_admin_options

Browser metrics Passed 4 tests

CC Child Pages: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.31 ▼0.072.04 ▲0.1042.60 ▼1.95
Dashboard /wp-admin2,202 ▲285.52 ▼0.1589.41 ▲1.6439.54 ▼4.56
Posts /wp-admin/edit.php2,101 ▲12.06 ▲0.0535.61 ▼1.4836.78 ▲2.38
Add New Post /wp-admin/post-new.php1,557 ▲2622.71 ▼0.23631.45 ▼47.0960.18 ▼0.21
Media Library /wp-admin/upload.php1,404 ▲44.25 ▲0.1199.32 ▼14.5244.67 ▼3.66
CC Child Pages /wp-admin/options-general.php?page=cc-child-pages8002.0425.2528.57

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • can_compress_scripts
    • cc_child_pages
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_ccchildpages_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cc-child-pages/index.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cc-child-pages/includes/ccchildpages_widget.php:6

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: There are too many tags (21 tag instead of maximum 10)
Please take inspiration from this readme.txt

cc-child-pages/index.php 85% from 13 tests

"CC Child Pages" version 1.45's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Requires PHP: The required version number did not match the one declared in readme.txt ("5.6" instead of "5.4")
  • Main file name: The principal plugin file should be the same as the plugin slug ("cc-child-pages.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,794 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP32881871,075
CSS36292455
PO File14751138
JavaScript1725126

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 135)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity106.50
▷ Minimum class complexity39.00
▷ Maximum class complexity174.00
Average method complexity7.81
▷ Minimum method complexity1.00
▷ Maximum method complexity135.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods31
▷ Static methods2787.10%
▷ Public methods2993.55%
▷ Protected methods00.00%
▷ Private methods26.45%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/js/childpages.png0.44KB0.26KB▼ 39.46%