79% hcard-widget

Code Review | hCard Widget for WordPress

WordPress plugin hCard Widget for WordPress scored79%from 54 tests.

About plugin

  • Plugin page: hcard-widget
  • Plugin version: 2.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Nov 5, 2012
  • Latest release: Nov 3, 2016
  • Number of updates: 82
  • Update frequency: every 19.6 days
  • Top authors: michaellautman (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /10,546 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 successfully, without throwing any errors or notices

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

A check of server-side resources used by hCard Widget for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.08 ▼4.46
Dashboard /wp-admin3.31 ▲0.0045.74 ▼5.88
Posts /wp-admin/edit.php3.36 ▲0.0049.86 ▲0.74
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.36 ▼14.68
Media Library /wp-admin/upload.php3.23 ▲0.0034.37 ▼0.29

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by hCard Widget for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.19 ▼1.101.62 ▼0.2841.82 ▲4.38
Dashboard /wp-admin2,209 ▲214.86 ▲0.01112.01 ▲6.0241.84 ▼0.89
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0438.77 ▼2.2634.91 ▼1.51
Add New Post /wp-admin/post-new.php1,514 ▼2817.55 ▼0.89668.27 ▼10.4858.93 ▼0.26
Media Library /wp-admin/upload.php1,391 ▲34.20 ▼0.0793.51 ▼5.7944.32 ▲3.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please fix the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/hcard-widget/parts/widgets/individual.php
    • > /wp-content/plugins/hcard-widget/parts/widgets/organization.php
    • > /wp-content/plugins/hcard-widget/parts/help/css-help.php
  • 95× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/hcard-widget/parts/widgets/individual.php on line 19
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/hcard-widget/parts/widgets/individual.php on line 91
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/hcard-widget/parts/widgets/individual.php on line 46
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/hcard-widget/parts/widgets/individual.php on line 97
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/hcard-widget/parts/widgets/organization.php on line 137
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/hcard-widget/parts/widgets/organization.php on line 25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/hcard-widget/parts/widgets/organization.php on line 129
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/hcard-widget/parts/widgets/organization.php on line 129
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/hcard-widget/parts/widgets/individual.php on line 85
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/hcard-widget/parts/widgets/organization.php on line 141

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: seo, widget piklist, schemaorg, hcard, local seo...

hcard-widget/hcard-widget.php Passed 13 tests

Analyzing the main PHP file in "hCard Widget for WordPress" version 2.2.2
79 characters long description:
Creates widget that outputs contact information in Schema.org compliant format.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected2,390 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP111,1581151,221
CSS127631,022
PO File15370147

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity24.33
▷ Minimum class complexity22.00
▷ Maximum class complexity28.00
Average method complexity4.68
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods526.32%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.08MB with 0.08MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
hcard-logo.png86.22KB8.73KB▼ 89.88%