84% wp-custom-post-template

Code Review | WP Custom Post Template

WordPress plugin WP Custom Post Template scored84%from 54 tests.

About plugin

  • Plugin page: wp-custom-post-te...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 6.3.1
  • First release: Apr 4, 2014
  • Latest release: Dec 27, 2016
  • Number of updates: 9
  • Update frequency: every 110.9 days
  • Top authors: dswpsupport (100%)

Code review

54 tests

User reviews

28 reviews

Install metrics

5,000+ active /70,566 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.06ms] Passed 4 tests

This is a short check of server-side resources used by WP Custom Post Template
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.11 ▼2.05
Dashboard /wp-admin3.33 ▲0.0349.39 ▲0.58
Posts /wp-admin/edit.php3.38 ▲0.0349.40 ▼5.72
Add New Post /wp-admin/post-new.php5.93 ▲0.0489.60 ▼9.05
Media Library /wp-admin/upload.php3.25 ▲0.0337.79 ▲3.11

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
wp_custom_post_template
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

WP Custom Post Template: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.28 ▼1.341.80 ▼0.3144.41 ▲6.86
Dashboard /wp-admin2,223 ▲354.89 ▼0.9696.08 ▼15.1493.97 ▲53.34
Posts /wp-admin/edit.php2,109 ▲171.99 ▼0.0138.26 ▼8.2233.07 ▼4.32
Add New Post /wp-admin/post-new.php6,387 ▲4,86827.65 ▲4.42950.23 ▲277.7961.81 ▲5.62
Media Library /wp-admin/upload.php1,405 ▲144.12 ▼0.07108.60 ▼4.5747.43 ▼0.30

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/wp-custom-post-template/_form.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-custom-post-template/wp-custom-post-template.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
  • Tags: There are too many tags (16 tag instead of maximum 10)
You can take inspiration from this readme.txt

wp-custom-post-template/wp-custom-post-template.php Passed 13 tests

Analyzing the main PHP file in "WP Custom Post Template" version 1.0
103 characters long description:
This plugin allows theme authors to create a post tempate as well as page template for the single post.

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 plugin217 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22417182
CSS13135

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
ico.png0.73KB0.75KB0.00%