78% wd-post-types

Code Review | WD Post Types

WordPress plugin WD Post Types scored78%from 54 tests.

About plugin

  • Plugin page: wd-post-types
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: May 4, 2022
  • Latest release: May 23, 2022
  • Number of updates: 24
  • Update frequency: every 0.8 days
  • Top authors: webdnix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /579 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼5.71ms] Passed 4 tests

Analyzing server-side resources used by WD Post Types
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.11 ▼3.78
Dashboard /wp-admin3.41 ▲0.0651.88 ▼13.98
Posts /wp-admin/edit.php3.52 ▲0.1650.37 ▼0.06
Add New Post /wp-admin/post-new.php6.03 ▲0.1491.51 ▼2.68
Media Library /wp-admin/upload.php3.33 ▲0.1036.43 ▼2.39
All Meta /wp-admin/edit.php?post_type=wdpt_meta3.3738.36
Add New /wp-admin/post-new.php?post_type=wdpt_types3.3947.88
All Types /wp-admin/edit.php?post_type=wdpt_types3.3737.34
Shortcodes /wp-admin/edit.php?post_type=wdpt_types&page=wdpt_shortcode3.3031.91
All Taxonomies /wp-admin/edit.php?post_type=wdpt_taxonomies3.3737.54
All Groups /wp-admin/edit.php?post_type=wdpt_group3.3737.35
All Templates /wp-admin/edit.php?post_type=wdpt-templates3.3734.99

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WD Post Types
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲12713.29 ▼1.061.77 ▲0.0342.02 ▼4.78
Dashboard /wp-admin2,276 ▲965.83 ▲0.1592.08 ▼8.1439.26 ▼7.31
Posts /wp-admin/edit.php2,189 ▲892.32 ▲0.3138.03 ▲4.3034.26 ▼0.56
Add New Post /wp-admin/post-new.php1,596 ▲6823.18 ▲0.01641.55 ▼25.2033.70 ▼21.72
Media Library /wp-admin/upload.php1,487 ▲844.58 ▲0.40102.93 ▲4.7844.14 ▼5.07
All Meta /wp-admin/edit.php?post_type=wdpt_meta1,1532.2634.0829.49
Add New /wp-admin/post-new.php?post_type=wdpt_types2,4683.3060.7337.85
All Types /wp-admin/edit.php?post_type=wdpt_types1,1532.2138.4329.38
Shortcodes /wp-admin/edit.php?post_type=wdpt_types&page=wdpt_shortcode8632.0034.9222.89
All Taxonomies /wp-admin/edit.php?post_type=wdpt_taxonomies1,1502.2432.8729.94
All Groups /wp-admin/edit.php?post_type=wdpt_group1,1472.2433.7428.83
All Templates /wp-admin/edit.php?post_type=wdpt-templates1,1502.2533.9129.30

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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wd-post-types/inc/classes/wd-taxonomy.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/wd-post-types/inc/pro/templates/shortcode/meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wd-post-types/inc/pro/wd-shortcode.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wd-post-types/inc/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/wd-post-types/inc/classes/wd-types.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wd-post-types/inc/classes/wd-group.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wd-post-types/inc/classes/wd-post.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wd-post-types/inc/pro/wd-template.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wd-post-types/inc/templates/custom-template.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wd-post-types/inc/classes/wd-meta.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wdpt-templates
    • > Network (severe)
    wp-content/plugins/wd-post-types/inc/classes/my-script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
9 plugin tags: custom meta, post type, post taxonomy, post meta, custom taxonomy...

wd-post-types/index.php 77% from 13 tests

The main PHP script in "WD Post Types" version 1.1 is automatically included on every request by WordPress
The following require your attention:
  • 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
  • Description: Please keep the plugin description shorter than 140 characters (currently 214 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("wd-post-types.php" instead of "index.php")

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 detected2,427 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP1264942,427

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity42.56
▷ Minimum class complexity1.00
▷ Maximum class complexity133.00
Average method complexity7.03
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods62
▷ Static methods00.00%
▷ Public methods6198.39%
▷ Protected methods00.00%
▷ Private methods11.61%
Functions14
▷ Named functions14100.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
No PNG images were found in this plugin