84% ajax-heartbeat-tool

Code Review | AJAX Heartbeat Tool

WordPress plugin AJAX Heartbeat Tool scored84%from 54 tests.

About plugin

  • Plugin page: ajax-heartbeat-tool
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.7.2
  • WordPress version: 6.3.1
  • First release: Apr 14, 2014
  • Latest release: Aug 14, 2021
  • Number of updates: 14
  • Update frequency: every 191.5 days
  • Top authors: vizkr (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

700+ active /11,322 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.73ms] Passed 4 tests

Analyzing server-side resources used by AJAX Heartbeat Tool
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.19 ▲1.99
Dashboard /wp-admin3.31 ▲0.0143.02 ▼2.00
Posts /wp-admin/edit.php3.37 ▲0.0142.32 ▼3.37
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.93 ▼19.03
Media Library /wp-admin/upload.php3.24 ▲0.0133.11 ▼2.53

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by AJAX Heartbeat Tool
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,782 ▲2114.17 ▼0.191.50 ▼0.1342.20 ▲3.17
Dashboard /wp-admin2,185 ▲55.54 ▼0.1183.49 ▼5.4339.48 ▼1.68
Posts /wp-admin/edit.php2,097 ▼31.98 ▼0.0134.81 ▼1.6033.22 ▼5.84
Add New Post /wp-admin/post-new.php1,526 ▼223.45 ▲0.57655.56 ▲3.9449.45 ▼12.37
Media Library /wp-admin/upload.php1,396 ▼44.13 ▼0.14100.83 ▼13.2242.61 ▼4.41

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

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 everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ajax-heartbeat-tool/plugin.php:57

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Screenshot #1 (Since there's no settings page there is nothing to see here... yet.) image missing
The official readme.txt might help

ajax-heartbeat-tool/plugin.php 92% from 13 tests

The main file in "AJAX Heartbeat Tool" v. 1.4.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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-heartbeat-tool.php" instead of "plugin.php")

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 detected88 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods233.33%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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