88% wp-ajax-comments-template

Code Review | WP AJAX Comments Template

WordPress plugin WP AJAX Comments Template scored 88% from 54 tests.

About plugin

  • Plugin page: wp-ajax-comments-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.6
  • WordPress version: 5.8.1
  • First release: Nov 1, 2013
  • Latest release: Nov 1, 2013
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: JaynneGomes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 899 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼145.91ms] Passed 4 tests

This is a short check of server-side resources used by WP AJAX Comments Template
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0435.02 ▲0.81
Dashboard /wp-admin3.11 ▲0.0547.21 ▼3.49
Posts /wp-admin/edit.php3.16 ▲0.0542.88 ▼2.20
Add New Post /wp-admin/post-new.php5.46 ▲0.0393.13 ▼578.74
Media Library /wp-admin/upload.php3.05 ▲0.0533.79 ▲3.93
All Comments /wp-admin/edit-comments.php3.1137.86
Configurações /wp-admin/edit-comments.php?page=configuracao-comentario3.0528.77

Server storage [IO: ▲0.07MB] [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, no new options

Browser metrics Passed 4 tests

Checking browser requirements for WP AJAX Comments Template
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,702 ▲10616.03 ▲0.6310.16 ▲0.9846.90 ▼2.11
Dashboard /wp-admin2,993 ▲565.87 ▼0.12139.19 ▼9.64108.67 ▼12.10
Posts /wp-admin/edit.php2,762 ▲232.73 ▲0.0170.12 ▲4.1080.58 ▼13.83
Add New Post /wp-admin/post-new.php1,619 ▼2,07018.55 ▲3.48350.92 ▼149.13108.66 ▼8.81
Media Library /wp-admin/upload.php1,833 ▲235.04 ▼0.00163.39 ▲9.78111.28 ▲0.57
All Comments /wp-admin/edit-comments.php2,4312.9069.2487.92
Configurações /wp-admin/edit-comments.php?page=configuracao-comentario1,1522.0954.1382.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/edit-comments.php?page=configuracao-comentario
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/edit-comments.php?page=configuracao-comentario
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% 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
Please fix the following
  • 4× 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/wp-ajax-comments-template/submenu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-ajax-comments-template/submenu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_password_required() in wp-content/plugins/wp-ajax-comments-template/comments.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-ajax-comments-template/ajax.php:140

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Settings Panel on Administrator Area), #2 (Single post comment area with the plugin activated.)
The official readme.txt is a good inspiration

wp-ajax-comments-template/WP-AJAX-Comments-Template.php 85% from 13 tests

"WP AJAX Comments Template" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 253 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-ajax-comments-template.php" instead of "WP-AJAX-Comments-Template.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected335 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP613932335

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png30.65KB11.22KB▼ 63.39%
screenshot-1.png23.59KB13.01KB▼ 44.85%