79% wc-custom-post-types

Code Review | WordPress Canvas - Custom Post Types

WordPress plugin WordPress Canvas - Custom Post Types scored79%from 54 tests.

About plugin

  • Plugin page: wc-custom-post-types
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.6
  • WordPress version: 6.3.1
  • First release: Dec 12, 2013
  • Latest release: Sep 2, 2016
  • Number of updates: 7
  • Update frequency: every 142.1 days
  • Top authors: cbaldelomar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /11,895 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.18ms] Passed 4 tests

An overview of server-side resources used by WordPress Canvas - Custom Post Types
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.74 ▼8.96
Dashboard /wp-admin3.36 ▲0.0645.70 ▼2.74
Posts /wp-admin/edit.php3.41 ▲0.0547.19 ▲1.10
Add New Post /wp-admin/post-new.php5.94 ▲0.0581.05 ▼5.37
Media Library /wp-admin/upload.php3.28 ▲0.0534.89 ▲0.36
Portfolio Items /wp-admin/edit.php?post_type=wc_portfolio_item3.3236.53
Tags /wp-admin/edit-tags.php?taxonomy=wc_portfolio_tag&post_type=wc_portfolio_item3.2728.13
Add New /wp-admin/post-new.php?post_type=wc_portfolio_item3.4153.81
Categories /wp-admin/edit-tags.php?taxonomy=wc_portfolio_cat&post_type=wc_portfolio_item3.2834.35
WC Post Types /wp-admin/options-general.php?page=wc-cpt3.2226.56

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Canvas - Custom Post Types
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9513.25 ▼1.031.77 ▲0.0840.60 ▼5.70
Dashboard /wp-admin2,244 ▲565.88 ▲0.0296.69 ▼20.0972.78 ▲30.28
Posts /wp-admin/edit.php2,127 ▲411.97 ▼0.0638.33 ▲2.3436.22 ▼0.26
Add New Post /wp-admin/post-new.php1,565 ▲4618.23 ▼4.79688.83 ▲1.6664.94 ▲9.39
Media Library /wp-admin/upload.php1,429 ▲444.23 ▲0.0493.38 ▼6.1363.60 ▲20.59
Portfolio Items /wp-admin/edit.php?post_type=wc_portfolio_item1,1331.9530.2829.15
Tags /wp-admin/edit-tags.php?taxonomy=wc_portfolio_tag&post_type=wc_portfolio_item1,2692.1429.4330.58
Add New /wp-admin/post-new.php?post_type=wc_portfolio_item2,5667.74171.60116.30
Categories /wp-admin/edit-tags.php?taxonomy=wc_portfolio_cat&post_type=wc_portfolio_item1,3032.1325.9231.03
WC Post Types /wp-admin/options-general.php?page=wc-cpt8712.2224.0230.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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wc-cpt
    • > 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=wc-cpt
    • > 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-custom-post-types/wc-custom-post-types.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wc-custom-post-types/uninstall.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-custom-post-types/includes/post-types.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-custom-post-types/admin/admin.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-custom-post-types/includes/taxonomies.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-custom-post-types/includes/functions.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: custom post types, portfolio, custom post type, common post types, custom portfolio

wc-custom-post-types/wc-custom-post-types.php Passed 13 tests

Analyzing the main PHP file in "WordPress Canvas - Custom Post Types" version 1.3
71 characters long description:
Portfolio post types with minimal configuration to be used with themes.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected547 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6116277380
PO File1350829133
Markdown123034

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/screen-icon.png1.20KB1.25KB0.00%
images/menu-icon.png0.77KB0.78KB0.00%