78% template-for-custom-post-types

Code Review | Template for Custom Post Types

WordPress plugin Template for Custom Post Types scored78%from 54 tests.

About plugin

  • Plugin page: template-for-cust...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 6.3.1
  • First release: Jan 30, 2016
  • Latest release: Sep 25, 2016
  • Number of updates: 27
  • Update frequency: every 11.9 days
  • Top authors: gandhirk (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

700+ active /11,393 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.69MB] [CPU: ▼17.46ms] Passed 4 tests

A check of server-side resources used by Template for Custom Post Types
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.30 ▼7.81
Dashboard /wp-admin3.32 ▲0.0155.37 ▲2.41
Posts /wp-admin/edit.php3.37 ▲0.0151.74 ▲3.85
Add New Post /wp-admin/post-new.php3.10 ▼2.7834.15 ▼68.27
Media Library /wp-admin/upload.php3.24 ▲0.0140.78 ▲4.20
Post Type Template /wp-admin/options-general.php?page=wptcp-settings3.2432.09

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Template for Custom Post Types: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.27 ▼0.081.80 ▼0.0644.69 ▲0.23
Dashboard /wp-admin2,199 ▲225.57 ▼0.1184.97 ▼9.4637.34 ▼3.08
Posts /wp-admin/edit.php2,101 ▲12.00 ▲0.0139.05 ▲0.2835.38 ▲0.35
Add New Post /wp-admin/post-new.php1,529 ▼823.00 ▲4.67674.64 ▲29.4655.98 ▼9.43
Media Library /wp-admin/upload.php1,404 ▲44.19 ▼0.0095.91 ▼1.4143.90 ▼1.75
Post Type Template /wp-admin/options-general.php?page=wptcp-settings8311.9924.7724.47

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wptcp-settings
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wptcp-settings
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/template-for-custom-post-types/settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === template-for-custom-post-types === )
You can take inspiration from this readme.txt

template-for-custom-post-types/template-for-custom-posttype.php 92% from 13 tests

The primary PHP file in "Template for Custom Post Types" version 1.0.4 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("template-for-custom-post-types.php" instead of "template-for-custom-posttype.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected194 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23620194

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
4 PNG files occupy 0.11MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png32.85KB12.35KB▼ 62.41%
assets/screenshot-4.png24.76KB7.03KB▼ 71.62%
assets/screenshot-2.png34.28KB12.19KB▼ 64.42%
assets/screenshot-1.png24.79KB8.45KB▼ 65.91%