57% books-youve-read

Code Review | Books You’ve Read

WordPress plugin Books You’ve Read scored57%from 54 tests.

About plugin

  • Plugin page: books-youve-read
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 5, 2015
  • Latest release: Nov 5, 2015
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: trevorelwell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,406 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.92MB] [CPU: ▼57.78ms] Passed 4 tests

An overview of server-side resources used by Books You’ve Read
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.385.06 ▼32.01
Dashboard /wp-admin2.10 ▼1.245.83 ▼55.34
Posts /wp-admin/edit.php2.11 ▼1.256.28 ▼39.18
Add New Post /wp-admin/post-new.php2.10 ▼3.794.96 ▼98.10
Media Library /wp-admin/upload.php2.10 ▼1.135.45 ▼38.51
Books Read /wp-admin/edit.php?post_type=book2.115.00
Add New /wp-admin/post-new.php?post_type=book2.116.26

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

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

Browser metrics Passed 4 tests

Books You’ve Read: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,861 ▲11513.55 ▼1.002.02 ▲0.4443.97 ▲5.10
Dashboard /wp-admin2,238 ▲525.90 ▲0.99101.24 ▼8.9839.15 ▼0.19
Posts /wp-admin/edit.php2,118 ▲292.01 ▼0.0135.41 ▼0.0932.58 ▼0.59
Add New Post /wp-admin/post-new.php1,553 ▲3423.10 ▼0.29578.85 ▼33.5057.15 ▲0.03
Media Library /wp-admin/upload.php1,417 ▲294.23 ▲0.0695.42 ▼2.6342.93 ▼1.06
Books Read /wp-admin/edit.php?post_type=book1,1332.0932.3131.01
Add New /wp-admin/post-new.php?post_type=book2,2113.9266.3434.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the book handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=book
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the book handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=book
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the byr-js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

SRP 0% 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
Almost there! Just fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/books-youve-read/byr_functions.php
    • > /wp-content/plugins/books-youve-read/byr_init.php
    • > /wp-content/plugins/books-youve-read/byr.php
    • > /wp-content/plugins/books-youve-read/views/byr_show_all_books_view.php
    • > /wp-content/plugins/books-youve-read/byr_shortcodes.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/books-youve-read/book-template.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=book
    • > Network (severe)
    wp-content/plugins/byr/css/style.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: books, reading, books youve read

books-youve-read/byr.php 92% from 13 tests

The main PHP script in "Books You’ve Read" version 0.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("books-youve-read.php" instead of "byr.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin369 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP67932311
CSS18043
JavaScript14015

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin