84% custom-post-type-widgets

Code Review | Custom Post Type Widgets

WordPress plugin Custom Post Type Widgets scored84%from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.0
  • WordPress version: 6.3.1
  • First release: Jan 28, 2015
  • Latest release: Apr 13, 2023
  • Number of updates: 37
  • Update frequency: every 81.0 days
  • Top authors: thingsym (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

20,000+ active /192,487 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.30MB] [CPU: ▼7.76ms] Passed 4 tests

An overview of server-side resources used by Custom Post Type Widgets
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3336.59 ▼2.45
Dashboard /wp-admin3.60 ▲0.2645.93 ▼12.90
Posts /wp-admin/edit.php3.72 ▲0.3646.56 ▲1.94
Add New Post /wp-admin/post-new.php6.18 ▲0.3080.47 ▼17.55
Media Library /wp-admin/upload.php3.53 ▲0.3037.43 ▲1.86

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 25 new files
Database: no new tables, 13 new options
New WordPress options
widget_custom-post-type-recent-posts
widget_theysaidso_widget
widget_recent-comments
widget_custom-post-type-calendar
widget_custom-post-type-recent-comments
widget_recent-posts
widget_custom-post-type-search
theysaidso_admin_options
widget_custom-post-type-categories
widget_custom-post-type-tag-cloud
...

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Post Type Widgets
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.19 ▼1.394.65 ▲3.0036.87 ▼6.98
Dashboard /wp-admin2,209 ▲185.91 ▲1.03104.25 ▼5.3838.96 ▼5.01
Posts /wp-admin/edit.php2,092 ▲32.03 ▲0.0239.47 ▲1.6135.17 ▲2.06
Add New Post /wp-admin/post-new.php1,533 ▲523.35 ▲4.92669.00 ▲44.9051.93 ▼5.53
Media Library /wp-admin/upload.php1,379 ▼94.19 ▼0.04102.82 ▲5.1844.97 ▲1.42

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 13 options
    • widget_custom-post-type-calendar
    • widget_custom-post-type-recent-posts
    • can_compress_scripts
    • widget_recent-posts
    • widget_custom-post-type-tag-cloud
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_custom-post-type-archives
    • widget_custom-post-type-recent-comments
    • widget_custom-post-type-search
    • ...

Smoke tests 75% 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-widgets/inc/widget-custom-post-type-calendar.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-widgets/inc/widget-custom-post-type-recent-comments.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-widgets/inc/widget-custom-post-type-tag-cloud.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-widgets/inc/widget-custom-post-type-archive.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-widgets/inc/widget-custom-post-type-categories.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-widgets/inc/widget-custom-post-type-recent-posts.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-widgets/inc/widget-custom-post-type-search.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Recent Posts (Custom Post Type)), #2 (Archives (Custom Post Type)), #3 (Categories (Custom Post Type)), #4 (Calendar (Custom Post Type)), #5 (Recent Comments (Custom Post Type)), #6 (Tag Cloud (Custom Post Type)), #7 (Search (Custom Post Type))
Please take inspiration from this readme.txt

custom-post-type-widgets/custom-post-type-widgets.php Passed 13 tests

This is the main PHP file of "Custom Post Type Widgets" version 1.5.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
50 characters long description:
This plugin adds default custom post type widgets.

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
Success! There were no dangerous files found in this plugin1,678 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP92619221,377
PO File313181301

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity30.00
▷ Minimum class complexity3.00
▷ Maximum class complexity70.00
Average method complexity6.04
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods46
▷ Static methods12.17%
▷ Public methods46100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.30MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png39.05KB10.63KB▼ 72.79%
screenshot-1.png46.87KB12.89KB▼ 72.50%
screenshot-4.png29.40KB7.24KB▼ 75.38%
screenshot-7.png29.35KB7.13KB▼ 75.71%
screenshot-3.png64.42KB19.93KB▼ 69.06%