78% custom-post-type-selector

Code Review | Custom Post Type Selector

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

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.3
  • WordPress version: 6.3.1
  • First release: Feb 20, 2012
  • Latest release: Aug 20, 2015
  • Number of updates: 11
  • Update frequency: every 116.1 days
  • Top authors: unknowndomain (63.64%)ctsttom (36.36%)chrisguitarguy (18.18%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /4,751 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.01MB] [CPU: ▼4.72ms] Passed 4 tests

Server-side resources used by Custom Post Type Selector
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.96 ▼0.42
Dashboard /wp-admin3.32 ▲0.0244.89 ▼5.46
Posts /wp-admin/edit.php3.37 ▲0.0148.87 ▼2.56
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.73 ▼10.43
Media Library /wp-admin/upload.php3.24 ▲0.0133.38 ▲0.03
Post Types /wp-admin/options-general.php?page=post-types3.1830.59

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
cpts-enabled-post-types
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Post Type Selector
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.43 ▲0.051.71 ▲0.0240.86 ▼10.67
Dashboard /wp-admin2,204 ▲135.83 ▲0.94107.40 ▲6.8040.48 ▼2.39
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0339.67 ▲0.8035.94 ▲1.57
Add New Post /wp-admin/post-new.php1,523 ▲323.24 ▼0.00664.58 ▲3.5055.93 ▲4.25
Media Library /wp-admin/upload.php1,395 ▲44.23 ▲0.0494.98 ▼4.7342.13 ▲0.62
Post Types /wp-admin/options-general.php?page=post-types8512.0323.6227.22

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • 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=post-types
    • > 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=post-types
    • > 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/custom-post-type-selector/custom-post-type-selector.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/custom-post-type-selector/inc/front.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/custom-post-type-selector/inc/admin.php:7

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

readme.txt 88% 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
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: These screenshots require images: #1 (From this panel you can select which post types should be enabled.), #2 (You will find the `Post Types` panel under the `Settings` menu in the Admin area of your site or network.)
You can look at the official readme.txt

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

The main PHP file in "Custom Post Type Selector" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected110 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP31834110

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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