84% ctrlenter-publishes-comments

Code Review | Ctrl+Enter Publishes Comments

WordPress plugin Ctrl+Enter Publishes Comments scored84%from 54 tests.

About plugin

  • Plugin page: ctrlenter-publish...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Aug 29, 2014
  • Latest release: Nov 11, 2016
  • Number of updates: 4
  • Update frequency: every 201.5 days
  • Top authors: bi0xid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /785 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.67ms] Passed 4 tests

Server-side resources used by Ctrl+Enter Publishes Comments
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0037.10 ▼5.09
Dashboard /wp-admin3.35 ▲0.0050.17 ▼2.62
Posts /wp-admin/edit.php3.40 ▲0.0052.82 ▼0.56
Add New Post /wp-admin/post-new.php5.93 ▲0.0089.11 ▼2.39
Media Library /wp-admin/upload.php3.27 ▲0.0037.60 ▲1.31

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Ctrl+Enter Publishes Comments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5614.27 ▼0.112.54 ▲1.0036.69 ▼6.62
Dashboard /wp-admin2,192 ▲155.62 ▼0.0591.68 ▲1.5338.41 ▼1.92
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0139.66 ▼1.7536.62 ▼3.51
Add New Post /wp-admin/post-new.php1,526 ▼323.07 ▲0.01694.62 ▲0.1950.20 ▼10.69
Media Library /wp-admin/upload.php1,400 ▼04.13 ▲0.0297.86 ▼20.1743.14 ▼7.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ctrlenter-publishes-comments/ctrl-enter.php:31

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Example of comment) image not found
The official readme.txt is a good inspiration

ctrlenter-publishes-comments/ctrl-enter.php 92% from 13 tests

The main PHP script in "Ctrl+Enter Publishes Comments" version 0.2 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ctrlenter-publishes-comments.php" instead of "ctrl-enter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected22 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP172518
Markdown1204

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png100.34KB48.61KB▼ 51.55%