84% add-custom-page-template

Code Review | Add custom page template

WordPress plugin Add custom page template scored84%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: 6.3.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 /18,731 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.02MB] [CPU: ▼5.84ms] Passed 4 tests

An overview of server-side resources used by Add custom page template
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.58 ▼3.81
Dashboard /wp-admin3.33 ▼0.0148.62 ▼16.59
Posts /wp-admin/edit.php3.38 ▲0.0353.14 ▲0.01
Add New Post /wp-admin/post-new.php5.91 ▲0.0398.82 ▼2.95
Media Library /wp-admin/upload.php3.26 ▲0.0336.64 ▲0.81
Add Template /wp-admin/admin.php?page=addnew_template3.2232.73
Theme Templates /wp-admin/admin.php?page=add-custom-template3.2534.11

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
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Add custom page template
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.19 ▼1.441.83 ▼0.0243.02 ▲3.65
Dashboard /wp-admin2,233 ▲424.86 ▼0.04108.95 ▲2.3539.92 ▼0.32
Posts /wp-admin/edit.php2,116 ▲272.05 ▲0.0340.70 ▲5.7035.24 ▲0.81
Add New Post /wp-admin/post-new.php1,540 ▲2623.38 ▲5.88627.76 ▼59.2750.37 ▼2.26
Media Library /wp-admin/upload.php1,418 ▲304.20 ▼0.0496.68 ▼9.9145.95 ▼4.67
Add Template /wp-admin/admin.php?page=addnew_template8072.0327.7226.89
Theme Templates /wp-admin/admin.php?page=add-custom-template8062.0623.3126.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

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
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt is a good inspiration

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

"Add custom page template" version 2.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: The principal 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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected130 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13026130

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
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
PNG images were not found in this plugin