78% pdf-viewer-blocks

Code Review | kitpdf | WordPress Gutenberg PDF viewer blocks .

WordPress plugin kitpdf | WordPress Gutenberg PDF viewer blocks . scored 78% from 54 tests.

About plugin

  • Plugin page: pdf-viewer-blocks
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Sep 6, 2020
  • Latest release: Sep 8, 2020
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: kitbug (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 490 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.03MB] [CPU: ▼8.33ms] Passed 4 tests

Analyzing server-side resources used by kitpdf | WordPress Gutenberg PDF viewer blocks .
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.77 ▲1.3152.11 ▲10.86
Dashboard /wp-admin4.65 ▲1.3457.70 ▲12.12
Posts /wp-admin/edit.php4.67 ▲1.3157.27 ▲0.32
Add New Post /wp-admin/post-new.php6.14 ▲0.2558.64 ▼49.08
Media Library /wp-admin/upload.php4.48 ▲1.2543.16 ▲4.59

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 552 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for kitpdf | WordPress Gutenberg PDF viewer blocks .
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,071 ▲33618.40 ▲4.001.73 ▲0.0641.30 ▼10.24
Dashboard /wp-admin2,467 ▲2769.12 ▲3.21161.51 ▲58.1036.46 ▼8.16
Posts /wp-admin/edit.php2,392 ▲3036.11 ▲4.1378.73 ▲38.2632.12 ▼3.85
Add New Post /wp-admin/post-new.php6,513 ▲4,97125.44 ▲6.79991.97 ▲329.8150.76 ▼12.65
Media Library /wp-admin/upload.php1,531 ▲1466.62 ▲2.32109.69 ▼7.8743.58 ▼3.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 212× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/htmlburger/carbon-fields/core/Field/Media_Gallery_Field.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Post_Meta_Datastore' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/htmlburger/carbon-fields/core/Datastore/Nav_Menu_Item_Datastore.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Service\\Service' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/htmlburger/carbon-fields/core/Service/Legacy_Storage_Service_v_1_5.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/htmlburger/carbon-fields/core/Field/Oembed_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/htmlburger/carbon-fields/core/Field/Association_Field.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/pdf-viewer-blocks/lib/carbon-fields/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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
3 plugin tags: pdf blocks, gutenberg pdf blocks, pdf block

pdf-viewer-blocks/kitpdf.php 85% from 13 tests

The entry point to "kitpdf | WordPress Gutenberg PDF viewer blocks ." version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pdf-viewer-blocks.php" instead of "kitpdf.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin29,234 lines of code in 505 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1725,1898,45012,925
PHP2462,7896,94210,555
Sass4833401,746
PO File206107791,652
CSS93241,1421,650
JSON500625
Markdown426071
SVG10010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity5.46
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces24
Interfaces5
Traits0
Classes220
▷ Abstract classes125.45%
▷ Concrete classes20894.55%
▷ Final classes10.48%
Methods985
▷ Static methods919.24%
▷ Public methods77778.88%
▷ Protected methods19920.20%
▷ Private methods90.91%
Functions110
▷ Named functions2421.82%
▷ Anonymous functions8678.18%
Constants36
▷ Global constants1027.78%
▷ Class constants2672.22%
▷ Public constants26100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin