84% cpt-custom-page-template

Code Review | Cpt custom page template

WordPress plugin Cpt custom page template scored84%from 54 tests.

About plugin

  • Plugin page: cpt-custom-page-t...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.6
  • WordPress version: 6.3.1
  • First release: Apr 2, 2016
  • Latest release: Dec 23, 2020
  • Number of updates: 8
  • Update frequency: every 215.8 days
  • Top authors: ganeshpaygude (87.5%)clarionwpdeveloper (25%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,339 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Cpt custom page template
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.07 ▼6.67
Dashboard /wp-admin3.31 ▲0.0145.83 ▼0.24
Posts /wp-admin/edit.php3.36 ▲0.0148.16 ▲0.76
Add New Post /wp-admin/post-new.php3.10 ▼2.7935.90 ▼57.11
Media Library /wp-admin/upload.php3.23 ▲0.0132.18 ▼1.65

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

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

Browser metrics Passed 4 tests

Cpt custom page template: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼1.054.19 ▲2.4043.98 ▼3.24
Dashboard /wp-admin2,206 ▲185.77 ▲0.73102.15 ▼12.6838.62 ▼7.22
Posts /wp-admin/edit.php2,089 ▼32.12 ▲0.0640.05 ▲3.0735.44 ▲1.59
Add New Post /wp-admin/post-new.php6,472 ▲4,93720.40 ▼3.02866.51 ▲196.7958.67 ▼3.39
Media Library /wp-admin/upload.php1,385 ▼34.23 ▲0.0998.54 ▼9.3243.12 ▼5.26

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
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 add_action() in wp-content/plugins/cpt-custom-page-template/index.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

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
10 plugin tags: wp custom post template, cpttemplates, post-template, pagetemplate attribute theme template, wp post template...

cpt-custom-page-template/index.php 92% from 13 tests

"Cpt custom page template" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("cpt-custom-page-template.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin78 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1353678

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected