84% indesignhtml2post

Code Review | InDesign HTML 2 Post

WordPress plugin InDesign HTML 2 Post scored84%from 54 tests.

About plugin

  • Plugin page: indesignhtml2post
  • Plugin version: 1.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 6.3.1
  • First release: Mar 29, 2019
  • Latest release: Jun 29, 2021
  • Number of updates: 45
  • Update frequency: every 18.3 days
  • Top authors: munger41 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,451 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.31MB] [CPU: ▼4.96ms] Passed 4 tests

A check of server-side resources used by InDesign HTML 2 Post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3234.42 ▼1.88
Dashboard /wp-admin3.66 ▲0.3144.62 ▼13.39
Posts /wp-admin/edit.php3.77 ▲0.4145.13 ▼4.48
Add New Post /wp-admin/post-new.php6.14 ▲0.2591.43 ▼0.08
Media Library /wp-admin/upload.php3.58 ▲0.3537.32 ▲6.26
New Post from InDesign HTML export /wp-admin/edit.php?page=new-post-from-id-html3.5250.15
InDesign 2 Post /wp-admin/options-general.php?page=idesign2post-setting-admin3.5233.80

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

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

Browser metrics Passed 4 tests

Checking browser requirements for InDesign HTML 2 Post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲5114.39 ▼0.101.70 ▼0.0239.50 ▼1.57
Dashboard /wp-admin2,203 ▲335.62 ▼0.0480.52 ▼21.6136.70 ▼2.67
Posts /wp-admin/edit.php2,108 ▲82.01 ▼0.0236.82 ▼4.9432.56 ▼6.88
Add New Post /wp-admin/post-new.php1,541 ▲1318.48 ▼4.62604.66 ▼64.3264.47 ▲8.39
Media Library /wp-admin/upload.php1,408 ▲114.18 ▲0.02101.33 ▼27.0343.33 ▼15.68
New Post from InDesign HTML export /wp-admin/edit.php?page=new-post-from-id-html9452.0027.0251.82
InDesign 2 Post /wp-admin/options-general.php?page=idesign2post-setting-admin9972.0322.4435.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/edit.php?page=new-post-from-id-html
    • > Notice in wp-content/plugins/indesignhtml2post/InDesignHTML2Post.php+283
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=idesign2post-setting-admin
    • > Notice in wp-content/plugins/indesignhtml2post/SettingsPage.php+377
    Undefined variable: args
    • > GET request to /wp-admin/options-general.php?page=idesign2post-setting-admin
    • > Notice in wp-content/plugins/indesignhtml2post/SettingsPage.php+377
    Undefined variable: output
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=idesign2post-setting-admin
    • > Notice in wp-content/plugins/indesignhtml2post/SettingsPage.php+419
    Undefined variable: curent_resize_mode

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
Please take inspiration from this readme.txt

indesignhtml2post/InDesignHTML2Post.php 92% from 13 tests

The primary PHP file in "InDesign HTML 2 Post" version 1.6.5 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("indesignhtml2post.php" instead of "InDesignHTML2Post.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin37,770 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript292,7551,51433,756
PHP33203472,064
Sass141812553
CSS3456517
LESS5814334
JSON300328
TypeScript113144134
Markdown435084

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.29
Average class complexity95.67
▷ Minimum class complexity19.00
▷ Maximum class complexity229.00
Average method complexity5.08
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods67
▷ Static methods00.00%
▷ Public methods6089.55%
▷ Protected methods00.00%
▷ Private methods710.45%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/logoIndesign_128px.png3.24KB1.62KB▼ 50.09%