84% hatenablog-auto-migration

Code Review | hatenablog auto migration

WordPress plugin hatenablog auto migration scored84%from 54 tests.

About plugin

  • Plugin page: hatenablog-auto-m...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8.0-5.4.1
  • WordPress version: 6.3.1
  • First release: May 13, 2020
  • Latest release: May 13, 2020
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: tadatsu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /364 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼6.34ms] Passed 4 tests

Server-side resources used by hatenablog auto migration
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4139.98 ▼1.49
Dashboard /wp-admin3.72 ▲0.3744.78 ▼17.22
Posts /wp-admin/edit.php3.77 ▲0.4149.05 ▼0.33
Add New Post /wp-admin/post-new.php6.24 ▲0.3595.00 ▼6.30
Media Library /wp-admin/upload.php3.64 ▲0.4135.99 ▲3.83
はてなブログ設定 /wp-admin/options-general.php?page=hatena_blog_auto-option3.5432.75

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 149 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by hatenablog auto migration
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.29 ▼1.451.62 ▼0.2337.89 ▼6.90
Dashboard /wp-admin2,213 ▲224.84 ▼1.03112.58 ▲5.4746.97 ▲1.64
Posts /wp-admin/edit.php2,093 ▲12.00 ▲0.0439.97 ▼2.4239.23 ▲1.70
Add New Post /wp-admin/post-new.php1,533 ▼922.93 ▲4.69597.65 ▼30.1956.36 ▲4.94
Media Library /wp-admin/upload.php1,386 ▲14.25 ▲0.0698.19 ▼2.2746.34 ▲0.42
はてなブログ設定 /wp-admin/options-general.php?page=hatena_blog_auto-option8392.0527.3978.65

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 44× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/psr7/src/Stream.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/promises/src/RejectedPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/psr7/src/FnStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/promises/src/EachPromise.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/promises/src/CancellationException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/promises/src/AggregateException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/psr7/src/InflateStream.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Psr7\\Request' not found in wp-content/plugins/hatenablog-auto-migration/vendor/guzzlehttp/psr7/src/ServerRequest.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: hatenablog

hatenablog-auto-migration/hatenablog-auto-migrator.php 92% from 13 tests

This is the main PHP file of "hatenablog auto migration" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hatenablog-auto-migration.php" instead of "hatenablog-auto-migrator.php")

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
There were no executable files found in this plugin16,306 lines of code in 138 files:
LanguageFilesBlank linesComment linesLines of code
PHP1072,0065,13611,959
Markdown131,03803,271
JSON1000829
XML600228
Dockerfile18010
make1409

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity15.33
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces13
Interfaces15
Traits2
Classes71
▷ Abstract classes00.00%
▷ Concrete classes71100.00%
▷ Final classes1318.31%
Methods709
▷ Static methods12617.77%
▷ Public methods57981.66%
▷ Protected methods40.56%
▷ Private methods12617.77%
Functions206
▷ Named functions10651.46%
▷ Anonymous functions10048.54%
Constants107
▷ Global constants4441.12%
▷ Class constants6358.88%
▷ Public constants63100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin