83% hoo-document-importer

Code Review | Hoo Docx Document File Importer

WordPress plugin Hoo Docx Document File Importer scored83%from 54 tests.

About plugin

  • Plugin page: hoo-document-impo...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.0.2
  • WordPress version: 6.3.1
  • First release: Nov 2, 2021
  • Latest release: Sep 21, 2022
  • Number of updates: 12
  • Update frequency: every 26.9 days
  • Top authors: hoosoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,185 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼0.88ms] Passed 4 tests

A check of server-side resources used by Hoo Docx Document File Importer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1737.26 ▲0.86
Dashboard /wp-admin3.55 ▲0.2551.14 ▲0.93
Posts /wp-admin/edit.php3.61 ▲0.2551.03 ▲3.51
Add New Post /wp-admin/post-new.php6.05 ▲0.1682.21 ▼8.83
Media Library /wp-admin/upload.php3.40 ▲0.1638.21 ▲3.86
Hoo Docx Document File Importer /wp-admin/options-general.php?page=hoo-document-importer5.1661.60

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 671 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hoo Docx Document File Importer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲20015.11 ▲0.811.85 ▼0.1041.99 ▼1.58
Dashboard /wp-admin2,352 ▲1676.46 ▲0.60131.33 ▲28.5940.28 ▼0.50
Posts /wp-admin/edit.php2,258 ▲1693.34 ▲1.3450.98 ▲9.3632.35 ▼3.45
Add New Post /wp-admin/post-new.php1,532 ▲1323.22 ▼0.22626.52 ▲26.9735.72 ▼12.53
Media Library /wp-admin/upload.php1,391 ▲34.17 ▼0.0984.61 ▼10.9642.70 ▼1.04
Hoo Docx Document File Importer /wp-admin/options-general.php?page=hoo-document-importer1,0263.1739.5024.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 394× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Reader\\Word2007\\AbstractPart' not found in wp-content/plugins/hoo-document-importer/vendor/phpoffice/phpword/src/PhpWord/Reader/Word2007/Styles.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Element\\AbstractElement' not found in wp-content/plugins/hoo-document-importer/vendor/phpoffice/phpword/src/PhpWord/Element/TOC.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\Word2007\\Element\\AbstractElement' not found in wp-content/plugins/hoo-document-importer/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/ListItemRun.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\AbstractWriter' not found in wp-content/plugins/hoo-document-importer/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/hoo-document-importer/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\Word2007\\Style\\AbstractStyle' not found in wp-content/plugins/hoo-document-importer/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/AbstractStyle.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Shared\\AbstractEnum' not found in wp-content/plugins/hoo-document-importer/vendor/phpoffice/phpword/src/PhpWord/SimpleType/LineSpacingRule.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\ODText\\Element\\AbstractElement' not found in wp-content/plugins/hoo-document-importer/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Title.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\Word2007\\Element\\AbstractElement' not found in wp-content/plugins/hoo-document-importer/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/AbstractElement.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Element\\AbstractElement' not found in wp-content/plugins/hoo-document-importer/vendor/phpoffice/phpword/src/PhpWord/Element/Row.php:27

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 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can take inspiration from this readme.txt

hoo-document-importer/hoo-document-importer.php 85% from 13 tests

The primary PHP file in "Hoo Docx Document File Importer" version 1.0.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Description: Keep the plugin description shorter than 140 characters (currently 185 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected44,494 lines of code in 650 files:
LanguageFilesBlank linesComment linesLines of code
PHP5008,45826,05139,156
reStructuredText1142,4942,4092,934
Markdown121940804
JSON800722
YAML78638385
JavaScript2302155
make1245124
XML363105
Twig17058
Python17316533
CSS11018

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 116)
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity9.38
▷ Minimum class complexity1.00
▷ Maximum class complexity553.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity116.00
Code structure
Namespaces58
Interfaces15
Traits0
Classes464
▷ Abstract classes357.54%
▷ Concrete classes42992.46%
▷ Final classes7417.25%
Methods2,624
▷ Static methods2449.30%
▷ Public methods2,13381.29%
▷ Protected methods1967.47%
▷ Private methods29511.24%
Functions172
▷ Named functions15590.12%
▷ Anonymous functions179.88%
Constants606
▷ Global constants7512.38%
▷ Class constants53187.62%
▷ Public constants53099.81%

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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/phpoffice/phpword/src/PhpWord/resources/xls.png1.88KB1.82KB▼ 3.27%
vendor/phpoffice/phpword/src/PhpWord/resources/ppt.png1.84KB1.79KB▼ 2.97%
vendor/phpoffice/phpword/src/PhpWord/resources/doc.png1.13KB1.09KB▼ 3.37%