68% sherk-custom-post-type-displays

Code Review | Sherk Custom Post Type Displays

WordPress plugin Sherk Custom Post Type Displays scored68%from 54 tests.

About plugin

  • Plugin page: sherk-custom-post...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 6.3.1
  • First release: May 14, 2015
  • Latest release: Jun 27, 2015
  • Number of updates: 14
  • Update frequency: every 3.1 days
  • Top authors: sherkspear (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /2,123 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.67MB] [CPU: ▼45.74ms] Passed 4 tests

A check of server-side resources used by Sherk Custom Post Type Displays
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.33 ▼1.1410.60 ▼33.94
Dashboard /wp-admin2.34 ▼0.9611.84 ▼38.79
Posts /wp-admin/edit.php2.34 ▼1.0212.71 ▼36.35
Add New Post /wp-admin/post-new.php2.34 ▼3.5514.10 ▼73.89
Media Library /wp-admin/upload.php2.34 ▼0.8911.54 ▼22.92
Sherk CPT Displays /wp-admin/tools.php?page=sherkcptdisplays_info2.3413.73

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_sherk_cptdisplays_widget_id
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Sherk Custom Post Type Displays: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.23 ▼1.171.73 ▼0.2141.66 ▼0.48
Dashboard /wp-admin2,210 ▲254.85 ▼1.02113.37 ▲8.0744.34 ▲4.35
Posts /wp-admin/edit.php2,096 ▲72.06 ▲0.0435.11 ▲2.2631.46 ▼4.15
Add New Post /wp-admin/post-new.php1,517 ▼1717.68 ▼5.54661.16 ▲52.7051.48 ▼13.63
Media Library /wp-admin/upload.php1,392 ▲74.22 ▲0.0596.47 ▼6.3343.91 ▲2.92
Sherk CPT Displays /wp-admin/tools.php?page=sherkcptdisplays_info1,1942.0225.8846.20

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
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in SherkCPTDisplaysWidget is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_sherk_cptdisplays_widget_id
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/tools.php?page=sherkcptdisplays_info
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in SherkCPTDisplaysWidget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/tools.php?page=sherkcptdisplays_info
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
    • > GET request to /wp-admin/tools.php?page=sherkcptdisplays_info
    • > Notice in wp-content/plugins/sherk-custom-post-type-displays/templates/sherkcptdisplays_dashboard.php+58
    Undefined variable: optionPosts

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sherk-custom-post-type-displays/includes/SherkCPTDisplaysCssJsScripts.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/sherk-custom-post-type-displays/includes/SherkCPTDisplaysShortcode.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/sherk-custom-post-type-displays/templates/sherkcptdisplays_dashboard.php:55
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sherk-custom-post-type-displays/includes/SherkCPTDisplaysWidget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/sherk-custom-post-type-displays/includes/SherkCPTDisplaysShortcode.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sherk-custom-post-type-displays/includes/SherkCPTDisplaysMenu.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: custom post types, widget, shortcode, display post type, list post type...

sherk-custom-post-type-displays/sherk_cpt_display.php 92% from 13 tests

The main PHP file in "Sherk Custom Post Type Displays" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sherk-custom-post-type-displays.php" instead of "sherk_cpt_display.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin472 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP614474371
Markdown134075
CSS17926

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity6.20
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods16
▷ Static methods212.50%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/controls.png2.74KB1.42KB▼ 48.29%
assets/images/logo.png49.81KB14.78KB▼ 70.33%