83% ajax-comment-with-sweet-alert

Code Review | Ajax Comment With Sweet Alert

WordPress plugin Ajax Comment With Sweet Alert scored83%from 54 tests.

About plugin

  • Plugin page: ajax-comment-with...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Jun 18, 2016
  • Latest release: Jun 18, 2016
  • Number of updates: 17
  • Update frequency: N/A
  • Top authors: hanhtrinhtuoitre (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,365 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

Analyzing server-side resources used by Ajax Comment With Sweet Alert
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0233.27 ▼9.41
Dashboard /wp-admin3.32 ▼0.0344.43 ▼13.87
Posts /wp-admin/edit.php3.37 ▲0.0147.55 ▼0.25
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.47 ▲3.31
Media Library /wp-admin/upload.php3.24 ▲0.0132.60 ▼0.38

Server storage [IO: ▲0.32MB] [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: 12 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ajax Comment With Sweet Alert
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲19613.70 ▼0.965.95 ▲4.2140.73 ▼11.28
Dashboard /wp-admin2,214 ▲294.91 ▼0.95103.51 ▼5.0738.89 ▼2.21
Posts /wp-admin/edit.php2,097 ▲82.04 ▲0.0140.43 ▼3.9533.83 ▼0.70
Add New Post /wp-admin/post-new.php1,522 ▼023.48 ▲0.06594.96 ▼87.6556.91 ▼1.29
Media Library /wp-admin/upload.php1,396 ▲114.34 ▲0.1597.85 ▲4.1942.03 ▲2.14

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ajax-comment-with-sweet-alert/function.php:13

User-side errors Passed 1 test

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


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Donate link: Invalid url: "hanhtrinhtuoitre.com"
The official readme.txt is a good inspiration

ajax-comment-with-sweet-alert/function.php 85% from 13 tests

"Ajax Comment With Sweet Alert" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ajax-comment-with-sweet-alert.php" instead of "function.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 175 characters long)

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
Good job! No executable or dangerous file extensions detected1,036 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions3100.00%
▷ Anonymous functions00.00%
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.26MB with 0.15MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
demo-2.png68.00KB30.89KB▼ 54.57%
demo-3.png77.93KB34.07KB▼ 56.28%
demo-1.png56.80KB20.91KB▼ 63.19%
demo-4.png67.36KB31.78KB▼ 52.82%