84% heart-this

Code Review | HeartThis

WordPress plugin HeartThis scored84%from 54 tests.

About plugin

  • Plugin page: heart-this
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.5.3
  • WordPress version: 6.3.1
  • First release: Aug 7, 2016
  • Latest release: Aug 7, 2016
  • Number of updates: 4
  • Update frequency: every 1.3 days
  • Top authors: fatmedia (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /9,298 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.28ms] Passed 4 tests

A check of server-side resources used by HeartThis
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1239.17 ▲2.39
Dashboard /wp-admin3.41 ▲0.0653.08 ▼6.07
Posts /wp-admin/edit.php3.52 ▲0.1745.43 ▲0.99
Add New Post /wp-admin/post-new.php5.99 ▲0.1083.17 ▼13.26
Media Library /wp-admin/upload.php3.33 ▲0.1035.66 ▲1.24
HeartThis /wp-admin/options-general.php?page=heart-this3.3032.41

Server storage [IO: ▲0.10MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 42 new files
Database: no new tables, 8 new options
New WordPress options
widget_heart-this-widget
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
heart_this_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for HeartThis
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲14413.54 ▼0.815.87 ▲4.0641.23 ▼0.12
Dashboard /wp-admin2,210 ▲224.79 ▼0.12109.52 ▲6.8042.60 ▲1.85
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0135.49 ▼2.2232.07 ▼5.37
Add New Post /wp-admin/post-new.php1,536 ▲1422.86 ▼0.33653.93 ▼31.1356.48 ▼7.99
Media Library /wp-admin/upload.php1,392 ▲44.21 ▲0.0199.24 ▼4.0244.66 ▼1.50
HeartThis /wp-admin/options-general.php?page=heart-this8742.0325.0330.32

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_heart-this-widget
    • can_compress_scripts
    • 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)
Good news, no errors were detected

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
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/heart-this/admin/views/settings-page.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/heart-this/admin/views/setting-instructions.php:12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/heart-this/includes/widgets/views/display-popular-posts.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/heart-this/includes/widgets/views/display-popular-posts.php:21
    • > PHP Notice
      Undefined variable: checked in wp-content/plugins/heart-this/admin/views/setting-ajax-hearts.php on line 13
    • > PHP Notice
      Undefined variable: checked in wp-content/plugins/heart-this/admin/views/setting-enable-css.php on line 13
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/heart-this/includes/widgets/views/display-popular-posts.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/heart-this/admin/views/setting-ajax-hearts.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function heart_this_admin_get_show_option_values() in wp-content/plugins/heart-this/admin/views/setting-show-on.php:14
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/heart-this/admin/views/setting-ajax-hearts.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
1 plugin tags: cool stuff

heart-this/heart-this.php Passed 13 tests

The principal PHP file in "HeartThis" v. 0.1.0 is loaded by WordPress automatically on each request
82 characters long description:
Add a simple heart button to let people tell you they love your WordPress content.

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 detected1,245 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP26194855671
JavaScript612744413
CSS41414144
Markdown212017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions53
▷ Named functions53100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/heart-animation.png11.42KB12.44KB0.00%
images/src/heart-animation.png11.42KB12.44KB0.00%