10% post-type-modifier-simple

Code Review | Add Custom Post Type into Post Query

WordPress plugin Add Custom Post Type into Post Query scored10%from 54 tests.

About plugin

  • Plugin page: post-type-modifie...
  • Plugin version: 1.04
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4+
  • WordPress version: 6.3.1
  • First release: Mar 17, 2021
  • Latest release: Jul 30, 2022
  • Number of updates: 12
  • Update frequency: every 41.7 days
  • Top authors: ttodua (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /442 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Error in wp-content/plugins/post-type-modifier-simple/library_wp.php+2677
    Uncaught Error: Class 'WP_Plugins_List_Table' not found in wp-content/plugins/post-type-modifier-simple/library_wp.php:2677
    Stack trace:
    #0 wp-content/plugins/post-type-modifier-simple/library_wp.php(2611): Puvox\wp_plugin->is_not_bulk_activation()
    #1 wp-includes/class-wp-hook.php(312): Puvox\wp_plugin->Puvox\{closure}()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(720): do_action()

Server metrics [RAM: ▲2.10MB] [CPU: ▲2.05ms] Passed 4 tests

This is a short check of server-side resources used by Add Custom Post Type into Post Query
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.68 ▲2.2158.39 ▲1.61
Dashboard /wp-admin5.51 ▲2.1667.54 ▼1.07
Posts /wp-admin/edit.php5.32 ▲1.9654.95 ▲0.16
Add New Post /wp-admin/post-new.php8.03 ▲2.14114.37 ▲7.50
Media Library /wp-admin/upload.php5.37 ▲2.1364.42 ▲27.77
Post Type Modifier /wp-admin/options-general.php?page=post-type-modifier-custom5.3454.69

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 5 new files
Database: 1 new table, 7 new options
New tables
wp_post_type_modifier_custom__errors_log
New WordPress options
widget_recent-posts
db_upgraded
post-type-modifier-custom
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add Custom Post Type into Post Query
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.39 ▲0.041.57 ▼0.5938.40 ▼5.01
Dashboard /wp-admin2,205 ▲285.58 ▼0.0885.39 ▼20.1039.07 ▼6.20
Posts /wp-admin/edit.php2,014 ▼891.97 ▲0.0242.34 ▲3.9334.97 ▲1.01
Add New Post /wp-admin/post-new.php1,542 ▲618.02 ▼5.13679.83 ▼84.1363.70 ▲1.70
Media Library /wp-admin/upload.php1,407 ▲104.14 ▼0.05112.96 ▲13.7145.92 ▲0.61
Post Type Modifier /wp-admin/options-general.php?page=post-type-modifier-custom9792.1534.5169.14

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_post_type_modifier_custom__errors_log
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • post-type-modifier-custom
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Puvox\\library' not found in wp-content/plugins/post-type-modifier-simple/library_wp.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
You can take inspiration from this readme.txt

post-type-modifier-simple/index.php 77% from 13 tests

The primary PHP file in "Add Custom Post Type into Post Query" version 1.04 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("post-type-modifier-simple.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 183 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected3,559 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP31,2555,0973,559

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,076)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity347.20
▷ Minimum class complexity13.00
▷ Maximum class complexity1,076.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods850
▷ Static methods10212.00%
▷ Public methods84399.18%
▷ Protected methods00.00%
▷ Private methods70.82%
Functions89
▷ Named functions00.00%
▷ Anonymous functions89100.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin