68% weblibrarian

Code Review | WebLibrarian

WordPress plugin WebLibrarian scored68%from 54 tests.

About plugin

  • Plugin page: weblibrarian
  • Plugin version: 3.5.8.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-6.3
  • WordPress version: 6.3.1
  • First release: Dec 14, 2012
  • Latest release: Sep 29, 2023
  • Number of updates: 191
  • Update frequency: every 20.6 days
  • Top authors: RobertPHeller (93.19%)novalore (7.33%)

Code review

54 tests

User reviews

12 reviews

Install metrics

500+ active /32,710 total downloads

Benchmarks

Plugin footprint 65% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.56MB] [CPU: ▼4.31ms] Passed 4 tests

This is a short check of server-side resources used by WebLibrarian
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.16 ▲1.6954.74 ▲8.52
Dashboard /wp-admin4.92 ▲1.6249.30 ▼3.37
Posts /wp-admin/edit.php4.98 ▲1.6350.79 ▼0.72
Add New Post /wp-admin/post-new.php7.19 ▲1.3085.98 ▼21.67
Media Library /wp-admin/upload.php4.92 ▲1.7045.30 ▲9.10
Add Patron ID /wp-admin/users.php?page=weblib-add-patron-id-to-a-user4.9861.18
Edit Patron info /wp-admin/users.php?page=weblib-edit-your-patron-info4.9744.37
Web Librarian /wp-admin/options-general.php?page=weblibrarian-options4.9041.11

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 99 new files
Database: 5 new tables, 13 new options
New tables
wp_weblib_keywords
wp_weblib_patrons
wp_weblib_types
wp_weblib_collection
wp_weblib_statistics
New WordPress options
widget_strippedmeta
weblib_associate_tag
widget_theysaidso_widget
db_upgraded
weblib_aws_regiondom
weblib_debugdb
can_compress_scripts
weblib_aws_private_key
theysaidso_admin_options
widget_patroncirs
...

Browser metrics Passed 4 tests

WebLibrarian: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,919 ▲17313.69 ▼0.626.14 ▲4.3238.75 ▼10.73
Dashboard /wp-admin2,229 ▲385.10 ▲0.18114.46 ▲4.3939.96 ▼4.21
Posts /wp-admin/edit.php2,120 ▲282.29 ▲0.1238.95 ▲1.3935.54 ▼1.76
Add New Post /wp-admin/post-new.php1,534 ▼023.14 ▲0.22680.54 ▼3.0762.52 ▲7.95
Media Library /wp-admin/upload.php1,411 ▲204.25 ▲0.02108.72 ▲8.4342.68 ▼0.06
Add Patron ID /wp-admin/users.php?page=weblib-add-patron-id-to-a-user1,0521.8628.8326.74
Edit Patron info /wp-admin/users.php?page=weblib-edit-your-patron-info8791.8227.7727.41
Web Librarian /wp-admin/options-general.php?page=weblibrarian-options1,0191.8329.9728.85

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie tables were found after uninstall: 5 tables
    • wp_weblib_types
    • wp_weblib_patrons
    • wp_weblib_keywords
    • wp_weblib_collection
    • wp_weblib_statistics
  • Zombie WordPress options were found after uninstall: 13 options
    • weblib_associate_tag
    • widget_recent-comments
    • weblib_aws_regiondom
    • widget_recent-posts
    • db_upgraded
    • weblib_aws_private_key
    • widget_patroncirs
    • theysaidso_admin_options
    • weblib_debugdb
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=weblibrarian-options
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
    • > GET request to /wp-admin/users.php?page=weblib-add-patron-id-to-a-user
    • > Notice in wp-content/plugins/weblibrarian/includes/WEBLIB_Users_Admin.php+150
    Undefined variable: option
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/users.php?page=weblib-add-patron-id-to-a-user
    • > Notice in wp-admin/includes/class-wp-list-table.php+1350
    Undefined offset: 3
    • > GET request to /wp-admin/users.php?page=weblib-edit-your-patron-info
    • > Notice in wp-content/plugins/weblibrarian/includes/WEBLIB_Users_Admin.php+202
    Undefined variable: message

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 37× PHP files trigger server-side errors or warnings when accessed directly (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/weblibrarian/includes/WEBLIB_Patrons_Admin.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/weblibrarian/includes/admin_page_classes.php:8
    • > 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/weblibrarian/includes/WEBLIB_Types_Database_Admin.php on line 11
    • > 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/weblibrarian/includes/WEBLIB_PatronRecord_Admin.php on line 11
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/weblibrarian/includes/database_code.php on line 13
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/weblibrarian/includes/WEBLIB_Statistics_Admin.php on line 11
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/weblibrarian/includes/database_code.php on line 11
    • > 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/weblibrarian/includes/WEBLIB_Collection_Admin.php on line 11
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/weblibrarian/includes/database_code.php on line 7
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/weblibrarian/includes/database_code.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: plugin, database, library, circulation, shortcode...

weblibrarian/WebLibrarian.php 92% from 13 tests

The main PHP file in "WebLibrarian" ver. 3.5.8.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("weblibrarian.php" instead of "WebLibrarian.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin12,758 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP146245537,566
PO File41,0711,3022,214
CSS41931391,809
JavaScript310249889
HTML36130280

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity39.19
▷ Minimum class complexity2.00
▷ Maximum class complexity110.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods471
▷ Static methods6714.23%
▷ Public methods46398.30%
▷ Protected methods81.70%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants31
▷ Global constants31100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
29 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/jquery-ui-lightness/ui-bg_glass_100_fdf5ce_1x400.png0.34KB0.16KB▼ 54.02%
images/_Icon.png1.56KB1.36KB▼ 12.60%
images/CircStats_Menu.png0.67KB0.63KB▼ 6.81%
images/Options_Icon.png1.56KB1.36KB▼ 12.60%
images/jquery-ui-lightness/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%