84% dearpdf-lite

Code Review | PDF Viewer & 3D PDF Flipbook - DearPDF

WordPress plugin PDF Viewer & 3D PDF Flipbook - DearPDF scored84%from 54 tests.

About plugin

  • Plugin page: dearpdf-lite
  • Plugin version: 2.0.38
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Jun 26, 2021
  • Latest release: Mar 28, 2023
  • Number of updates: 33
  • Update frequency: every 19.6 days
  • Top authors: dearhive (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

7,000+ active /43,357 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.05MB] [CPU: ▼9.33ms] Passed 4 tests

This is a short check of server-side resources used by PDF Viewer & 3D PDF Flipbook - DearPDF
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0436.00 ▼8.50
Dashboard /wp-admin3.35 ▲0.0547.26 ▲1.18
Posts /wp-admin/edit.php3.47 ▲0.1146.32 ▼0.37
Add New Post /wp-admin/post-new.php5.94 ▲0.0680.52 ▼26.95
Media Library /wp-admin/upload.php3.27 ▲0.0535.07 ▼1.49
All Post /wp-admin/edit.php?post_type=dearpdf3.3540.56
Add Post /wp-admin/post-new.php?post_type=dearpdf3.3457.50

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 208 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF Viewer & 3D PDF Flipbook - DearPDF
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,965 ▲19413.97 ▼0.3311.98 ▲10.1738.89 ▼2.27
Dashboard /wp-admin2,233 ▲455.87 ▲0.96105.06 ▲2.1640.77 ▼5.71
Posts /wp-admin/edit.php2,116 ▲272.04 ▲0.0240.18 ▲4.2135.66 ▼1.15
Add New Post /wp-admin/post-new.php1,556 ▲2323.00 ▼0.12653.97 ▲30.2455.82 ▼0.82
Media Library /wp-admin/upload.php1,418 ▲274.15 ▼0.00109.12 ▲11.4846.97 ▲1.75
All Post /wp-admin/edit.php?post_type=dearpdf1,2723.3651.7329.00
Add Post /wp-admin/post-new.php?post_type=dearpdf2,1394.66139.0650.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/dearpdf-lite/dearpdf-lite.php
    • > /wp-content/plugins/dearpdf-lite/dearpdf.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: A description for screenshot #3 is missing in dearpdf-lite/assets to your readme.txt
The official readme.txt might help

dearpdf-lite/dearpdf-lite.php Passed 13 tests

Analyzing the main PHP file in "PDF Viewer & 3D PDF Flipbook - DearPDF" version 2.0.38
24 characters long description:
PDF Viewer for WordPress

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
No dangerous file extensions were detected104,134 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1231,2724,483101,231
CSS3307471,937
PHP3276407816
SVG900150

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity124.00
▷ Minimum class complexity124.00
▷ Maximum class complexity124.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods52
▷ Static methods11.92%
▷ Public methods4892.31%
▷ Protected methods47.69%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/chrome-extension.png13.08KB6.28KB▼ 52.01%