84% pdf-widget

Code Review | PDF Widget

WordPress plugin PDF Widget scored84%from 54 tests.

About plugin

  • Plugin page: pdf-widget
  • Plugin version: 1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Dec 15, 2022
  • Latest release: Dec 15, 2022
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: KDT-Solutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /787 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.97ms] Passed 4 tests

This is a short check of server-side resources used by PDF Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.79 ▼0.53
Dashboard /wp-admin3.35 ▲0.0449.17 ▼6.67
Posts /wp-admin/edit.php3.46 ▲0.1049.85 ▼1.64
Add New Post /wp-admin/post-new.php5.93 ▲0.0492.52 ▼7.47
Media Library /wp-admin/upload.php3.27 ▲0.0434.21 ▼4.09
PDF Widget /wp-admin/options-general.php?page=pdf-widget3.2433.03

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,965 ▲17914.48 ▲0.2462.40 ▲60.2740.92 ▼5.22
Dashboard /wp-admin2,242 ▲395.88 ▲0.86106.18 ▼10.2844.07 ▼0.14
Posts /wp-admin/edit.php2,121 ▲212.03 ▼0.0942.61 ▲6.9438.18 ▼5.64
Add New Post /wp-admin/post-new.php1,565 ▲1523.22 ▲0.05600.29 ▼57.7253.07 ▲2.14
Media Library /wp-admin/upload.php1,424 ▲244.23 ▲0.0396.11 ▼14.9541.88 ▼3.19
PDF Widget /wp-admin/options-general.php?page=pdf-widget8352.0727.9834.09

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

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
Good news, no errors were detected

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 fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/pdf-widget/widgets/pdf-widget/pdf-widget.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Bricks\\Element' not found in wp-content/plugins/pdf-widget/widgets/pdf-widget/inc/pdf-widget-functions.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 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
3 plugin tags: pdf, adobe, elementor

pdf-widget/pdf-widget.php Passed 13 tests

The entry point to "PDF Widget" version 1.2 is a PHP file that has certain tags in its header comment area
93 characters long description:
Enables a Elementor Widget and [adobepdf] Shortcode to embed PDF's withe Adobe PDF Embed API.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected247 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP481157243
JavaScript1704

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.36
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods22
▷ Static methods14.55%
▷ Public methods1881.82%
▷ Protected methods418.18%
▷ Private methods00.00%
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
There are no PNG files in this plugin