84% pdf-embedder

Code Review | PDF Embedder

WordPress plugin PDF Embedder scored84%from 54 tests.

About plugin

  • Plugin page: pdf-embedder
  • Plugin version: 4.6.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-6.2.0
  • WordPress version: 6.3.1
  • First release: Jan 21, 2015
  • Latest release: Mar 22, 2023
  • Number of updates: 82
  • Update frequency: every 36.4 days
  • Top authors: danlester (58.54%)levertechadmin (29.27%)dimensionmedia (8.54%)chrisakelley (7.32%)

Code review

54 tests

User reviews

166 reviews

Install metrics

300,000+ active /3,140,656 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

This is a short check of server-side resources used by PDF Embedder
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.47 ▼6.87
Dashboard /wp-admin3.34 ▲0.0444.52 ▼1.06
Posts /wp-admin/edit.php3.39 ▲0.0450.39 ▲5.86
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.59 ▼19.83
Media Library /wp-admin/upload.php3.27 ▲0.0434.00 ▲2.67
PDF Embedder /wp-admin/options-general.php?page=pdfemb_list_options3.2433.18

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 228 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

PDF Embedder: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7114.80 ▲0.241.68 ▼0.4345.76 ▲3.33
Dashboard /wp-admin2,212 ▲215.90 ▲0.0299.44 ▼0.9242.32 ▲2.77
Posts /wp-admin/edit.php2,095 ▲62.00 ▲0.0039.48 ▲0.7535.95 ▲2.00
Add New Post /wp-admin/post-new.php6,191 ▲4,67718.98 ▲1.39894.85 ▲226.7657.42 ▲3.45
Media Library /wp-admin/upload.php1,399 ▲174.20 ▲0.0295.96 ▼0.3442.12 ▼1.55
PDF Embedder /wp-admin/options-general.php?page=pdfemb_list_options1,4022.1224.7261.08

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Upgrader_Skin' not found in wp-content/plugins/pdf-embedder/core/install_skin.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pdf-embedder/pdf_embedder.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: embed, pdf viewer, office, intranet, document...

pdf-embedder/pdf_embedder.php 85% from 13 tests

The entry point to "PDF Embedder" version 4.6.4 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: Please rename the main PHP file in this plugin to the plugin slug ("pdf-embedder.php" instead of "pdf_embedder.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 155 characters long)

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
Success! There were no dangerous files found in this plugin72,581 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1313,89380768,004
PO File78889893,015
PHP3285209951
Sass4930607
CSS4004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity39.00
▷ Minimum class complexity3.00
▷ Maximum class complexity104.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods74
▷ Static methods22.70%
▷ Public methods3648.65%
▷ Protected methods3851.35%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
16 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/toolbarButton-zoomOut.png0.09KB0.12KB0.00%
assets/img/pdf-embedder.png9.06KB3.01KB▼ 66.75%
assets/img/partners/nextgen.png5.33KB3.03KB▼ 43.19%
assets/img/toolbarButton-download.png0.25KB0.39KB0.00%
assets/img/partners/envira-gallery-lite.png4.68KB1.46KB▼ 68.77%