84% toggle-comments

Code Review | Global Toggle Comments

WordPress plugin Global Toggle Comments scored84%from 54 tests.

About plugin

  • Plugin page: toggle-comments
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 20, 2015
  • Latest release: Nov 19, 2015
  • Number of updates: 6
  • Update frequency: every 30.5 days
  • Top authors: jackreichert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,383 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

An overview of server-side resources used by Global Toggle Comments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0439.88 ▲3.93
Dashboard /wp-admin3.36 ▲0.0545.97 ▼2.40
Posts /wp-admin/edit.php3.48 ▲0.1142.96 ▼4.09
Add New Post /wp-admin/post-new.php5.94 ▲0.0579.20 ▼11.66
Media Library /wp-admin/upload.php3.28 ▲0.0537.24 ▲4.20
Toggle Comments /wp-admin/options-general.php?page=toggle-comments3.2539.63

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Global Toggle Comments
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.18 ▼0.341.73 ▲0.1047.47 ▲4.02
Dashboard /wp-admin2,199 ▲225.62 ▼0.0581.31 ▼6.5240.26 ▼4.03
Posts /wp-admin/edit.php2,104 ▲72.04 ▼0.0034.68 ▼3.0735.39 ▼0.15
Add New Post /wp-admin/post-new.php1,529 ▲123.64 ▲0.56675.44 ▲12.6056.20 ▼0.33
Media Library /wp-admin/upload.php1,407 ▲134.18 ▲0.0195.97 ▼1.8043.70 ▼1.05
Toggle Comments /wp-admin/options-general.php?page=toggle-comments1,1281.9533.7927.63

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toggle-comments/toggle-comments.php:15

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 97% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Requires at least: The plugin version is formatted incorrectly
You can look at the official readme.txt

toggle-comments/toggle-comments.php Passed 13 tests

"Global Toggle Comments" version 0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
47 characters long description:
Turn WordPress comment functionality on or off.

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
There were no executable files found in this plugin245 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP14231202
CSS16043

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin