78% wp-toggle-comments-form-fields

Code Review | WP Toggle Comments Form

WordPress plugin WP Toggle Comments Form scored78%from 54 tests.

About plugin

  • Plugin page: wp-toggle-comment...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Oct 30, 2014
  • Latest release: Nov 2, 2014
  • Number of updates: 23
  • Update frequency: every 0.2 days
  • Top authors: erez_lieberman (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,149 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.02MB] [CPU: ▼16.48ms] Passed 4 tests

A check of server-side resources used by WP Toggle Comments Form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0723.59 ▼17.44
Dashboard /wp-admin3.32 ▼0.0346.28 ▼23.22
Posts /wp-admin/edit.php3.37 ▲0.0147.11 ▲2.81
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.40 ▼23.46
Media Library /wp-admin/upload.php3.24 ▲0.0131.91 ▼1.80
WP toggle comments /wp-admin/options-general.php?page=wp-toggle-comments3.2129.21

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Toggle Comments Form
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲14614.13 ▼0.555.89 ▲4.2036.12 ▼7.71
Dashboard /wp-admin2,209 ▲185.76 ▲0.8095.93 ▼9.5737.65 ▼5.12
Posts /wp-admin/edit.php2,095 ▲62.04 ▲0.0440.27 ▲3.9835.30 ▼2.09
Add New Post /wp-admin/post-new.php1,538 ▲1923.05 ▲0.00668.23 ▼2.2050.89 ▼9.60
Media Library /wp-admin/upload.php1,391 ▲64.23 ▼0.0593.50 ▼10.5041.37 ▼5.10
WP toggle comments /wp-admin/options-general.php?page=wp-toggle-comments8942.0827.0423.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-toggle-comments
    • > Notice in wp-content/plugins/wp-toggle-comments-form-fields/inc/options-page-wrapper.php+48
    Undefined variable: using_options

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-toggle-comments-form-fields/inc/options-page-wrapper.php:4
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-toggle-comments-form-fields/wp-toggle-comments.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-toggle-comments-form-fields/wp-toggle-comments.php:27

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

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: jquery, shortcode, comments

wp-toggle-comments-form-fields/wp-toggle-comments.php 85% from 13 tests

The principal PHP file in "WP Toggle Comments Form" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-toggle-comments-form-fields.php" instead of "wp-toggle-comments.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin207 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP210847130
PO File191136
JavaScript114235
CSS2586

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin