79% always-allow-admin-comments

Code Review | Always Allow Admin Comments

WordPress plugin Always Allow Admin Comments scored79%from 54 tests.

About plugin

  • Plugin page: always-allow-admi...
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 6.3.1
  • First release: Mar 10, 2016
  • Latest release: Oct 15, 2021
  • Number of updates: 12
  • Update frequency: every 170.4 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,997 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Server-side resources used by Always Allow Admin Comments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0541.59 ▼3.04
Dashboard /wp-admin3.35 ▲0.0550.57 ▼5.93
Posts /wp-admin/edit.php3.40 ▲0.0553.29 ▲1.91
Add New Post /wp-admin/post-new.php5.93 ▲0.0596.70 ▼14.36
Media Library /wp-admin/upload.php3.27 ▲0.0439.49 ▼1.59

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Always Allow Admin Comments: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.021.72 ▼0.5344.06 ▼1.04
Dashboard /wp-admin2,195 ▲185.49 ▼0.1384.77 ▼5.6439.74 ▲2.37
Posts /wp-admin/edit.php2,103 ▲32.00 ▼0.0040.19 ▲2.8535.76 ▲0.04
Add New Post /wp-admin/post-new.php6,224 ▲4,69825.93 ▲2.90929.30 ▲229.2952.99 ▲4.92
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.10100.57 ▼17.2543.62 ▼5.54

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/always-allow-admin-comments/tests/phpunit/bootstrap.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/always-allow-admin-comments/tests/phpunit/bootstrap.php on line 29
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/always-allow-admin-comments/tests/phpunit/bootstrap.php on line 29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: comment, page, comments_open, comments, commenting...

always-allow-admin-comments/always-allow-admin-comments.php Passed 13 tests

The entry point to "Always Allow Admin Comments" version 1.3.2 is a PHP file that has certain tags in its header comment area
118 characters long description:
Allow an admin user (when logged in) to always be able to comment on a post, even if comments are closed for the post.

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
Good job! No executable or dangerous file extensions detected577 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP4139242377
Markdown4530165
Bourne Shell16221
XML10014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity14.00
▷ Minimum class complexity8.00
▷ Maximum class complexity20.00
Average method complexity1.54
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods43
▷ Static methods511.63%
▷ Public methods4093.02%
▷ Protected methods00.00%
▷ Private methods36.98%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin