84% custom-templates

Code Review | Custom Templates

WordPress plugin Custom Templates scored84%from 54 tests.

About plugin

  • Plugin page: custom-templates
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7.2
  • WordPress version: 6.3.1
  • First release: Oct 9, 2016
  • Latest release: Jan 27, 2017
  • Number of updates: 7
  • Update frequency: every 15.7 days
  • Top authors: JohnnyPea (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /2,132 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▲0.48ms] Passed 4 tests

Analyzing server-side resources used by Custom Templates
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.28 ▼1.75
Dashboard /wp-admin3.33 ▲0.0352.51 ▲3.32
Posts /wp-admin/edit.php3.39 ▲0.0349.77 ▲2.34
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.87 ▼0.56
Media Library /wp-admin/upload.php3.26 ▲0.0334.47 ▲1.90
All Items /wp-admin/edit.php?post_type=template3.3033.94
Add New /wp-admin/post-new.php?post_type=template3.3747.47

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

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

Browser metrics Passed 4 tests

Custom Templates: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲11813.25 ▼1.064.97 ▲3.0543.73 ▼4.82
Dashboard /wp-admin2,234 ▲854.84 ▼0.75107.82 ▼3.8638.72 ▼4.30
Posts /wp-admin/edit.php2,117 ▲282.03 ▲0.0239.50 ▼0.1135.09 ▼3.37
Add New Post /wp-admin/post-new.php1,565 ▲5118.29 ▲0.55603.30 ▼59.7945.76 ▼8.06
Media Library /wp-admin/upload.php1,410 ▲284.17 ▼0.0398.42 ▼4.0744.78 ▲2.37
All Items /wp-admin/edit.php?post_type=template1,0812.0131.2029.00
Add New /wp-admin/post-new.php?post_type=template2,2637.79166.8062.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Webikon\\Custom_Templates\\plugin_dir_path() in wp-content/plugins/custom-templates/custom-templates.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Webikon\\Custom_Templates\\add_action() in wp-content/plugins/custom-templates/template-custom-post-type.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Webikon\\Custom_Templates\\add_action() in wp-content/plugins/custom-templates/template-meta-boxes.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: template, content, customize, editor, templates

custom-templates/custom-templates.php 92% from 13 tests

The entry point to "Custom Templates" version 1.2.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected216 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP35355216

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
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
Namespaces1
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%
Functions15
▷ Named functions533.33%
▷ Anonymous functions1066.67%
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
No PNG images were found in this plugin