68% my-kindle-books

Code Review | My Kindle Books

WordPress plugin My Kindle Books scored 68% from 53 tests.

About plugin

  • Plugin page: my-kindle-books
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.6
  • WordPress version: 5.8.1
  • First release: Aug 26, 2013
  • Latest release: Aug 28, 2013
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: adamgroom (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 1,036 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.85MB] [CPU: ▼294.94ms] Passed 4 tests

A check of server-side resources used by My Kindle Books
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1843.88 ▲22.75
Dashboard /wp-admin2.80 ▼0.2520.66 ▼20.45
Posts /wp-admin/edit.php2.80 ▼0.3019.52 ▼28.78
Add New Post /wp-admin/post-new.php2.80 ▼2.6324.02 ▼1,120.27
Media Library /wp-admin/upload.php2.80 ▼0.2026.07 ▼10.24
Affiliate Tags /wp-admin/admin.php?page=my_kindle_books_affiliate_tags2.8022.74
My Kindle Books /wp-admin/admin.php?page=my_kindle_books2.8020.35

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 4 new options
New WordPress options
recovery_mode_email_last_sent
my_kindle_books_title
my_kindle_books_name
my_kindle_books_id

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Kindle Books
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,705 ▲9915.71 ▲0.139.82 ▲0.8147.51 ▲5.16
Dashboard /wp-admin2,986 ▲1336.07 ▲0.23148.53 ▼9.37108.48 ▼2.87
Posts /wp-admin/edit.php2,740 ▲342.70 ▲0.0174.25 ▼4.20104.20 ▲3.41
Add New Post /wp-admin/post-new.php1,678 ▲2518.33 ▼0.45358.88 ▼30.08116.77 ▼7.31
Media Library /wp-admin/upload.php1,809 ▲375.03 ▲0.01151.25 ▲3.90126.24 ▼2.69
Affiliate Tags /wp-admin/admin.php?page=my_kindle_books_affiliate_tags1,1262.0959.2171.18
My Kindle Books /wp-admin/admin.php?page=my_kindle_books8831.8535.2440.21

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/my-kindle-books/admin_menu.php+7
    Use of undefined constant my_kindle_books - assumed 'my_kindle_books' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 1 option in the database
    • recovery_mode_email_last_sent

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)
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my_kindle_books
    • > Warning in wp-content/plugins/my-kindle-books/admin_menu.php+7
    Use of undefined constant my_kindle_books - assumed 'my_kindle_books' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=my_kindle_books
    • > Warning in wp-content/plugins/my-kindle-books/admin_menu.php+12
    Use of undefined constant my_kindle_books_affiliate_tags - assumed 'my_kindle_books_affiliate_tags' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=my_kindle_books_affiliate_tags
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=my_kindle_books_affiliate_tags
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=my_kindle_books
    • > Error in wp-content/plugins/my-kindle-books/my-kindle-books.php+115
    Uncaught Error: Cannot use object of type WP_Error as array in /var/www/wordpress/wp-content/plugins/my-kindle-books/my-kindle-books.php:115Stack trace:#0 /var/www/wordpress/wp-content/plugins/my-kindle-books/admin_menu.php(21): getTld()#1 /var/www/wordpress/wp-includes/class-wp-hook.php(303): my_kindle_books()#2 /var/www/wordpress/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()#3 /var/www/wordpress/wp-includes/plugin.php(470): WP_Hook->do_action()#4 /var/www/wordpress/wp-admin/admin.php(259): do_action()#5 {main}thrown

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
Almost there! Just fix the following items
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-kindle-books/js_css.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-kindle-books/admin_menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-kindle-books/save_new_book_order.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-kindle-books/delete_book.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/my-kindle-books/affiliate-tags.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/my-kindle-books/add-books.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/my-kindle-books/my-kindle-books.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-kindle-books/save_books.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/my-kindle-books/mkb_page.php:31

User-side errors Passed 1 test

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

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
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #2 ([Your Book List Page](http://www.tail-fme.co.uk/wp-content/plugins/my-kindle-books/main-page2.jpg))
Please take inspiration from this readme.txt

my-kindle-books/my-kindle-books.php 92% from 13 tests

The principal PHP file in "My Kindle Books" v. 1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 225 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,691 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
CSS234491,129
PHP1024727562

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin