78% heartbeat-control

Code Review | Heartbeat Control

WordPress plugin Heartbeat Control scored78%from 54 tests.

About plugin

  • Plugin page: heartbeat-control
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.3
  • WordPress version: 6.3.1
  • First release: Nov 16, 2014
  • Latest release: Aug 31, 2023
  • Number of updates: 55
  • Update frequency: every 58.4 days
  • Top authors: JeffMatson (72.73%)wp_rocket (29.09%)

Code review

54 tests

User reviews

67 reviews

Install metrics

100,000+ active /1,068,480 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.90MB] [CPU: ▲3.54ms] 75% from 4 tests

An overview of server-side resources used by Heartbeat Control
Please take the time to fix the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,396.58ms on /wp-admin/options-general.php?page=heartbeat_control_settings)
PageMemory (MB)CPU Time (ms)
Home /4.09 ▲0.6350.57 ▲13.75
Dashboard /wp-admin4.35 ▲1.0457.20 ▲7.20
Posts /wp-admin/edit.php4.37 ▲1.0157.72 ▲9.47
Add New Post /wp-admin/post-new.php6.87 ▲0.9893.47 ▼11.57
Media Library /wp-admin/upload.php4.21 ▲0.9844.40 ▲9.05
Heartbeat Control /wp-admin/options-general.php?page=heartbeat_control_settings4.841,396.58

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 415 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
heartbeat_control_settings
db_upgraded
heartbeat_control_version
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Heartbeat Control
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.42 ▼0.082.14 ▲0.6139.74 ▼5.59
Dashboard /wp-admin2,213 ▲335.72 ▲0.0990.62 ▼0.1136.56 ▼6.89
Posts /wp-admin/edit.php2,114 ▲111.98 ▼0.0534.04 ▼2.8832.19 ▼3.59
Add New Post /wp-admin/post-new.php1,536 ▲1023.22 ▲0.18684.47 ▼28.3859.43 ▼1.61
Media Library /wp-admin/upload.php1,415 ▲154.32 ▲0.07102.82 ▲2.1844.99 ▲1.10
Heartbeat Control /wp-admin/options-general.php?page=heartbeat_control_settings1,7176.31139.6869.26

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • heartbeat_control_version
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • heartbeat_control_settings
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Please fix the following
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/heartbeat-control/Plugin_Card_Helper.php
    • > /wp-content/plugins/heartbeat-control/Settings.php
    • > /wp-content/plugins/heartbeat-control/Notices.php
    • > /wp-content/plugins/heartbeat-control/Imagify_Partner.php
    • > /wp-content/plugins/heartbeat-control/views/admin-page.php
  • 40× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/heartbeat-control/vendor/cmb2/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Select' not found in wp-content/plugins/heartbeat-control/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Select_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/heartbeat-control/vendor/cmb2/cmb2/includes/types/CMB2_Type_Counter_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/heartbeat-control/vendor/cmb2/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/heartbeat-control/vendor/cmb2/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup' not found in wp-content/plugins/heartbeat-control/vendor/cmb2/cmb2/includes/CMB2_Options_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Heartbeat_Control\\plugin_dir_path() in wp-content/plugins/heartbeat-control/heartbeat-control.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/heartbeat-control/vendor/cmb2/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/heartbeat-control/vendor/cmb2/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/heartbeat-control/vendor/cmb2/cmb2/includes/types/CMB2_Type_Title.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: server resources, admin-ajax, heartbeat api, heartbeat control, heartbeat...

heartbeat-control/heartbeat-control.php Passed 13 tests

"Heartbeat Control" version 2.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
44 characters long description:
Completely controls the WordPress heartbeat.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected57,205 lines of code in 251 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP732,6217,5339,187
JSON4006,701
CSS142951,1965,077
JavaScript83785881,530
Sass18306291,421
Markdown42510772
SVG909175
XML16319

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity20.35
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes78
▷ Abstract classes911.54%
▷ Concrete classes6988.46%
▷ Final classes00.00%
Methods658
▷ Static methods12519.00%
▷ Public methods54783.13%
▷ Protected methods10515.96%
▷ Private methods60.91%
Functions40
▷ Named functions3587.50%
▷ Anonymous functions512.50%
Constants19
▷ Global constants631.58%
▷ Class constants1368.42%
▷ Public constants13100.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
20 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/laptop.png56.45KB17.64KB▼ 68.75%
vendor/cmb2/cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
assets/img/noun_SEO_737036.png1.93KB1.92KB▼ 0.81%
vendor/cmb2/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
vendor/cmb2/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%