94% add-custom-page-template

Code Review | Add custom page template

WordPress plugin Add custom page template scored 94% from 54 tests.

About plugin

  • Plugin page: add-custom-page-t...
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.6
  • WordPress version: 5.8.1
  • First release: Apr 8, 2016
  • Latest release: Dec 24, 2020
  • Number of updates: 10
  • Update frequency: every 172.2 days
  • Top authors: kiranpatil353 (80%)clarionwpdeveloper (30%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active / 15,886 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

A check of server-side resources used by Add custom page template
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0022.94 ▲0.29
Dashboard /wp-admin3.07 ▲0.0144.29 ▲0.59
Posts /wp-admin/edit.php3.12 ▲0.0130.91 ▲0.47
Add New Post /wp-admin/post-new.php5.43 ▼0.0169.39 ▼600.64
Media Library /wp-admin/upload.php3.01 ▲0.0121.99 ▼0.21
Theme Templates /wp-admin/admin.php?page=add-custom-template3.0119.65
Add Template /wp-admin/admin.php?page=addnew_template2.9819.16

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add custom page template
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,700 ▲9915.88 ▼0.134.79 ▼0.1876.70 ▼0.79
Dashboard /wp-admin2,964 ▲716.13 ▼0.03116.70 ▼12.48171.60 ▼5.81
Posts /wp-admin/edit.php2,772 ▲663.24 ▲0.0162.92 ▼0.11141.79 ▼2.56
Add New Post /wp-admin/post-new.php3,837 ▲2218.86 ▼0.42431.56 ▼7.67169.45 ▲9.06
Media Library /wp-admin/upload.php1,787 ▲355.50 ▲0.00164.22 ▲18.46190.15 ▼0.99
Theme Templates /wp-admin/admin.php?page=add-custom-template1,0942.4153.0899.90
Add Template /wp-admin/admin.php?page=addnew_template1,0902.3652.93111.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-custom-page-template/index.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were 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
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

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

This is the main PHP file of "Add custom page template" version 2.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-custom-page-template.php" instead of "index.php")

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
There were no executable files found in this plugin130 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13026130

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions9
▷ Named functions9100.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
There are no PNG files in this plugin