10% custom-template-creator

Code Review | Custom Template Creator

WordPress plugin Custom Template Creator scored10%from 54 tests.

About plugin

  • Plugin page: custom-template-c...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.3-5.7
  • WordPress version: 6.3.1
  • First release: Feb 12, 2021
  • Latest release: Mar 15, 2021
  • Number of updates: 4
  • Update frequency: every 8.5 days
  • Top authors: eyeseet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /542 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/custom-template-creator/Base/Admin/AbstractAdminController.php+31
    Undefined index: page

Server metrics [RAM: ▼1.86MB] [CPU: ▼58.11ms] Passed 4 tests

An overview of server-side resources used by Custom Template Creator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.336.48 ▼33.85
Dashboard /wp-admin2.16 ▼1.196.90 ▼57.90
Posts /wp-admin/edit.php2.16 ▼1.208.09 ▼38.46
Add New Post /wp-admin/post-new.php2.16 ▼3.735.74 ▼102.22
Media Library /wp-admin/upload.php2.16 ▼1.076.31 ▼29.67
Custom Templates /wp-admin/edit.php?post_type=page&page=customtemplates3.2024.89

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Custom Template Creator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.30 ▼0.961.84 ▲0.0942.84 ▲3.54
Dashboard /wp-admin2,204 ▲185.83 ▲0.87102.51 ▼18.6635.67 ▼9.44
Posts /wp-admin/edit.php2,096 ▲72.02 ▲0.0540.37 ▲1.3235.70 ▲3.05
Add New Post /wp-admin/post-new.php1,536 ▲822.99 ▲4.60584.71 ▼44.3747.50 ▲1.12
Media Library /wp-admin/upload.php1,392 ▲44.17 ▼0.0495.68 ▲3.2243.09 ▼1.19
Custom Templates /wp-admin/edit.php?post_type=page&page=customtemplates8561.8030.1726.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/custom-template-creator/Base/Admin/AbstractAdminController.php+31
    Undefined index: page
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=page&page=customtemplates
    • > Notice in wp-content/plugins/custom-template-creator/Base/Admin/AbstractAdminController.php+55
    Undefined index: action

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/custom-template-creator/templates/mytemplate1.php
    • > /wp-content/plugins/custom-template-creator/templates/mytemplate3.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/custom-template-creator/Views/TemplateList.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/custom-template-creator/templates/mytemplate2.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'TemplateCreator\\Base\\AbstractController' not found in wp-content/plugins/custom-template-creator/Controllers/TemplateController.php:7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-template-creator/Views/TemplateList.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'TemplateCreator\\Base\\Admin\\AbstractAdminController' not found in wp-content/plugins/custom-template-creator/Controllers/TemplateAdminController.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'TemplateCreator\\Base\\AbstractController' not found in wp-content/plugins/custom-template-creator/Base/Admin/AbstractAdminController.php:6
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/custom-template-creator/Views/TemplateList.php on line 7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/edit.php?post_type=page&page=customtemplates
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).wpColorPicker is not a function" "TypeError: $(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/custom-template-creator/Base/Admin/js/admin.js?ver=6.3.1:140:31)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=page&page=customtemplates
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Template Editor), #2 (Select Template), #3 (Template overview)
You can look at the official readme.txt

custom-template-creator/TemplateCreator.php 77% from 13 tests

The entry point to "Custom Template Creator" version 1.0.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("custom-template-creator.php" instead of "TemplateCreator.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin1,169 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP132062598
CSS244152433
JavaScript1188138

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity8.22
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes9
▷ Abstract classes222.22%
▷ Concrete classes777.78%
▷ Final classes00.00%
Methods48
▷ Static methods816.67%
▷ Public methods3062.50%
▷ Protected methods1633.33%
▷ Private methods24.17%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin