78% chartbeat

Code Review | Chartbeat

WordPress plugin Chartbeat scored78%from 54 tests.

About plugin

  • Plugin page: chartbeat
  • Plugin version: 2.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.7.2
  • WordPress version: 6.3.1
  • First release: Nov 20, 2009
  • Latest release: Jul 2, 2020
  • Number of updates: 50
  • Update frequency: every 77.6 days
  • Top authors: chartbeat (72%)hswolff (18%)breauxc (14%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /578,919 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼5.54ms] Passed 4 tests

Server-side resources used by Chartbeat
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1041.05 ▲0.04
Dashboard /wp-admin3.42 ▲0.1147.62 ▼6.28
Posts /wp-admin/edit.php3.53 ▲0.1751.24 ▼0.74
Add New Post /wp-admin/post-new.php6.00 ▲0.1185.35 ▼14.83
Media Library /wp-admin/upload.php3.34 ▲0.1134.94 ▼0.30
Chartbeat /wp-admin/options-general.php?page=chartbeat-options3.3137.56

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_chartbeat_widget
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Chartbeat
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11313.25 ▼1.112.04 ▲0.2948.15 ▲2.35
Dashboard /wp-admin2,240 ▲525.83 ▼0.03106.66 ▲3.9188.99 ▲47.57
Posts /wp-admin/edit.php2,119 ▲332.19 ▲0.1940.47 ▲0.3935.02 ▼0.40
Add New Post /wp-admin/post-new.php1,547 ▲523.15 ▲0.13660.96 ▼47.1160.40 ▲7.83
Media Library /wp-admin/upload.php1,422 ▲344.14 ▼0.05102.41 ▲5.8770.13 ▲27.74
Chartbeat /wp-admin/options-general.php?page=chartbeat-options1,0261.8526.3733.45

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_chartbeat_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/chartbeat/chartbeat.php:31

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=chartbeat-options
    • > Security (severe) in unknown
    /wp-admin/options-general.php?page=chartbeat-options - Refused to execute script from '/wp-admin/admin-ajax.php?action=cbproxy-submit&url=%2Ftoppages%2F%3Fjsonp%3DCBTopPagesWidget.callback%26limit%3D10&cbnonce=f4c4727337' because its MIME type ('application/jsonp') is not executable, and strict MIME type checking is enabled.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: A description for screenshot #2 is required in chartbeat/assets to your readme.txt
You can look at the official readme.txt

chartbeat/chartbeat.php Passed 13 tests

The entry point to "Chartbeat" version 2.0.7 is a PHP file that has certain tags in its header comment area
36 characters long description:
Adds Chartbeat pinging to Wordpress.

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 detected953 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP18843548
CSS1290274
JavaScript2527131

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity2.50
▷ Minimum method complexity2.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.75MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png194.81KB54.52KB▼ 72.02%
media/chartbeat.png4.76KB1.85KB▼ 61.13%
assets/icon-256x256.png4.76KB1.85KB▼ 61.13%
assets/screenshot-2.png461.18KB133.89KB▼ 70.97%
assets/screenshot-1.png104.97KB33.42KB▼ 68.16%