84% pdf-embed-block

Code Review | PDF Embed Block - Embed PDF file on your web page

WordPress plugin PDF Embed Block - Embed PDF file on your web page scored84%from 54 tests.

About plugin

  • Plugin page: pdf-embed-block
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 6, 2022
  • Latest release: Nov 13, 2023
  • Number of updates: 18
  • Update frequency: every 24.1 days
  • Top authors: charlescormier (88.89%)abuhayat (16.67%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /2,560 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
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.94ms] Passed 4 tests

Analyzing server-side resources used by PDF Embed Block - Embed PDF file on your web page
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0434.78 ▼7.06
Dashboard /wp-admin3.34 ▲0.0345.14 ▼2.07
Posts /wp-admin/edit.php3.39 ▲0.0350.19 ▲2.68
Add New Post /wp-admin/post-new.php5.95 ▲0.0585.21 ▼7.88
Media Library /wp-admin/upload.php3.26 ▲0.0335.70 ▲1.24

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for PDF Embed Block - Embed PDF file on your web page
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6814.58 ▲0.242.01 ▲0.2738.57 ▼5.58
Dashboard /wp-admin2,198 ▲185.60 ▼0.0587.26 ▼13.9436.77 ▼9.00
Posts /wp-admin/edit.php2,097 ▼32.03 ▲0.0638.18 ▲0.2034.53 ▲0.34
Add New Post /wp-admin/post-new.php6,501 ▲4,97524.62 ▲1.741,097.30 ▲426.0942.80 ▼1.80
Media Library /wp-admin/upload.php1,400 ▲34.21 ▼0.02112.84 ▲11.8246.69 ▲4.49

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant PEB_PLUGIN_VERSION - assumed 'PEB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/pdf-embed-block/dist/editor.asset.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Requires at least: Invalid version format
You can take inspiration from this readme.txt

pdf-embed-block/index.php 92% from 13 tests

"PDF Embed Block - Embed PDF file on your web page" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pdf-embed-block.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected214 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PO File1346286
JSON20069
PHP2131755
CSS2022
JavaScript2022

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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 files were detected