10% letter-template

Code Review | Letter Template

WordPress plugin Letter Template scored10%from 54 tests.

About plugin

  • Plugin page: letter-template
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7.0-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 10, 2015
  • Latest release: Nov 10, 2015
  • Number of updates: 4
  • Update frequency: every 5.3 days
  • Top authors: nobug (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,162 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
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/letter-template/wn-letter-template.php+522
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▼1.75MB] [CPU: ▼54.70ms] Passed 4 tests

Server-side resources used by Letter Template
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.25 ▼1.214.65 ▼34.90
Dashboard /wp-admin2.27 ▼1.0810.61 ▼46.93
Posts /wp-admin/edit.php2.28 ▼1.086.19 ▼45.01
Add New Post /wp-admin/post-new.php2.27 ▼3.626.08 ▼91.96
Media Library /wp-admin/upload.php2.27 ▼0.965.84 ▼25.80
All Businesses /wp-admin/edit.php?post_type=wnlt_business2.286.75
Add New /wp-admin/post-new.php?post_type=wnlt_business2.287.03
Letter Template /wp-admin/options-general.php?page=wnlt-setting2.286.35

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
widget_wnlt
db_upgraded

Browser metrics Passed 4 tests

Letter Template: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,958 ▲20113.96 ▼0.717.82 ▲5.7943.72 ▼4.27
Dashboard /wp-admin2,257 ▲695.25 ▼0.65111.63 ▲13.2440.26 ▼1.65
Posts /wp-admin/edit.php2,146 ▲512.37 ▲0.4038.77 ▼5.9033.48 ▼0.52
Add New Post /wp-admin/post-new.php1,585 ▲5218.40 ▼4.92635.05 ▼14.5035.64 ▼35.30
Media Library /wp-admin/upload.php1,448 ▲604.42 ▲0.2398.90 ▼5.0144.12 ▼0.37
All Businesses /wp-admin/edit.php?post_type=wnlt_business1,1342.3635.2627.97
Add New /wp-admin/post-new.php?post_type=wnlt_business1,4972.8051.6931.43
Letter Template /wp-admin/options-general.php?page=wnlt-setting1,0331.9530.5839.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/letter-template/wn-letter-template.php+522
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_wnlt
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wnlt-setting
    • > Warning in wp-content/plugins/letter-template/wn-letter-template.php+531
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wnlt-setting
    • > Notice in wp-content/plugins/letter-template/wn-letter-template.php+196
    Trying to access array offset on value of type bool

SRP 50% 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 items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/letter-template/wn-letter-template.php on line 531
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/letter-template/wn-letter-template.php:799
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/letter-template/wn-letter-template-widget.php:3
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/letter-template/wn-letter-template.php on line 522

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: template, claim, prefill, visitor input, cancellation...

letter-template/wn-letter-template.php 92% from 13 tests

The main PHP file in "Letter Template" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("letter-template.php" instead of "wn-letter-template.php")

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
There were no executable files found in this plugin1,730 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
CSS510227842
PHP2149111629
JavaScript63525259

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity26.50
▷ Minimum class complexity4.00
▷ Maximum class complexity49.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.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