79% classroom-library

Code Review | Classroom Library

WordPress plugin Classroom Library scored79%from 54 tests.

About plugin

  • Plugin page: classroom-library
  • Plugin version: 0.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 19, 2022
  • Latest release: Sep 25, 2023
  • Number of updates: 11
  • Update frequency: every 36.5 days
  • Top authors: mdburnette (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /457 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.56MB] [CPU: ▼16.63ms] Passed 4 tests

Analyzing server-side resources used by Classroom Library
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1342.07 ▼1.14
Dashboard /wp-admin3.43 ▲0.1344.06 ▼6.05
Posts /wp-admin/edit.php3.48 ▲0.1248.77 ▲1.37
Add New Post /wp-admin/post-new.php3.28 ▼2.6137.26 ▼58.76
Media Library /wp-admin/upload.php3.36 ▲0.1234.00 ▼0.56
Add New /wp-admin/post-new.php?post_type=mbcl_transaction3.2135.45
Publications /wp-admin/edit.php?post_type=mbcl_publication3.4034.60
Add New /wp-admin/post-new.php?post_type=mbcl_publication3.2132.81
Transactions /wp-admin/edit.php?post_type=mbcl_transaction3.4033.91

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Classroom Library
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲19214.05 ▼0.345.53 ▲3.5645.20 ▼5.52
Dashboard /wp-admin2,264 ▲765.00 ▲0.07111.79 ▲7.1941.05 ▼1.55
Posts /wp-admin/edit.php2,147 ▲552.03 ▲0.0141.49 ▲2.0936.49 ▲2.42
Add New Post /wp-admin/post-new.php1,575 ▲4018.43 ▼4.63601.42 ▼79.6050.44 ▼0.41
Media Library /wp-admin/upload.php1,446 ▲554.25 ▲0.0994.32 ▼7.5741.47 ▼3.39
Add New /wp-admin/post-new.php?post_type=mbcl_transaction6,48821.07894.0732.96
Publications /wp-admin/edit.php?post_type=mbcl_publication1,1151.9834.7631.27
Add New /wp-admin/post-new.php?post_type=mbcl_publication1,57017.15753.6441.34
Transactions /wp-admin/edit.php?post_type=mbcl_transaction1,1261.9636.8229.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 26 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/transaction-cpt.php+111
    Trying to get property 'ID' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/publication-cpt.php+134
    Undefined index: mbcl_publication_barcode
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/publication-cpt.php+134
    Undefined index: mbcl_publication_author_first_name
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/publication-cpt.php+134
    Undefined index: mbcl_publication_author_last_name
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/publication-cpt.php+134
    Undefined index: mbcl_publication_cover_image_url
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/publication-cpt.php+134
    Undefined index: mbcl_publication_openlibrary_key
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/publication-cpt.php+134
    Undefined index: mbcl_publication_count
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/publication-cpt.php+134
    Undefined index: mbcl_publication_count_available
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/transaction-cpt.php+111
    Undefined index: mbcl_transaction_checkout_date
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/transaction-cpt.php+111
    Undefined index: mbcl_transaction_user
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/transaction-cpt.php+111
    Undefined index: mbcl_transaction_checkin_date
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/transaction-cpt.php+111
    Undefined index: mbcl_transaction_publication_id
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/transaction-cpt.php+111
    Undefined index: mbcl_transaction_publication_barcode
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/transaction-cpt.php+111
    Undefined index: mbcl_transaction_publication_copies
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/publication-cpt.php+134
    Trying to access array offset on value of type null
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=mbcl_publication
    • > Notice in wp-content/plugins/classroom-library/inc/publication-cpt.php+135
    Undefined index: field_type

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/classroom-library/inc/transaction-cpt.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/classroom-library/inc/create-transaction.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/classroom-library/inc/publication-cpt.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/classroom-library/templates/single-publication.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/classroom-library/inc/bookshelf.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: education, classroom, books, library

classroom-library/classroom-library.php Passed 13 tests

"Classroom Library" version 0.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
90 characters long description:
Classroom library directory with bookshelf, book search, barcode lookup, and check in/out.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected891 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP618087568
CSS15111227
JavaScript2461696

PHP code Passed 2 tests

An overview of 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.35
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%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 images were found in this plugin