84% show-comment-policy

Code Review | Show Comment Policy

WordPress plugin Show Comment Policy scored84%from 54 tests.

About plugin

  • Plugin page: show-comment-policy
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9
  • WordPress version: 6.3.1
  • First release: Apr 19, 2014
  • Latest release: Jan 20, 2015
  • Number of updates: 13
  • Update frequency: every 21.2 days
  • Top authors: jp2112 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,543 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.90ms] Passed 4 tests

Analyzing server-side resources used by Show Comment Policy
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.20 ▲1.69
Dashboard /wp-admin3.39 ▲0.0848.83 ▼4.27
Posts /wp-admin/edit.php3.50 ▲0.1447.84 ▼0.24
Add New Post /wp-admin/post-new.php5.97 ▲0.0892.12 ▼11.01
Media Library /wp-admin/upload.php3.31 ▲0.0834.14 ▼0.07
Show Comment Policy /wp-admin/options-general.php?page=show-comment-policy3.2832.89

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Show Comment Policy
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.26 ▼1.054.66 ▲3.0643.16 ▲4.58
Dashboard /wp-admin2,207 ▲196.01 ▲0.2094.55 ▼19.8739.59 ▼9.03
Posts /wp-admin/edit.php2,093 ▲11.99 ▼0.0133.65 ▼4.6632.43 ▼1.65
Add New Post /wp-admin/post-new.php1,536 ▲323.46 ▲0.11602.68 ▼68.4749.76 ▼1.89
Media Library /wp-admin/upload.php1,392 ▲44.20 ▼0.0096.73 ▼3.3343.26 ▼0.43
Show Comment Policy /wp-admin/options-general.php?page=show-comment-policy9012.0224.9740.17

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/show-comment-policy/show-comment-policy.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: policy, comments, blog

show-comment-policy/show-comment-policy.php Passed 13 tests

The principal PHP file in "Show Comment Policy" v. 0.1.2 is loaded by WordPress automatically on each request
70 characters long description:
Display your comment policy above the comments form on posts or pages.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin264 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP31638259
CSS1005

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants18100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/policy.png2.23KB1.98KB▼ 11.05%
images/settings.png2.11KB2.31KB0.00%
images/support.png5.03KB2.79KB▼ 44.54%