72% legoeso-pdf-manager

Code Review | Legoeso PDF Manager

WordPress plugin Legoeso PDF Manager scored72%from 54 tests.

About plugin

  • Plugin page: legoeso-pdf-manager
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Dec 14, 2022
  • Latest release: Dec 15, 2022
  • Number of updates: 6
  • Update frequency: every 1.2 days
  • Top authors: torviswesley (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /267 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.37MB] [CPU: ▼3.43ms] Passed 4 tests

An overview of server-side resources used by Legoeso PDF Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4041.29 ▼1.68
Dashboard /wp-admin3.71 ▲0.4056.15 ▼2.98
Posts /wp-admin/edit.php3.76 ▲0.3959.99 ▼3.01
Add New Post /wp-admin/post-new.php6.24 ▲0.35100.11 ▼6.04
Media Library /wp-admin/upload.php3.56 ▲0.3345.60 ▲5.79
Legoeso PDFs /wp-admin/admin.php?page=legoeso-pdf-manager3.8839.88
Legoeso Settings /wp-admin/admin.php?page=legoeso-pdf-manager_settings3.8438.11

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 110 new files
Database: 1 new table, 6 new options
New tables
wp_legoeso_file_storage
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Legoeso PDF Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲19013.68 ▼0.9424.22 ▲22.5040.99 ▼4.83
Dashboard /wp-admin2,242 ▲685.69 ▲0.10110.30 ▲18.1754.74 ▲9.40
Posts /wp-admin/edit.php2,144 ▲412.08 ▲0.0945.14 ▼4.4536.71 ▼20.04
Add New Post /wp-admin/post-new.php1,565 ▲3923.14 ▲0.15684.42 ▲10.4537.95 ▼25.84
Media Library /wp-admin/upload.php1,441 ▲414.28 ▲0.06115.44 ▲7.8854.10 ▲7.52
Legoeso PDFs /wp-admin/admin.php?page=legoeso-pdf-manager1,2831.9138.2829.20
Legoeso Settings /wp-admin/admin.php?page=legoeso-pdf-manager_settings1,0812.1335.3937.71

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=legoeso-pdf-manager_settings
    • > Notice in wp-content/plugins/legoeso-pdf-manager/inc/common/class-utility-functions.php+679
    Undefined index: imagick
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=legoeso-pdf-manager_settings
    • > Notice in wp-content/plugins/legoeso-pdf-manager/inc/admin/views/partials-pdm-settings.php+16
    Trying to access array offset on value of type null

SRP 0% 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 perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/legoeso-pdf-manager/inc/admin/views/partials-view-phpinfo.php
  • 42× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\PDFObject' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/XObject/Image.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\PDFObject' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/Page.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Element' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/Element/ElementStruct.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Encoding\\AbstractEncoding' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/Encoding/ISOLatin1Encoding.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Element\\ElementString' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/Element/ElementDate.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Element' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/Element/ElementName.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Font' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/Font/FontCIDFontType0.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Element\\ElementString' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/Element/ElementHexa.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Element' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/Element/ElementNumeric.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Element' not found in wp-content/plugins/legoeso-pdf-manager/inc/libraries/Smalot/PdfParser/Element/ElementMissing.php:40

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 90% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: file manager, pdf documents, pdf, pdf viewer, ocr...

legoeso-pdf-manager/legoeso-pdf-manager.php 77% from 13 tests

This is the main PHP file of "Legoeso PDF Manager" version 1.2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Description: Keep the plugin description shorter than 140 characters (currently 267 characters long)
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin16,410 lines of code in 79 files:
LanguageFilesBlank linesComment linesLines of code
PHP661,8095,1887,802
JavaScript62,2967,3517,791
CSS65079745
Markdown118072

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity22.46
▷ Minimum class complexity1.00
▷ Maximum class complexity180.00
Average method complexity3.98
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces13
Interfaces0
Traits0
Classes54
▷ Abstract classes11.85%
▷ Concrete classes5398.15%
▷ Final classes00.00%
Methods391
▷ Static methods256.39%
▷ Public methods28873.66%
▷ Protected methods5113.04%
▷ Private methods5213.30%
Functions12
▷ Named functions325.00%
▷ Anonymous functions975.00%
Constants13
▷ Global constants969.23%
▷ Class constants430.77%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
22 PNG files occupy 1.48MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/admin/css/images/ui-icons_444444_256x240.png6.97KB4.18KB▼ 40.04%
inc/assets/no_image2.png11.96KB3.39KB▼ 71.67%
inc/frontend/css/images/ui-icons_cc0000_256x240.png4.56KB4.18KB▼ 8.31%
inc/admin/css/images/ui-icons_cc0000_256x240.png4.56KB4.18KB▼ 8.31%
inc/admin/css/images/ui-icons_777620_256x240.png4.56KB4.18KB▼ 8.31%