84% library-viewer

Code Review | Library Viewer

WordPress plugin Library Viewer scored84%from 54 tests.

About plugin

  • Plugin page: library-viewer
  • Plugin version: 2.0.6.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jul 8, 2019
  • Latest release: Sep 30, 2023
  • Number of updates: 140
  • Update frequency: every 11.0 days
  • Top authors: pexlechris (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /6,632 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.85ms] Passed 4 tests

A check of server-side resources used by Library Viewer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.68 ▼10.63
Dashboard /wp-admin3.36 ▲0.0648.10 ▼2.20
Posts /wp-admin/edit.php3.47 ▲0.1246.95 ▲1.03
Add New Post /wp-admin/post-new.php5.94 ▲0.0695.34 ▼7.59
Media Library /wp-admin/upload.php3.28 ▲0.0636.17 ▲3.30

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Library Viewer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.45 ▼0.041.72 ▼0.1242.03 ▼0.86
Dashboard /wp-admin2,203 ▲155.85 ▲0.9799.45 ▼22.9239.26 ▼8.11
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0440.25 ▲0.9234.35 ▼1.77
Add New Post /wp-admin/post-new.php1,533 ▼323.32 ▲0.09650.01 ▲29.9266.08 ▲8.96
Media Library /wp-admin/upload.php1,391 ▲34.20 ▼0.0298.32 ▼8.7841.28 ▼5.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Library_Viewer_File_Alias' not found in wp-content/plugins/library-viewer/frontend/class-library-viewer-file.php:12

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 96% from 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
4 plugin tags: file manager, file list, download manager, ftp

library-viewer/library-viewer.php 92% from 13 tests

The primary PHP file in "Library Viewer" version 2.0.6.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 182 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,248 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP63751,7601,182
CSS41046
JavaScript24020

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity25.40
▷ Minimum class complexity3.00
▷ Maximum class complexity77.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods88
▷ Static methods00.00%
▷ Public methods2528.41%
▷ Protected methods6371.59%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants9
▷ Global constants9100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/folder-icon.png0.81KB1.09KB0.00%