94% cpt-template-path

Code Review | CPT Template Path

WordPress plugin CPT Template Path scored 94% from 53 tests.

About plugin

  • Plugin page: cpt-template-path
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 5.8.1
  • First release: Jul 11, 2015
  • Latest release: Jul 11, 2015
  • Number of updates: 2
  • Update frequency: every 2.5 days
  • Top authors: cyberwani (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 504 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼262.42ms] Passed 4 tests

Server-side resources used by CPT Template Path
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1251.10 ▲27.20
Dashboard /wp-admin3.06 ▲0.0143.91 ▲0.02
Posts /wp-admin/edit.php3.12 ▲0.0144.04 ▼2.24
Add New Post /wp-admin/post-new.php5.43 ▼0.00104.83 ▼1,042.86
Media Library /wp-admin/upload.php3.01 ▼0.0035.07 ▼4.61

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for CPT Template Path
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,649 ▲4315.90 ▲0.379.08 ▼0.5466.88 ▲15.26
Dashboard /wp-admin2,933 ▲835.96 ▲0.12144.58 ▲1.28112.45 ▲0.74
Posts /wp-admin/edit.php2,706 ▼02.69 ▲0.0167.00 ▼1.9893.89 ▼3.30
Add New Post /wp-admin/post-new.php1,653 ▲17218.83 ▲0.28378.18 ▼9.08117.37 ▲0.23
Media Library /wp-admin/upload.php1,772 ▼05.01 ▲0.00159.55 ▼25.53122.75 ▲7.28

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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 fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cpt-template-path/cpt-template-path.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === cpt-template-path === )
The official readme.txt is a good inspiration

cpt-template-path/cpt-template-path.php Passed 13 tests

The main PHP file in "CPT Template Path" ver. 0.1 adds more information about the plugin and also serves as the entry point for this plugin
64 characters long description:
Adds Custom Post Type slug as folder path in template hierarchy.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected29 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP112729

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.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 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin