84% pdfjs-viewer-for-elementor

Code Review | PDFjs viewer for Elementor & Gutenberg

WordPress plugin PDFjs viewer for Elementor & Gutenberg scored84%from 54 tests.

About plugin

  • Plugin page: pdfjs-viewer-for-...
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 15, 2023
  • Latest release: Jun 14, 2023
  • Number of updates: 5
  • Update frequency: every 23.8 days
  • Top authors: kazbekkadalashvili (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /1,611 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 gracefully, with no errors

Server metrics [RAM: ▲0.47MB] [CPU: ▲2.99ms] Passed 4 tests

Server-side resources used by PDFjs viewer for Elementor & Gutenberg
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4943.88 ▲3.40
Dashboard /wp-admin3.81 ▲0.5160.59 ▲5.70
Posts /wp-admin/edit.php3.85 ▲0.5057.63 ▲7.08
Add New Post /wp-admin/post-new.php6.34 ▲0.46100.88 ▲0.46
Media Library /wp-admin/upload.php3.68 ▲0.4541.14 ▲2.40

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 422 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

PDFjs viewer for Elementor & Gutenberg: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲10817.21 ▲2.861.90 ▲0.1943.92 ▼1.86
Dashboard /wp-admin2,260 ▲728.49 ▲3.45155.55 ▲39.6340.16 ▼7.27
Posts /wp-admin/edit.php2,295 ▲2065.80 ▲3.7666.15 ▲26.2935.99 ▼0.61
Add New Post /wp-admin/post-new.php6,221 ▲4,68721.52 ▼1.61859.49 ▲171.9538.09 ▼16.07
Media Library /wp-admin/upload.php1,602 ▲2176.90 ▲2.67114.91 ▼1.0040.41 ▼6.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Wpify\\CustomFields\\Implementations\\AbstractPostImplementation' not found in wp-content/plugins/pdfjs-viewer-for-elementor/vendor/wpify/custom-fields/src/Implementations/Comment.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Wpify\\CustomFields\\Implementations\\AbstractImplementation' not found in wp-content/plugins/pdfjs-viewer-for-elementor/vendor/wpify/custom-fields/src/Implementations/Options.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Wpify\\CustomFields\\Implementations\\AbstractPostImplementation' not found in wp-content/plugins/pdfjs-viewer-for-elementor/vendor/wpify/custom-fields/src/Implementations/Taxonomy.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Wpify\\CustomFields\\Implementations\\AbstractPostImplementation' not found in wp-content/plugins/pdfjs-viewer-for-elementor/vendor/wpify/custom-fields/src/Implementations/ProductVariationOptions.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Wpify\\CustomFields\\Implementations\\AbstractImplementation' not found in wp-content/plugins/pdfjs-viewer-for-elementor/vendor/wpify/custom-fields/src/Implementations/User.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Wpify\\CustomFields\\Implementations\\AbstractImplementation' not found in wp-content/plugins/pdfjs-viewer-for-elementor/vendor/wpify/custom-fields/src/Implementations/GutenbergBlock.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Wpify\\CustomFields\\Implementations\\AbstractPostImplementation' not found in wp-content/plugins/pdfjs-viewer-for-elementor/vendor/wpify/custom-fields/src/Implementations/ProductOptions.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Wpify\\CustomFields\\Implementations\\AbstractImplementation' not found in wp-content/plugins/pdfjs-viewer-for-elementor/vendor/wpify/custom-fields/src/Implementations/WooCommerceSettings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PDFjsViewerForElementor\\add_action() in wp-content/plugins/pdfjs-viewer-for-elementor/plugin.php:69
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/pdfjs-viewer-for-elementor/vendor/wpify/custom-fields/src/Api.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: pdf, gutenberg, pdfjs, block-editor, embed...

pdfjs-viewer-for-elementor/pdf-viewer.php 92% from 13 tests

The entry point to "PDFjs viewer for Elementor & Gutenberg" version 1.3.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pdfjs-viewer-for-elementor.php" instead of "pdf-viewer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin101,085 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript779338493,743
PHP347431,4323,135
CSS3404482,704
Markdown12690757
HTML14816369
SVG5406305
JSON30072

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity16.75
▷ Minimum class complexity1.00
▷ Maximum class complexity80.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes24
▷ Abstract classes28.33%
▷ Concrete classes2291.67%
▷ Final classes1672.73%
Methods239
▷ Static methods208.37%
▷ Public methods22694.56%
▷ Protected methods62.51%
▷ Private methods72.93%
Functions40
▷ Named functions12.50%
▷ Anonymous functions3997.50%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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
3 PNG files occupy 0.23MB with 0.10MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/js/pdfjs/web/images/shadow.png0.26KB0.35KB0.00%
vendor/wpify/custom-fields/build/images/flags.007b2705.png69.20KB23.42KB▼ 66.16%
vendor/wpify/custom-fields/build/images/flags@2x.9d5328fb.png170.28KB68.04KB▼ 60.04%