68% lightbox-pdf-viewer-by-csomor

Code Review | PDF lightbox viewer by csomorelwood

WordPress plugin PDF lightbox viewer by csomorelwood scored68%from 54 tests.

About plugin

  • Plugin page: lightbox-pdf-view...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 4, 2021
  • Latest release: Apr 25, 2023
  • Number of updates: 4
  • Update frequency: every 157.3 days
  • Top authors: csomorelwood (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /727 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.71MB] [CPU: ▼51.00ms] Passed 4 tests

Server-side resources used by PDF lightbox viewer by csomorelwood
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.29 ▼1.178.87 ▼30.28
Dashboard /wp-admin2.30 ▼1.0412.91 ▼47.72
Posts /wp-admin/edit.php2.31 ▼1.0510.35 ▼36.16
Add New Post /wp-admin/post-new.php2.30 ▼3.5810.90 ▼89.83
Media Library /wp-admin/upload.php2.31 ▼0.9210.44 ▼25.64
Lightbox PDF viewer by Csömör /wp-admin/options-general.php?page=lightbox_pdf_viewer2.319.75

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

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

Browser metrics Passed 4 tests

PDF lightbox viewer by csomorelwood: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,384 ▲63813.86 ▼0.507.43 ▲5.8045.41 ▲4.87
Dashboard /wp-admin2,410 ▲2305.04 ▼0.5087.24 ▼7.9046.07 ▲7.23
Posts /wp-admin/edit.php2,321 ▲2182.41 ▲0.4233.32 ▼11.3342.34 ▲5.22
Add New Post /wp-admin/post-new.php6,413 ▲4,88722.26 ▼1.27944.10 ▲267.2844.84 ▼11.57
Media Library /wp-admin/upload.php1,618 ▲2214.47 ▲0.24102.64 ▼2.8848.14 ▲0.24
Lightbox PDF viewer by Csömör /wp-admin/options-general.php?page=lightbox_pdf_viewer1,0211.9625.3036.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function register_post_type was called incorrectly. Post type names must be between 1 and 20 characters in length. Please see Debugging in WordPress for more information. (This message was added in version 4.2.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=lightbox_pdf_viewer
    • > User notice in wp-includes/functions.php+5905
    Function register_post_type was called incorrectly. Post type names must be between 1 and 20 characters in length. Please see Debugging in WordPress for more information. (This message was added in version 4.2.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightbox-pdf-viewer-by-csomor/pdf_viewer_by_csomorelwood.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed: The official readme.txt might help

lightbox-pdf-viewer-by-csomor/pdf_viewer_by_csomorelwood.php 92% from 13 tests

The main file in "PDF lightbox viewer by csomorelwood" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("lightbox-pdf-viewer-by-csomor.php" instead of "pdf_viewer_by_csomorelwood.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected553 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS120244
PHP11526156
JavaScript32647153

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/next.png0.49KB0.37KB▼ 23.09%
assets/images/prev.png0.49KB0.38KB▼ 22.18%
assets/images/newtab.png1.00KB0.53KB▼ 47.52%
assets/images/expand.png3.22KB1.60KB▼ 50.39%
assets/images/zoom-in.png6.61KB2.86KB▼ 56.70%