78% export2word

Code Review | Export2Word

WordPress plugin Export2Word scored78%from 54 tests.

About plugin

  • Plugin page: export2word
  • Plugin version: 0.0.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.1
  • WordPress version: 6.3.1
  • First release: Dec 27, 2017
  • Latest release: Dec 8, 2019
  • Number of updates: 6
  • Update frequency: every 118.7 days
  • Top authors: jhotadhari (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,281 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.25MB] [CPU: ▼6.10ms] Passed 4 tests

This is a short check of server-side resources used by Export2Word
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2042.99 ▲6.06
Dashboard /wp-admin3.59 ▲0.2450.33 ▼17.58
Posts /wp-admin/edit.php3.64 ▲0.2954.84 ▼1.23
Add New Post /wp-admin/post-new.php6.20 ▲0.3193.95 ▼11.63
Media Library /wp-admin/upload.php3.51 ▲0.2842.04 ▲6.07
Export2Word /wp-admin/tools.php?page=export2word3.5038.11

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 1,297 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
e2w_version
e2w_db_version
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Export2Word: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7413.36 ▼0.854.39 ▲2.3241.02 ▼2.71
Dashboard /wp-admin2,242 ▲394.91 ▼0.97111.34 ▼5.1442.81 ▼3.50
Posts /wp-admin/edit.php2,118 ▲182.08 ▲0.0243.34 ▲6.9734.76 ▲0.31
Add New Post /wp-admin/post-new.php1,377 ▼15516.68 ▼6.51571.70 ▼105.7048.29 ▼9.15
Media Library /wp-admin/upload.php1,421 ▲184.24 ▲0.04102.14 ▲2.2745.44 ▼3.49
Export2Word /wp-admin/tools.php?page=export2word1,0132.2327.2727.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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 8 options in the database
    • e2w_version
    • widget_recent-comments
    • e2w_db_version
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/export2word/inc/fun/autoload/e2w_export_on_save_post.php
  • 662× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/export2word/vendor/phpoffice/phpword/tests/PhpWord/Style/TabTest.php:25
    • > PHP Fatal error
      Uncaught Exception: Could not find file '/autoload.php'. It is generated by Composer. Use 'install --prefer-source' or 'update --prefer-source' Composer commands to move forward. in wp-content/plugins/export2word/vendor/phpoffice/phpword/bootstrap.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\Stdlib\\Hydrator\\Filter\\FilterInterface' not found in wp-content/plugins/export2word/vendor/zendframework/zend-stdlib/src/Hydrator/Filter/OptionalParametersFilter.php:19
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/export2word/inc/fun/autoload/menu_page/class-e2w_list_table_documents.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/export2word/vendor/phpoffice/phpword/tests/PhpWord/Element/TextTest.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\HTML\\Style\\AbstractStyle' not found in wp-content/plugins/export2word/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Style/Font.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/export2word/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\Validator\\AbstractValidator' not found in wp-content/plugins/export2word/vendor/zendframework/zend-validator/src/File/Exists.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpWord\\Writer\\Word2007\\Style\\AbstractStyle' not found in wp-content/plugins/export2word/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Cell.php:27
    • > PHP Fatal error
      Uncaught Exception: Could not find file '/autoload.php'. It is generated by Composer. Use 'install --prefer-source' or 'update --prefer-source' Composer commands to move forward. in wp-content/plugins/export2word/vendor/phpoffice/phpword/bootstrap.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: phpword, docx, export, word

export2word/export2word.php Passed 13 tests

"Export2Word" version 0.0.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
35 characters long description:
Export a website as a docx document

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin121,601 lines of code in 1,078 files:
LanguageFilesBlank linesComment linesLines of code
PHP80812,81740,05259,486
PO File12013,78717,89031,582
JavaScript382,1562,98818,404
CSS221,2001,1985,243
Markdown2066002,082
Sass15291251,330
JSON14001,091
HTML13695760
reStructuredText13348319755
SVG201463
XML81816214
make1245124
Python17917536
XSLT25030
YAML1001

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 116)
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.69
▷ Minimum class complexity1.00
▷ Maximum class complexity553.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity116.00
Code structure
Namespaces63
Interfaces37
Traits5
Classes716
▷ Abstract classes446.15%
▷ Concrete classes67293.85%
▷ Final classes142.08%
Methods3,515
▷ Static methods3128.88%
▷ Public methods2,99385.15%
▷ Protected methods3058.68%
▷ Private methods2176.17%
Functions85
▷ Named functions6272.94%
▷ Anonymous functions2327.06%
Constants679
▷ Global constants13920.47%
▷ Class constants54079.53%
▷ Public constants540100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
24 compressed PNG files occupy 0.13MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/phpoffice/phpword/src/PhpWord/resources/ppt.png1.84KB1.79KB▼ 2.97%
vendor/phpoffice/phpword/src/PhpWord/resources/xls.png1.88KB1.82KB▼ 3.27%
images/32px.png3.05KB2.88KB▼ 5.58%
vendor/webdevstudios/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
vendor/webdevstudios/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%