68% book-buyback-prices

Code Review | Book BuyBack Prices

WordPress plugin Book BuyBack Prices scored 68% from 54 tests.

About plugin

  • Plugin page: book-buyback-prices
  • Plugin version: 1.0.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.9.2
  • First release: Feb 19, 2021
  • Latest release: Jul 22, 2021
  • Number of updates: 9
  • Update frequency: every 17.0 days
  • Top authors: mberding (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 279 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.43MB] [CPU: ▼302.45ms] Passed 4 tests

Analyzing server-side resources used by Book BuyBack Prices
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3352.83 ▲1.34
Dashboard /wp-admin3.94 ▲0.5337.13 ▲2.91
Posts /wp-admin/edit.php4.17 ▲0.5341.14 ▲4.68
Add New Post /wp-admin/post-new.php7.40 ▲0.4394.41 ▼1,218.25
Media Library /wp-admin/upload.php3.73 ▲0.4430.16 ▲4.20
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius4.0627.20

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 193 new files
Database: no new tables, 4 new options
New WordPress options
fs_debug_mode
fs_accounts
fs_active_plugins
fs_gdpr

Browser metrics Passed 4 tests

This is an overview of browser requirements for Book BuyBack Prices
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,960 ▲23816.73 ▲1.0818.89 ▲13.602.48 ▼0.00
Dashboard /wp-admin2,939 ▲856.14 ▼0.03126.42 ▼3.60204.36 ▲38.39
Posts /wp-admin/edit.php2,739 ▲483.23 ▼0.0064.95 ▲0.46159.76 ▲20.60
Add New Post /wp-admin/post-new.php1,711 ▼4120.95 ▼0.56416.87 ▼25.88190.01 ▲32.20
Media Library /wp-admin/upload.php1,743 ▲455.47 ▼0.02150.79 ▲12.09257.42 ▲63.25
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,4532.5054.01116.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
    • > Notice in wp-content/plugins/book-buyback-prices/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 4 options
    • fs_gdpr
    • fs_debug_mode
    • fs_active_plugins
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/book-buyback-prices/admin/settings.php
    • > /wp-content/plugins/book-buyback-prices/admin/dashboard.php
    • > /wp-content/plugins/book-buyback-prices/freemius/templates/ajax-loader.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/book-buyback-prices/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/book-buyback-prices/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/book-buyback-prices/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/book-buyback-prices/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/book-buyback-prices/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/book-buyback-prices/freemius/templates/partials/network-activation.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/book-buyback-prices/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/book-buyback-prices/freemius/templates/account/partials/addon.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Contributors: The plugin contributors field is not present
You can take inspiration from this readme.txt

book-buyback-prices/book-buyback-prices.php Passed 13 tests

The entry point to "Book BuyBack Prices" version 1.0.9 is a PHP file that has certain tags in its header comment area
79 characters long description:
Show buyback (trade-in) prices for books. Shows results from multiple vendors.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin31,459 lines of code in 129 files:
LanguageFilesBlank linesComment linesLines of code
PHP1127,32816,22131,086
JavaScript45089297
CSS127275
SVG1001

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity87.11
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes47
▷ Abstract classes24.26%
▷ Concrete classes4595.74%
▷ Final classes00.00%
Methods1,141
▷ Static methods17915.69%
▷ Public methods80070.11%
▷ Protected methods151.31%
▷ Private methods32628.57%
Functions111
▷ Named functions111100.00%
▷ Anonymous functions00.00%
Constants124
▷ Global constants9979.84%
▷ Class constants2520.16%
▷ Public constants25100.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
25 PNG files occupy 0.35MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/logos/logo-bookbyte.png18.77KB5.40KB▼ 71.24%
img/logos/logo-bluerocketbooks.png14.02KB6.53KB▼ 53.42%
img/logos/logo-empire-text.png16.84KB5.31KB▼ 68.43%
img/logos/logo-ecampus.png26.03KB12.00KB▼ 53.90%
img/logos/logo-textbookrush.png35.31KB10.99KB▼ 68.89%