90% post-type-switcher

Code Review | Post Type Switcher

WordPress plugin Post Type Switcher scored 90% from 54 tests.

About plugin

  • Plugin page: post-type-switcher
  • Plugin version: 3.2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: May 29, 2010
  • Latest release: Nov 16, 2022
  • Number of updates: 76
  • Update frequency: every 60.0 days
  • Top authors: johnjamesjacoby (100%)

Code review

54 tests

User reviews

228 reviews

Install metrics

200,000+ active / 1,318,390 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
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.53ms] Passed 4 tests

Analyzing server-side resources used by Post Type Switcher
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0641.69 ▲0.18
Dashboard /wp-admin3.36 ▲0.0643.96 ▼5.38
Posts /wp-admin/edit.php3.50 ▲0.1444.92 ▼3.37
Add New Post /wp-admin/post-new.php5.94 ▲0.0693.40 ▼9.53
Media Library /wp-admin/upload.php3.28 ▲0.0635.17 ▲1.16

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Post Type Switcher: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.44 ▼0.151.76 ▼0.7442.98 ▼4.27
Dashboard /wp-admin2,203 ▲155.78 ▲0.90100.48 ▼12.7640.33 ▼4.82
Posts /wp-admin/edit.php2,163 ▲742.06 ▲0.0642.13 ▲1.8035.16 ▼0.04
Add New Post /wp-admin/post-new.php1,547 ▲3323.29 ▲5.77594.40 ▼48.2340.31 ▼14.90
Media Library /wp-admin/upload.php1,391 ▼04.18 ▼0.0495.42 ▼5.7840.41 ▼3.73

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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

readme.txt Passed 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
5 plugin tags: post, types, type, page, post type

post-type-switcher/post-type-switcher.php 92% from 13 tests

The main file in "Post Type Switcher" v. 3.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/assets/lang/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected373 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2119244341
JavaScript213632

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity48.00
▷ Minimum class complexity48.00
▷ Maximum class complexity48.00
Average method complexity3.61
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods18
▷ Static methods15.56%
▷ Public methods1583.33%
▷ Protected methods00.00%
▷ Private methods316.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin