78% docs2site

Code Review | Docs2Site - Export Google Docs Into WP

WordPress plugin Docs2Site - Export Google Docs Into WP scored 78% from 54 tests.

About plugin

  • Plugin page: docs2site
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.8
  • WordPress version: 5.8.1
  • First release: Nov 13, 2020
  • Latest release: Jul 23, 2021
  • Number of updates: 5
  • Update frequency: every 50.4 days
  • Top authors: docs2site (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 456 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
Install script ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼142.24ms] Passed 4 tests

This is a short check of server-side resources used by Docs2Site - Export Google Docs Into WP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.1338.44 ▲4.47
Dashboard /wp-admin3.25 ▲0.1947.32 ▲1.03
Posts /wp-admin/edit.php3.30 ▲0.1948.57 ▲4.94
Add New Post /wp-admin/post-new.php5.57 ▲0.1391.83 ▼571.48
Media Library /wp-admin/upload.php3.13 ▲0.1332.09 ▼2.96

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,814 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Docs2Site - Export Google Docs Into WP: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,692 ▲9615.80 ▲0.219.14 ▲0.6050.99 ▲0.96
Dashboard /wp-admin2,977 ▲465.89 ▼0.20130.53 ▼7.90141.61 ▲22.91
Posts /wp-admin/edit.php2,765 ▲262.68 ▼0.0267.23 ▲0.5187.37 ▼2.97
Add New Post /wp-admin/post-new.php1,510 ▲1218.52 ▼0.37399.50 ▲22.02115.76 ▼1.36
Media Library /wp-admin/upload.php1,839 ▲294.99 ▼0.02131.29 ▼15.86152.74 ▲33.45

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

Smoke tests 50% 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 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 fix the following
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/docs2site/vendor/automattic/vipwpcs/WordPressVIPMinimum/ruleset-test.php
    • > /wp-content/plugins/docs2site/vendor/automattic/vipwpcs/tests/bootstrap.php
    • > /wp-content/plugins/docs2site/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php
    • > /wp-content/plugins/docs2site/vendor/squizlabs/php_codesniffer/scripts/build-phar.php
    • > /wp-content/plugins/docs2site/vendor/automattic/vipwpcs/WordPress-VIP-Go/ruleset-test.php
  • 832× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionParameterSniff' not found in wp-content/plugins/docs2site/vendor/automattic/vipwpcs/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\AbstractFunctionCallParameterSniff' not found in wp-content/plugins/docs2site/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/docs2site/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/docs2site/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/docs2site/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\Sniff' not found in wp-content/plugins/docs2site/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\AbstractNewFeatureSniff' not found in wp-content/plugins/docs2site/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/docs2site/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\Sniff' not found in wp-content/plugins/docs2site/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/docs2site/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: import, google drive, export, google docs

docs2site/docs2site.php 92% from 13 tests

The entry point to "Docs2Site - Export Google Docs Into WP" version 1.0.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 291 characters long)

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/docs2site/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat
      • wp-content/plugins/docs2site/vendor/squizlabs/php_codesniffer/bin/phpcs.bat
116,384 lines of code in 1,441 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,01722,96045,43896,766
XML1734518206,389
Pascal1202,5285,2375,437
Markdown1594403,807
JavaScript637668602,204
CSS3621597848
JSON900775
XSD160130
Bourne Again Shell576118
DOS Batch241010

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 316)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity15.52
▷ Minimum class complexity1.00
▷ Maximum class complexity462.00
Average method complexity5.92
▷ Minimum method complexity1.00
▷ Maximum method complexity316.00
Code structure
Namespaces216
Interfaces3
Traits0
Classes863
▷ Abstract classes222.55%
▷ Concrete classes84197.45%
▷ Final classes20.24%
Methods2,575
▷ Static methods943.65%
▷ Public methods2,04979.57%
▷ Protected methods39115.18%
▷ Private methods1355.24%
Functions17
▷ Named functions423.53%
▷ Anonymous functions1376.47%
Constants143
▷ Global constants10976.22%
▷ Class constants3423.78%
▷ Public constants34100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-new.png0.69KB0.38KB▼ 45.07%
assets/images/logo.png2.52KB1.22KB▼ 51.47%
assets/images/icon.png0.41KB0.30KB▼ 28.37%