84% wonderplugin-pdf-embed

Code Review | Wonder PDF Embed

WordPress plugin Wonder PDF Embed scored84%from 54 tests.

About plugin

  • Plugin page: wonderplugin-pdf-...
  • Plugin version: 2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.9.1
  • WordPress version: 6.3.1
  • First release: Jun 3, 2017
  • Latest release: Mar 8, 2022
  • Number of updates: 45
  • Update frequency: every 38.7 days
  • Top authors: wonderplugin (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

10,000+ active /82,919 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.35ms] Passed 4 tests

This is a short check of server-side resources used by Wonder PDF Embed
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.36 ▲2.14
Dashboard /wp-admin3.31 ▼0.0347.32 ▼8.36
Posts /wp-admin/edit.php3.36 ▲0.0142.35 ▼4.85
Add New Post /wp-admin/post-new.php5.89 ▲0.0179.63 ▼21.42
Media Library /wp-admin/upload.php3.23 ▲0.0134.90 ▲1.22

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 735 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Wonder PDF Embed
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.23 ▼1.211.78 ▲0.0843.43 ▲1.63
Dashboard /wp-admin2,222 ▲335.86 ▲0.93114.36 ▼2.0445.14 ▼2.37
Posts /wp-admin/edit.php2,105 ▲132.02 ▲0.0237.53 ▼2.3932.51 ▼2.14
Add New Post /wp-admin/post-new.php1,546 ▲1523.06 ▲4.83619.85 ▼1.8853.12 ▼2.34
Media Library /wp-admin/upload.php1,401 ▲104.22 ▲0.0195.90 ▼3.1342.36 ▼5.62

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
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wonderplugin-pdf-embed/wonderplugin-pdf.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: pdf lightbox, responsive pdf viewer, responsive pdf embed, pdf viewer, pdf embed

wonderplugin-pdf-embed/wonderplugin-pdf.php 92% from 13 tests

The main file in "Wonder PDF Embed" v. 2.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wonderplugin-pdf-embed.php" instead of "wonderplugin-pdf.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin93,691 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1017,65437888,106
CSS2619834,355
HTML28732644
SVG56048383
PHP1609203

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.77
Average class complexity59.00
▷ Minimum class complexity59.00
▷ Maximum class complexity59.00
Average method complexity7.44
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ 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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
75 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
pdfjs/web/images/toolbarButton-openFile@2x.png0.54KB0.84KB0.00%
pdfjs/web/images/toolbarButton-sidebarToggle-rtl@2x.png0.34KB0.57KB0.00%
pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png0.24KB0.40KB0.00%
pdfjs/web/images/treeitem-expanded@2x.png0.17KB0.27KB0.00%
pdfjs/web/images/toolbarButton-pageDown.png0.23KB0.36KB0.00%