94% pz-hatenablogcard

Code Review | Pz-HatenaBlogCard

WordPress plugin Pz-HatenaBlogCard scored 94% from 54 tests.

About plugin

  • Plugin page: pz-hatenablogcard
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8.2
  • WordPress version: 5.8.1
  • First release: Aug 18, 2015
  • Latest release: Oct 17, 2017
  • Number of updates: 68
  • Update frequency: every 11.6 days
  • Top authors: poporon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active / 6,474 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

A check of server-side resources used by Pz-HatenaBlogCard
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2236.90 ▲13.43
Dashboard /wp-admin3.16 ▲0.1145.53 ▼5.26
Posts /wp-admin/edit.php3.21 ▲0.1044.88 ▼10.87
Add New Post /wp-admin/post-new.php5.52 ▲0.0891.72 ▼562.91
Media Library /wp-admin/upload.php3.10 ▲0.1035.21 ▲3.86
HatenaBlogCard /wp-admin/options-general.php?page=Pz_HatenaBlogCard_settings3.5230.07

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 1 new option
New WordPress options
Pz_HatenaBlogCard_options

Browser metrics Passed 4 tests

A check of browser resources used by Pz-HatenaBlogCard
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,738 ▲14216.08 ▲0.217.65 ▼1.4150.13 ▲3.72
Dashboard /wp-admin3,000 ▲666.49 ▲0.35140.97 ▼9.52110.41 ▼9.66
Posts /wp-admin/edit.php2,775 ▲362.75 ▲0.0566.14 ▼10.79113.50 ▲12.07
Add New Post /wp-admin/post-new.php1,630 ▼5317.76 ▼1.07346.26 ▼14.02104.43 ▼8.69
Media Library /wp-admin/upload.php1,843 ▲335.41 ▲0.38128.43 ▼17.00119.59 ▼4.53
HatenaBlogCard /wp-admin/options-general.php?page=Pz_HatenaBlogCard_settings4,7033.16113.10111.75

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% 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 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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pz-hatenablogcard/pz-hatenablogcard.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pz-hatenablogcard/pz-hatenablogcard-options.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pz-hatenablogcard/pz-hatenablogcard-style.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 ("Use shortcode [blogcard]"), #2 ("Display blogcard"), #3 ("Display blogcard with settings"), #4 ("Basic settings"), #5 ("Style settings"), #6 ("Letters settings"), #7 ("External link settings"), #8 ("Internal link settings"), #9 ("Use WebAPI settings"), #10 ("For debug settings"), #11 ("Initializing settings"), #12 ("Special format 'Celophane tape'")
The official readme.txt is a good inspiration

pz-hatenablogcard/pz-hatenablogcard.php Passed 13 tests

"Pz-HatenaBlogCard" version 1.3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
66 characters long description:
リンクを「はてなブログカード」で表示します。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,649 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4105631,310
PO File1183249338
JavaScript1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity112.00
▷ Minimum class complexity112.00
▷ Maximum class complexity112.00
Average method complexity13.33
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
12 PNG files occupy 0.24MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png33.14KB15.10KB▼ 54.45%
screenshot-1.png10.85KB7.57KB▼ 30.28%
screenshot-10.png41.44KB21.12KB▼ 49.03%
screenshot-3.png23.74KB10.40KB▼ 56.17%
screenshot-7.png30.50KB15.50KB▼ 49.20%