84% twc-templates-wp-comments

Code Review | TWC-Templates-WP-Comments

WordPress plugin TWC-Templates-WP-Comments scored84%from 54 tests.

About plugin

  • Plugin page: twc-templates-wp-...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.2.2
  • WordPress version: 6.3.1
  • First release: Jan 24, 2015
  • Latest release: Jul 15, 2015
  • Number of updates: 14
  • Update frequency: every 12.4 days
  • Top authors: Chaika88 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,110 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼9.09ms] Passed 4 tests

An overview of server-side resources used by TWC-Templates-WP-Comments
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.11 ▲0.44
Dashboard /wp-admin3.37 ▲0.0749.74 ▼3.63
Posts /wp-admin/edit.php3.42 ▲0.0745.27 ▼6.13
Add New Post /wp-admin/post-new.php5.95 ▲0.0782.35 ▼26.33
Media Library /wp-admin/upload.php3.30 ▲0.0735.56 ▼0.28
TWC Option /wp-admin/options-general.php?page=TWC_Option_Ident3.3039.62

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 16 new options
New WordPress options
twc_option_TXT_comm_h2
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
twc_option_TXT_comm_input1
twc_option_TXT_comm_input2
twc_option_butt
widget_theysaidso_widget
twc_option_TXT_comm_form_h2
...

Browser metrics Passed 4 tests

Checking browser requirements for TWC-Templates-WP-Comments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.17 ▼0.441.73 ▼0.2543.88 ▲4.58
Dashboard /wp-admin2,199 ▲225.65 ▲0.0594.11 ▼11.1141.89 ▲2.96
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0032.83 ▼9.7435.15 ▼1.11
Add New Post /wp-admin/post-new.php1,529 ▼822.87 ▲4.72653.65 ▲45.6954.37 ▼13.96
Media Library /wp-admin/upload.php1,407 ▲74.13 ▼0.0995.77 ▼4.6642.17 ▲0.43
TWC Option /wp-admin/options-general.php?page=TWC_Option_Ident1,0553.0440.6058.70

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 16 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • twc_option_img_cite
    • twc_option_TXT_comm_textarea
    • twc_option_butt
    • twc_option_TXT_comm_input1
    • widget_recent-posts
    • twc_option_TXT_comm_no_comm
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function comments_open() in wp-content/plugins/twc-templates-wp-comments/templates/comments1.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/twc-templates-wp-comments/TWC-Templates-WP-Comments.php:52

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: comments, spam

twc-templates-wp-comments/TWC-Templates-WP-Comments.php 85% from 13 tests

The main PHP script in "TWC-Templates-WP-Comments" version 0.3 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("twc-templates-wp-comments.php" instead of "TWC-Templates-WP-Comments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected657 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP32642292
PO File25560158
CSS200108
JavaScript20099

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.34
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
Namespaces0
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%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/add-img.png4.10KB0.61KB▼ 85.10%
templates/img/str-1.png3.15KB0.34KB▼ 89.25%
templates/img/str-2.png3.18KB0.34KB▼ 89.33%