84% templatekit-shortcode-for-post-and-page

Code Review | Templatekit Shortcode For Post And Page

WordPress plugin Templatekit Shortcode For Post And Page scored84%from 54 tests.

About plugin

  • Plugin page: templatekit-short...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Oct 7, 2022
  • Latest release: Oct 7, 2022
  • Number of updates: 10
  • Update frequency: every 0.4 days
  • Top authors: codepopular (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /575 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.09ms] Passed 4 tests

A check of server-side resources used by Templatekit Shortcode For Post And Page
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0732.78 ▼10.01
Dashboard /wp-admin3.36 ▲0.0545.25 ▼4.49
Posts /wp-admin/edit.php3.41 ▲0.0547.36 ▼1.52
Add New Post /wp-admin/post-new.php5.94 ▲0.06100.67 ▲7.09
Media Library /wp-admin/upload.php3.28 ▲0.0532.53 ▼0.33
Add New /wp-admin/post-new.php?post_type=template_kit3.3944.74
All Templates /wp-admin/edit.php?post_type=template_kit3.3238.72

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Templatekit Shortcode For Post And Page: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9913.24 ▼1.394.53 ▲2.8041.74 ▼6.06
Dashboard /wp-admin2,245 ▲574.84 ▼1.06112.47 ▲7.8039.10 ▼3.77
Posts /wp-admin/edit.php2,138 ▲492.02 ▼0.0141.98 ▲2.7737.95 ▲3.39
Add New Post /wp-admin/post-new.php1,564 ▲2723.18 ▲4.56639.56 ▲32.0658.78 ▼0.97
Media Library /wp-admin/upload.php1,424 ▲334.27 ▲0.0696.53 ▼1.7645.19 ▲1.27
Add New /wp-admin/post-new.php?post_type=template_kit2,2217.75168.7562.51
All Templates /wp-admin/edit.php?post_type=template_kit1,0941.9330.2929.73

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/templatekit-shortcode-for-post-and-page/inc/Template_Kit_Admin.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/templatekit-shortcode-for-post-and-page/inc/Template_Kit_i18n.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/templatekit-shortcode-for-post-and-page/inc/Template_Kit_Helpers.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/templatekit-shortcode-for-post-and-page/templatekit-shortcode-for-post-and-page.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #3 (Template Kit Shortcode.) image not found
The official readme.txt is a good inspiration

templatekit-shortcode-for-post-and-page/templatekit-shortcode-for-post-and-page.php Passed 13 tests

The main PHP script in "Templatekit Shortcode For Post And Page" version 1.0.1 is automatically included on every request by WordPress
138 characters long description:
TemplateKit is a WordPress shortcode plugin. With this plugin you can make template with a shortcode and place it anywhere in the website.

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
Good job! No executable or dangerous file extensions detected2,666 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP206978992,303
Markdown2830218
JSON30081
XML1161364

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity24.08
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods145
▷ Static methods1812.41%
▷ Public methods10874.48%
▷ Protected methods64.14%
▷ Private methods3121.38%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants5
▷ Global constants5100.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
No PNG files were detected