78% custom-post-type-parents

Code Review | Custom Post Type Parents

WordPress plugin Custom Post Type Parents scored78%from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3.1
  • WordPress version: 6.3.1
  • First release: Feb 3, 2015
  • Latest release: Oct 9, 2023
  • Number of updates: 29
  • Update frequency: every 109.4 days
  • Top authors: McGuive7 (55.17%)aaronbmm (27.59%)aebs90 (17.24%)MIGHTYminnow (6.9%)jgonzo127 (6.9%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /10,590 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
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.75ms] Passed 4 tests

Server-side resources used by Custom Post Type Parents
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1046.47 ▲4.77
Dashboard /wp-admin3.41 ▲0.1152.83 ▼2.36
Posts /wp-admin/edit.php3.52 ▲0.1748.17 ▼3.31
Add New Post /wp-admin/post-new.php5.99 ▲0.1089.42 ▼9.69
Media Library /wp-admin/upload.php3.33 ▲0.1037.98 ▼3.63
Custom Post Type Parents /wp-admin/options-general.php?page=custom-post-type-parents3.2732.65

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_simple-section-nav

Browser metrics Passed 4 tests

A check of browser resources used by Custom Post Type Parents
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.37 ▲0.152.08 ▲0.2844.58 ▲5.59
Dashboard /wp-admin2,196 ▲225.59 ▲0.0796.30 ▼0.4441.86 ▲0.33
Posts /wp-admin/edit.php2,104 ▲42.01 ▼0.0335.70 ▼3.2034.22 ▼2.91
Add New Post /wp-admin/post-new.php1,529 ▲123.29 ▲0.04665.78 ▲1.1154.89 ▲1.03
Media Library /wp-admin/upload.php1,407 ▲44.21 ▼0.0797.03 ▲1.3641.97 ▼0.30
Custom Post Type Parents /wp-admin/options-general.php?page=custom-post-type-parents8572.0324.3628.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_simple-section-nav
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=custom-post-type-parents
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=custom-post-type-parents
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-parents/includes/custom-simple-section-nav.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-post-type-parents/custom-post-type-parents.php:27

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, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes: Please take inspiration from this readme.txt

custom-post-type-parents/custom-post-type-parents.php Passed 13 tests

The main file in "Custom Post Type Parents" v. 1.1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
88 characters long description:
Set a "parent page" for custom post types that is indicated in menus and lists of pages.

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
Success! There were no dangerous files found in this plugin350 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP2103241337
Markdown55010
JavaScript23103
CSS1070

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity25.50
▷ Minimum class complexity17.00
▷ Maximum class complexity34.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods14.76%
▷ Public methods1990.48%
▷ Protected methods00.00%
▷ Private methods29.52%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin