79% custom-post-parents

Code Review | Custom Posts Parents

WordPress plugin Custom Posts Parents scored79%from 54 tests.

About plugin

  • Plugin page: custom-post-parents
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7
  • WordPress version: 6.3.1
  • First release: May 5, 2017
  • Latest release: May 5, 2017
  • Number of updates: 5
  • Update frequency: every 8.8 days
  • Top authors: Codeko (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /622 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼6.90ms] Passed 4 tests

A check of server-side resources used by Custom Posts Parents
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1041.25 ▼15.93
Dashboard /wp-admin3.40 ▲0.1045.17 ▼1.49
Posts /wp-admin/edit.php3.51 ▲0.1647.74 ▼2.61
Add New Post /wp-admin/post-new.php5.98 ▲0.0996.51 ▼7.55
Media Library /wp-admin/upload.php3.32 ▲0.0939.05 ▲5.20
Custom Post Parents /wp-admin/options-general.php?page=custom-post-parents-admin-menu3.2934.85

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Posts Parents
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▲0.101.83 ▼0.9743.83 ▼19.97
Dashboard /wp-admin2,210 ▲225.83 ▼0.07103.48 ▼4.5145.24 ▲1.11
Posts /wp-admin/edit.php2,096 ▲102.04 ▲0.0441.00 ▲5.4335.74 ▼6.48
Add New Post /wp-admin/post-new.php1,539 ▼418.47 ▼0.14628.80 ▼35.3784.70 ▲27.45
Media Library /wp-admin/upload.php1,386 ▼24.18 ▲0.0197.23 ▼5.4742.09 ▼0.25
Custom Post Parents /wp-admin/options-general.php?page=custom-post-parents-admin-menu8202.2126.8926.44

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/custom-post-parents/custom-post-parents/templates/admin/admin-field-post_types.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: available_schemas in wp-content/plugins/custom-post-parents/templates/admin/admin-field-post_types.php on line 2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/custom-post-parents/templates/admin/admin-field-post_types.php on line 2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/custom-post-parents/custom-post-parents/templates/admin/admin-field-post_types.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/custom-post-parents/custom-post-parents/custom-post-parents.php:12
    • > PHP Notice
      Undefined variable: available_schemas in wp-content/plugins/custom-post-parents/custom-post-parents/templates/admin/admin-field-post_types.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-parents/custom-post-parents/templates/admin/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-parents/custom-post-parents/templates/admin/admin-section-intro.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-parents/templates/admin/admin-section-intro.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/custom-post-parents/custom-post-parents.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-parents/templates/admin/admin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: post type, hierarchy, parent

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

The principal PHP file in "Custom Posts Parents" v. 0.1 is loaded by WordPress automatically on each request
41 characters long description:
Allow to set any post type as post parent

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected6,021 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PO File12,2933,2255,106
PHP1614790764
JavaScript291134
Markdown116017

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.38
Average class complexity12.38
▷ Minimum class complexity6.00
▷ Maximum class complexity28.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods51
▷ Static methods815.69%
▷ Public methods4588.24%
▷ Protected methods00.00%
▷ Private methods611.76%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected