10% libreli

Code Review | Libreli

WordPress plugin Libreli scored10%from 54 tests.

About plugin

  • Plugin page: libreli
  • Plugin version: 0.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.7.2
  • WordPress version: 6.3.1
  • First release: Oct 6, 2020
  • Latest release: Jun 6, 2021
  • Number of updates: 13
  • Update frequency: every 18.7 days
  • Top authors: lehelm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /591 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/libreli/admin/class-libreli-manage-page.php+77
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.53MB] [CPU: ▲0.18ms] Passed 4 tests

Server-side resources used by Libreli
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5444.92 ▲1.36
Dashboard /wp-admin3.83 ▲0.5349.32 ▲1.13
Posts /wp-admin/edit.php3.88 ▲0.5352.08 ▲1.93
Add New Post /wp-admin/post-new.php6.50 ▲0.6291.06 ▼3.71
Media Library /wp-admin/upload.php3.76 ▲0.5337.69 ▲2.29
All Books /wp-admin/edit.php?post_type=lbrty_book3.8036.24
Libreli Book Manager /wp-admin/edit.php?post_type=lbrty_book&page=lbrty_general_settings3.6630.86
Add New Book /wp-admin/post-new.php?post_type=lbrty_book3.7645.64

Server storage [IO: ▲0.19MB] [DB: ▲0.31MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
lbrty_settings_display_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
lbrty_settings_general_options
lbrty_settings_advanced_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Libreli
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲19814.09 ▼0.295.80 ▲3.8446.61 ▲5.96
Dashboard /wp-admin2,270 ▲855.13 ▼0.77100.94 ▲1.1339.37 ▼3.05
Posts /wp-admin/edit.php2,140 ▲512.33 ▲0.3443.24 ▲1.6937.91 ▲3.65
Add New Post /wp-admin/post-new.php6,243 ▲4,70118.99 ▲0.79883.81 ▲275.5838.01 ▼22.67
Media Library /wp-admin/upload.php1,459 ▲684.33 ▲0.0991.88 ▼6.7441.41 ▼1.50
All Books /wp-admin/edit.php?post_type=lbrty_book1,1012.4334.0129.70
Libreli Book Manager /wp-admin/edit.php?post_type=lbrty_book&page=lbrty_general_settings9282.0230.3344.89
Add New Book /wp-admin/post-new.php?post_type=lbrty_book1,5682.7551.0533.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=lbrty_book
    • > Notice in wp-content/plugins/libreli/includes/class-libreli-post-metabox.php+355
    Undefined index: post

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/libreli/admin/partials/libreli-admin-display.php
    • > /wp-content/plugins/libreli/public/partials/libreli-public-display.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/libreli/includes/class-libreli-activator.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/libreli/includes/class-libreli-deactivator.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/libreli/blocks/lbrty-dropdown.php:56

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, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === libreli === )
You can take inspiration from this readme.txt

libreli/libreli.php Passed 13 tests

The entry point to "Libreli" version 0.0.8 is a PHP file that has certain tags in its header comment area
120 characters long description:
Libreli automatically generates and keeps an always up-to-date list of the most popular retail sites selling your books.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin3,184 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP261,1601,8552,526
CSS41640241
LESS16831230
JavaScript384114187

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity14.42
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes210.53%
▷ Concrete classes1789.47%
▷ Final classes00.00%
Methods148
▷ Static methods1912.84%
▷ Public methods12181.76%
▷ Protected methods1812.16%
▷ Private methods96.08%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected