80% template-dictionary

Code Review | Template Dictionary

WordPress plugin Template Dictionary scored80%from 54 tests.

About plugin

  • Plugin page: template-dictionary
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.5.3
  • WordPress version: 6.3.1
  • First release: Aug 15, 2017
  • Latest release: Nov 16, 2020
  • Number of updates: 25
  • Update frequency: every 47.7 days
  • Top authors: radovank (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,131 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.24MB] [CPU: ▼8.47ms] Passed 4 tests

This is a short check of server-side resources used by Template Dictionary
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.75 ▲1.40
Dashboard /wp-admin3.66 ▲0.3146.14 ▼13.40
Posts /wp-admin/edit.php3.71 ▲0.3542.45 ▼7.09
Add New Post /wp-admin/post-new.php6.20 ▲0.3183.29 ▼14.79
Media Library /wp-admin/upload.php3.52 ▲0.2935.90 ▲2.14
Settings list /wp-admin/admin.php?page=template_dictionary_settings3.5233.19
Add settings /wp-admin/admin.php?page=template_dictionary_add_edit_setting3.5031.53
Add value /wp-admin/admin.php?page=template_dictionary_edit_value3.5236.94
Template Dictionary /wp-admin/admin.php?page=template_dictionary3.5235.01
Export/Import /wp-admin/admin.php?page=template_dictionary_export_import3.5031.04

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 85 new files
Database: 4 new tables, 7 new options
New tables
wp_tdict_int
wp_tdict_text
wp_tdict
wp_tdict_varchar
New WordPress options
widget_recent-comments
template-dictionary-version
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Template Dictionary
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲9514.25 ▼0.122.16 ▲0.4543.61 ▲2.25
Dashboard /wp-admin2,240 ▲635.68 ▲0.0283.90 ▼3.0539.03 ▼5.36
Posts /wp-admin/edit.php2,142 ▲422.00 ▲0.0635.34 ▼0.1530.70 ▼2.80
Add New Post /wp-admin/post-new.php1,564 ▲3823.38 ▲0.35661.45 ▼10.4660.79 ▲4.21
Media Library /wp-admin/upload.php1,445 ▲454.29 ▲0.11102.14 ▼5.6142.88 ▼6.90
Settings list /wp-admin/admin.php?page=template_dictionary_settings9861.7027.3133.45
Add settings /wp-admin/admin.php?page=template_dictionary_add_edit_setting1,1891.6624.5233.88
Add value /wp-admin/admin.php?page=template_dictionary_edit_value1,0243.3342.0225.09
Template Dictionary /wp-admin/admin.php?page=template_dictionary1,0251.6726.1729.30
Export/Import /wp-admin/admin.php?page=template_dictionary_export_import1,0392.1335.9934.97

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_tdict_text
    • wp_tdict_int
    • wp_tdict_varchar
    • wp_tdict
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • template-dictionary-version
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: dictionary, settings, variables, template, options

template-dictionary/template-dictionary.php Passed 13 tests

The principal PHP file in "Template Dictionary" v. 1.6.1 is loaded by WordPress automatically on each request
89 characters long description:
A plugin for developers which provides template variables dictionary editable in backend.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin2,260 lines of code in 77 files:
LanguageFilesBlank linesComment linesLines of code
PHP235124192,109
JavaScript497247135
CSS591116

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity14.29
▷ Minimum class complexity2.00
▷ Maximum class complexity128.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes15.88%
▷ Concrete classes1694.12%
▷ Final classes16.25%
Methods152
▷ Static methods21.32%
▷ Public methods11978.29%
▷ Protected methods00.00%
▷ Private methods3321.71%
Functions3
▷ Named functions3100.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
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
admin/css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
admin/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
admin/css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
admin/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%