90% adobe-embedded-pdf-viewer

Code Review | Adobe Embedded PDF Viewer

WordPress plugin Adobe Embedded PDF Viewer scored90%from 54 tests.

About plugin

  • Plugin page: adobe-embedded-pd...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 23, 2023
  • Latest release: Mar 14, 2023
  • Number of updates: 3
  • Update frequency: every 9.0 days
  • Top authors: ensemblesys (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /2,134 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 gracefully, with no errors

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.11ms] Passed 4 tests

Analyzing server-side resources used by Adobe Embedded PDF Viewer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0747.30 ▲4.79
Dashboard /wp-admin3.48 ▲0.1363.52 ▼3.37
Posts /wp-admin/edit.php3.60 ▲0.2457.55 ▲4.27
Add New Post /wp-admin/post-new.php6.08 ▲0.1999.48 ▼9.07
Media Library /wp-admin/upload.php3.40 ▲0.1742.56 ▲3.75

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 11 new options
New WordPress options
adobe_embedded_pdf_viewer_modal_initial_page_view_field
db_upgraded
adobe_embedded_pdf_viewer_modal_height_field
theysaidso_admin_options
adobe_embedded_pdf_viewer_modal_exit_type_field
adobe_embedded_pdf_viewer_modal_embed_mode_field
widget_theysaidso_widget
widget_recent-posts
adobe_embedded_pdf_viewer_modal_maxwidth_field
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Adobe Embedded PDF Viewer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,950 ▲18914.47 ▲0.2859.26 ▲57.6040.82 ▼3.77
Dashboard /wp-admin2,219 ▲425.68 ▲0.0298.23 ▲10.0283.89 ▲44.65
Posts /wp-admin/edit.php2,127 ▲272.01 ▲0.0138.65 ▲1.7036.54 ▲5.31
Add New Post /wp-admin/post-new.php6,258 ▲4,73219.65 ▼3.54932.78 ▲245.3043.47 ▼16.52
Media Library /wp-admin/upload.php1,427 ▲244.26 ▲0.12111.71 ▲6.4347.33 ▲1.39

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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • adobe_embedded_pdf_viewer_modal_exit_type_field
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: embed, adobe, pdf, acrobat, viewer

adobe-embedded-pdf-viewer/adobe-embedded-pdf-viewer.php Passed 13 tests

The main PHP file in "Adobe Embedded PDF Viewer" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
90 characters long description:
Embed PDF's in WordPress using the Adobe PDF Embed API and replace the default PDF viewer.

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 detected2,029 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript861621,049
PHP1010273792
CSS121096
JSON20092

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.60
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.46
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods2589.29%
▷ Protected methods00.00%
▷ Private methods310.71%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/Adobe_Scaled_Transparent.png16.77KB3.22KB▼ 80.80%
admin/images/acrobat-pro-cc.png0.33KB0.26KB▼ 21.79%