84% pdf-viewer-for-elementor

Code Review | PDF Viewer for Elementor

WordPress plugin PDF Viewer for Elementor scored 84% from 54 tests.

About plugin

  • Plugin page: pdf-viewer-for-el...
  • Plugin version: 2.9.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.7.1
  • WordPress version: 5.8.1
  • First release: Dec 17, 2019
  • Latest release: May 10, 2021
  • Number of updates: 27
  • Update frequency: every 18.9 days
  • Top authors: kazbekkadalashvili (88.89%)redlettuce (14.81%)

Code review

54 tests

User reviews

96 reviews

Install metrics

30,000+ active / 87,797 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼135.67ms] Passed 4 tests

A check of server-side resources used by PDF Viewer for Elementor
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1435.04 ▲14.56
Dashboard /wp-admin3.08 ▲0.0347.34 ▲3.79
Posts /wp-admin/edit.php3.13 ▲0.0347.02 ▼4.07
Add New Post /wp-admin/post-new.php5.45 ▲0.0295.02 ▼543.68
Media Library /wp-admin/upload.php3.03 ▲0.0232.66 ▲1.28

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 386 new files
Database: no new tables, 1 new option
New WordPress options
pdf_elementor_activation_time

Browser metrics Passed 4 tests

Checking browser requirements for PDF Viewer for Elementor
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,725 ▲12916.30 ▲0.777.66 ▼0.5249.32 ▼3.95
Dashboard /wp-admin2,992 ▲596.04 ▲0.10141.32 ▼10.67114.00 ▼8.73
Posts /wp-admin/edit.php2,762 ▲232.70 ▲0.0164.72 ▼5.3390.50 ▼5.86
Add New Post /wp-admin/post-new.php1,610 ▼6218.82 ▼0.06390.86 ▲8.03109.43 ▼3.05
Media Library /wp-admin/upload.php1,830 ▲235.02 ▲0.01156.79 ▼0.30127.84 ▲7.49

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • pdf_elementor_activation_time

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ElementorPDFViewer\\add_action() in wp-content/plugins/pdf-viewer-for-elementor/plugin.php:82

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: pdf, elementor widget, elements, elementor, viewer

pdf-viewer-for-elementor/index.php 85% from 13 tests

The main PHP file in "PDF Viewer for Elementor" ver. 2.9.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pdf-viewer-for-elementor.php" instead of "index.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
Success! There were no dangerous files found in this plugin88,210 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript413,44797885,153
CSS1294372,132
PHP4102278420
HTML14716331
SVG900150
Markdown112024

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.00
▷ Minimum class complexity2.00
▷ Maximum class complexity9.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods22
▷ Static methods14.55%
▷ Public methods1777.27%
▷ Protected methods418.18%
▷ Private methods14.55%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
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
86 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/pdfjs/web/images/treeitem-collapsed.png0.13KB0.21KB0.00%
assets/pdfjs/web/images/toolbarButton-viewOutline-rtl@2x.png0.38KB0.60KB0.00%
assets/pdfjs/web/images/toolbarButton-pageUp.png0.24KB0.37KB0.00%
assets/pdfjs/web/images/findbarButton-previous-rtl@2x.png0.29KB0.47KB0.00%
assets/pdfjs/web/images/secondaryToolbarButton-spreadOdd@2x.png0.61KB0.72KB0.00%