78% library-instruction-recorder

Code Review | Library Instruction Recorder

WordPress plugin Library Instruction Recorder scored78%from 54 tests.

About plugin

  • Plugin page: library-instructi...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.2.4
  • WordPress version: 6.3.1
  • First release: Aug 26, 2014
  • Latest release: Sep 8, 2015
  • Number of updates: 10
  • Update frequency: every 37.8 days
  • Top authors: mbrooks34 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,023 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.25MB] [CPU: ▲1.55ms] Passed 4 tests

A check of server-side resources used by Library Instruction Recorder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2440.03 ▼0.03
Dashboard /wp-admin3.56 ▲0.2657.48 ▲5.82
Posts /wp-admin/edit.php3.67 ▲0.3255.30 ▲3.28
Add New Post /wp-admin/post-new.php6.14 ▲0.2593.32 ▲2.32
Media Library /wp-admin/upload.php3.48 ▲0.2638.42 ▲0.63
Add a Class /wp-admin/admin.php?page=LIR-add-a-class3.4335.31
Settings /wp-admin/admin.php?page=LIR-settings3.4536.51
Upcoming Classes /wp-admin/admin.php?page=LIR3.4333.93
Reports /wp-admin/admin.php?page=LIR-reports3.4535.89
Fields /wp-admin/admin.php?page=LIR-fields3.4336.42

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 37 new files
Database: 3 new tables, 6 new options
New tables
wp_LIR_posts
wp_LIR_meta
wp_LIR_flags
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Library Instruction Recorder: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲8814.11 ▼0.271.75 ▼0.1341.83 ▼1.47
Dashboard /wp-admin2,227 ▲505.62 ▲0.0394.68 ▲6.8740.83 ▼1.47
Posts /wp-admin/edit.php2,135 ▲322.02 ▲0.0839.72 ▼3.7438.21 ▲0.69
Add New Post /wp-admin/post-new.php1,563 ▲2318.50 ▲0.04659.07 ▲6.6763.82 ▲8.43
Media Library /wp-admin/upload.php1,429 ▲294.16 ▼0.0396.98 ▼7.2343.96 ▼0.38
Add a Class /wp-admin/admin.php?page=LIR-add-a-class1,1802.3741.4828.06
Settings /wp-admin/admin.php?page=LIR-settings9572.3542.4345.20
Upcoming Classes /wp-admin/admin.php?page=LIR1,0192.5751.9629.29
Reports /wp-admin/admin.php?page=LIR-reports9192.4833.2330.04
Fields /wp-admin/admin.php?page=LIR-fields1,0192.3129.8927.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=LIR
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=LIR-fields
    • > Warning in wp-content/plugins/library-instruction-recorder/library-instruction-recorder.php+1604
    Invalid argument supplied for foreach()
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=LIR-fields
    • > Warning in wp-content/plugins/library-instruction-recorder/library-instruction-recorder.php+1587
    count(): Parameter must be an array or an object that implements Countable

SRP 50% 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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/library-instruction-recorder/library-instruction-recorder.php:68

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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
7 plugin tags: library instruction recorder, instruction, instruction scheduling, teaching, library instruction...

library-instruction-recorder/library-instruction-recorder.php Passed 13 tests

"Library Instruction Recorder" version 1.1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
76 characters long description:
A plugin for recording library instruction events and their associated data.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,446 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP12983301,203
JavaScript22856206
CSS3223937

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 129)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity310.00
▷ Minimum class complexity310.00
▷ Maximum class complexity310.00
Average method complexity16.45
▷ Minimum method complexity1.00
▷ Maximum method complexity129.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods315.00%
▷ Public methods1680.00%
▷ Protected methods00.00%
▷ Private methods420.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants00.00%
▷ Class constants12100.00%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
26 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/jquery-ui/redmond/images/ui-icons_f9bd01_256x240.png4.44KB4.17KB▼ 6.02%
css/jquery-ui/redmond/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
css/dataTables/images/sort_asc_disabled.png2.85KB0.25KB▼ 91.36%
css/jquery-ui/redmond/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%
css/jquery-ui/redmond/images/ui-bg_flat_55_fbec88_40x100.png0.20KB0.08KB▼ 57.77%