58% bsk-pdf-manager

Code Review | BSK PDF Manager

WordPress plugin BSK PDF Manager scored58%from 54 tests.

About plugin

  • Plugin page: bsk-pdf-manager
  • Plugin version: 3.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2013
  • Latest release: Mar 23, 2023
  • Number of updates: 92
  • Update frequency: every 39.9 days
  • Top authors: bannersky (100%)

Code review

54 tests

User reviews

43 reviews

Install metrics

10,000+ active /286,787 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.20MB] [CPU: ▼1.40ms] Passed 4 tests

Server-side resources used by BSK PDF Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2142.06 ▼1.06
Dashboard /wp-admin3.55 ▲0.2554.51 ▲6.85
Posts /wp-admin/edit.php3.60 ▲0.2549.46 ▼2.78
Add New Post /wp-admin/post-new.php6.07 ▲0.1883.94 ▼8.59
Media Library /wp-admin/upload.php3.39 ▲0.1637.03 ▲7.09
Tags /wp-admin/admin.php?page=bsk-pdfm-tag3.3939.25
Categories /wp-admin/admin.php?page=bsk-pdf-manager-category3.3939.53
Add by Media Library /wp-admin/admin.php?page=bsk-pdf-manager-add-by-media-library3.3835.54
Migrate /wp-admin/admin.php?page=bsk-pdfm-migrate3.3833.08
Settings /wp-admin/admin.php?page=bsk-pdf-manager-settings-support3.4856.64
PDF / Documents /wp-admin/admin.php?page=bsk-pdf-manager3.3939.49
Add by FTP /wp-admin/admin.php?page=bsk-pdf-manager-add-by-ftp3.3836.34
Notifications /wp-admin/admin.php?page=bsk-pdfm-notification3.3939.06
Add New / Edit /wp-admin/admin.php?page=bsk-pdf-manager-edit3.4240.56

Server storage [IO: ▲2.98MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 110 new files
Database: 5 new tables, 14 new options
New tables
wp_bsk_pdf_manager_notifications
wp_bsk_pdf_manager_user_available
wp_bsk_pdf_manager_cats
wp_bsk_pdf_manager_relationships
wp_bsk_pdf_manager_pdfs
New WordPress options
db_upgraded
widget_bsk_pdf_manager_widget
widget_recent-comments
_bsk_pdf_manager_update_doc_slug_doing_
widget_theysaidso_widget
_bsk_pdf_manager_rels_done_
_bsk_pdf_manager_update_doc_slug_done_
_bsk_pdf_manager_update_file_size_done_
_bsk_pdf_manager_db_ver_
_bsk_pdf_manager_update_file_size_doing_
...

Browser metrics Passed 4 tests

An overview of browser requirements for BSK PDF Manager
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,114 ▲37915.53 ▲0.925.52 ▲3.7943.69 ▲3.87
Dashboard /wp-admin2,431 ▲2406.84 ▲1.97132.06 ▲27.6036.49 ▼7.47
Posts /wp-admin/edit.php2,340 ▲2513.36 ▲1.3651.64 ▲8.5631.90 ▼3.48
Add New Post /wp-admin/post-new.php1,586 ▲6723.52 ▲0.07626.94 ▼48.5333.73 ▼26.22
Media Library /wp-admin/upload.php1,476 ▲884.49 ▲0.3392.94 ▼13.3940.59 ▼2.87
Tags /wp-admin/admin.php?page=bsk-pdfm-tag1,2503.4853.4828.16
Categories /wp-admin/admin.php?page=bsk-pdf-manager-category1,3203.6244.6025.77
Add by Media Library /wp-admin/admin.php?page=bsk-pdf-manager-add-by-media-library1,0493.3842.2524.58
Migrate /wp-admin/admin.php?page=bsk-pdfm-migrate1,2993.5343.4633.31
Settings /wp-admin/admin.php?page=bsk-pdf-manager-settings-support21,0984.21131.8678.91
PDF / Documents /wp-admin/admin.php?page=bsk-pdf-manager1,4993.4850.3834.12
Add by FTP /wp-admin/admin.php?page=bsk-pdf-manager-add-by-ftp1,0493.3742.9825.55
Notifications /wp-admin/admin.php?page=bsk-pdfm-notification1,1713.4044.7424.09
Add New / Edit /wp-admin/admin.php?page=bsk-pdf-manager-edit2,3547.24132.98114.90

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method BSKPDFManager::bsk_pdf_manager_uninstall() should not be called statically
  • Zombie tables were found after uninstall: 1 table
    • wp_bsk_pdf_manager_notifications
  • Zombie WordPress options detected upon uninstall: 8 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_bsk_pdf_manager_widget_category
    • widget_bsk_pdf_manager_widget
    • widget_recent-posts

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/admin.php?page=bsk-pdf-manager-settings-support
    • > Notice in wp-content/plugins/bsk-pdf-manager/classes/dashboard/settings/settings-upload.php+66
    Undefined variable: current_upload_path

SRP 50% from 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
Please fix the following items
  • 17× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/bsk-pdf-manager/classes/dashboard/categories.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/bsk-pdf-manager/classes/dashboard/notifications.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/bsk-pdf-manager/classes/dashboard/pdfm-tags.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bsk-pdf-manager/classes/widgets/widget.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/bsk-pdf-manager/classes/dashboard/pdfs.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'BSKPDFM_Shortcodes_Category' not found in wp-content/plugins/bsk-pdf-manager/classes/shortcodes/category/category-ul-ol.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/bsk-pdf-manager/classes/dashboard/pdfs.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'BSKPDFM_Shortcodes_Category' not found in wp-content/plugins/bsk-pdf-manager/classes/shortcodes/category/category-columns.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/bsk-pdf-manager/classes/dashboard/pdfm-tags.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'BSKPDFM_Shortcodes_Category' not found in wp-content/plugins/bsk-pdf-manager/classes/shortcodes/category/category-dropdown.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Settings interface, you may support more file types there), #2 (Upload your PDF / File from computer or WordPress Media library), #3 (Categories manager interface), #4 (Permalink settings)
The official readme.txt is a good inspiration

bsk-pdf-manager/bsk-pdf-manager.php 92% from 13 tests

The main PHP file in "BSK PDF Manager" ver. 3.4.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 181 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin33,384 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
PHP411,72342911,671
PO File73,8167,7529,132
JavaScript55402,4617,981
CSS92552294,600

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity49.60
▷ Minimum class complexity1.00
▷ Maximum class complexity214.00
Average method complexity8.90
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes40
▷ Abstract classes00.00%
▷ Concrete classes40100.00%
▷ Final classes00.00%
Methods246
▷ Static methods4819.51%
▷ Public methods24197.97%
▷ Protected methods41.63%
▷ Private methods10.41%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
34 PNG files occupy 0.43MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
css/images/ui-icons_454545_256x240.png6.91KB4.18KB▼ 39.44%
css/images/ui-icons_ef8c08_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%
classes/dashboard/settings/jstree/dist/themes/default/32px.png5.53KB2.93KB▼ 47.10%