78% wp-custom-post-type

Code Review | WP Custom Post Type

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

About plugin

  • Plugin page: wp-custom-post-type
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0
  • WordPress version: 6.3.1
  • First release: Jul 20, 2018
  • Latest release: Jan 2, 2019
  • Number of updates: 10
  • Update frequency: every 17.9 days
  • Top authors: codepixelzmedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /853 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.42MB] [CPU: ▲0.04ms] Passed 4 tests

Analyzing server-side resources used by WP Custom Post Type
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4348.63 ▲9.79
Dashboard /wp-admin3.72 ▲0.4247.70 ▼1.86
Posts /wp-admin/edit.php3.83 ▲0.4750.18 ▲3.44
Add New Post /wp-admin/post-new.php6.33 ▲0.4583.77 ▼9.25
Media Library /wp-admin/upload.php3.64 ▲0.4138.86 ▲7.84
All Testimonials /wp-admin/edit.php?post_type=testimonial3.6838.96
Portfolio categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio3.6335.81
Add New Portfolio /wp-admin/post-new.php?post_type=portfolio3.8548.75
Add New Testimonial /wp-admin/post-new.php?post_type=testimonial3.7650.93
All Sliders /wp-admin/edit.php?post_type=slider3.6838.52
Add New Callout /wp-admin/post-new.php?post_type=callout3.7751.69
All Callouts /wp-admin/edit.php?post_type=callout3.6836.26
Add New Slider /wp-admin/post-new.php?post_type=slider3.7652.78
All Clients /wp-admin/edit.php?post_type=client3.6834.34
Add New Client /wp-admin/post-new.php?post_type=client3.7748.83

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WP Custom Post Type
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,124 ▲38914.10 ▼0.296.11 ▲4.3948.59 ▲11.90
Dashboard /wp-admin2,393 ▲2215.81 ▲0.7798.59 ▼29.1439.15 ▼6.11
Posts /wp-admin/edit.php2,279 ▲1902.02 ▲0.0139.32 ▲4.1437.68 ▲1.80
Add New Post /wp-admin/post-new.php1,674 ▲14123.39 ▲0.08653.31 ▼30.4857.88 ▲0.46
Media Library /wp-admin/upload.php1,581 ▲1934.24 ▲0.0496.64 ▼0.6144.77 ▼3.50
All Testimonials /wp-admin/edit.php?post_type=testimonial1,2492.0132.5629.77
Portfolio categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio1,4552.1527.2329.90
Add New Portfolio /wp-admin/post-new.php?post_type=portfolio2,6617.71165.6272.33
Add New Testimonial /wp-admin/post-new.php?post_type=testimonial2,4877.69157.7353.82
All Sliders /wp-admin/edit.php?post_type=slider1,2491.9830.9232.42
Add New Callout /wp-admin/post-new.php?post_type=callout2,4887.59167.9558.34
All Callouts /wp-admin/edit.php?post_type=callout1,2491.9830.6926.48
Add New Slider /wp-admin/post-new.php?post_type=slider2,4997.91158.3655.18
All Clients /wp-admin/edit.php?post_type=client1,2491.9931.0028.96
Add New Client /wp-admin/post-new.php?post_type=client2,4427.75154.4557.23

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-custom-post-type/public/partials/wp-custom-post-type-public-display.php
    • > /wp-content/plugins/wp-custom-post-type/admin/partials/wp-custom-post-type-admin-display.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-custom-post-type/includes/wp-custom-post-type-register.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-custom-post-type/includes/Custom-function.php:146
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-custom-post-type/includes/wp-custom-metabox.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-custom-post-type/public/class-wp-custom-post-type-public.php:115

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: comments, spam

wp-custom-post-type/wp-custom-post-type.php 92% from 13 tests

The main PHP script in "WP Custom Post Type" version 2.0.0 is automatically included on every request by WordPress
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 172 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected9,694 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS22,254398,215
PHP153076091,438
JavaScript2132741

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods1979.17%
▷ Protected methods00.00%
▷ Private methods520.83%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin