79% icafe-library

Code Review | iCafe Library

WordPress plugin iCafe Library scored79%from 54 tests.

About plugin

  • Plugin page: icafe-library
  • Plugin version: 1.8.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 16, 2013
  • Latest release: Feb 20, 2014
  • Number of updates: 37
  • Update frequency: every 10.0 days
  • Top authors: cnilsson (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

30+ active /6,710 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.04ms] Passed 4 tests

This is a short check of server-side resources used by iCafe Library
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.08 ▼0.3823.87 ▼16.57
Dashboard /wp-admin3.59 ▲0.2854.23 ▲0.10
Posts /wp-admin/edit.php3.70 ▲0.3557.29 ▲8.61
Add New Post /wp-admin/post-new.php6.17 ▲0.2890.33 ▼6.27
Media Library /wp-admin/upload.php3.49 ▲0.2637.02 ▼1.41
iCafe Library /wp-admin/admin.php?page=iCafe-Library-admin3.4838.30
Appearance /wp-admin/admin.php?page=iCafe-Library-Appearance3.4952.37
Custom Bookshelves /wp-admin/admin.php?page=iCafe-Library-Custom-Bookshelves3.4839.88
Manage Books /wp-admin/admin.php?page=iCafe-Library-Sections3.4536.68
Manage Resources /wp-admin/admin.php?page=iCafe-Library-Resources3.4535.74

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 25 new files
Database: 3 new tables, 23 new options
New tables
wp_gw_tiles
wp_gw_lookup
wp_gw_sections
New WordPress options
active_chapter_text
active_section_color
default_chapter_icon
active_chapter_icon
db_upgraded
resource_list_text
active_chapter_color
active_section_icon
hide_circle
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for iCafe Library
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,081 ▲33515.42 ▲1.0110.79 ▲8.8945.05 ▲2.51
Dashboard /wp-admin2,387 ▲1966.59 ▲0.71138.14 ▲31.8842.19 ▼0.32
Posts /wp-admin/edit.php2,290 ▲1983.46 ▲1.4046.88 ▲4.9430.09 ▼6.89
Add New Post /wp-admin/post-new.php1,550 ▲3123.27 ▼0.04642.26 ▼1.4637.66 ▼14.21
Media Library /wp-admin/upload.php1,432 ▲444.23 ▲0.0098.38 ▼16.4155.12 ▲4.14
iCafe Library /wp-admin/admin.php?page=iCafe-Library-admin3,36331.86975.4461.38
Appearance /wp-admin/admin.php?page=iCafe-Library-Appearance1,5793.2147.2759.04
Custom Bookshelves /wp-admin/admin.php?page=iCafe-Library-Custom-Bookshelves1,0033.1343.1829.05
Manage Books /wp-admin/admin.php?page=iCafe-Library-Sections1,2463.3844.1729.56
Manage Resources /wp-admin/admin.php?page=iCafe-Library-Resources1,2003.1341.5338.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 22 options
    • active_section_text
    • resource_list_border
    • can_compress_scripts
    • active_section_color
    • default_chapter_text
    • hide_circle
    • default_chapter_color
    • default_section_text
    • widget_theysaidso_widget
    • default_section_icon
    • ...

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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=iCafe-Library-Sections
    • > Notice in wp-content/plugins/icafe-library/icafe-library.php+1748
    Undefined index: state
    • > GET request to /wp-admin/admin.php?page=iCafe-Library-Resources
    • > Notice in wp-content/plugins/icafe-library/icafe-library.php+2902
    Undefined index: tid

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/icafe-library/icafe-library.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: ground work, groundwork, icafe, library, staff development...

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

This is the main PHP file of "iCafe Library" version 1.8.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
92 characters long description:
Wordpress plugin to organize and deploy large scale staff/professional development materials

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected3,644 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP22,5011251,772
CSS44052151,135
JavaScript6424318708
XML30029

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions36
▷ Named functions36100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_d4d4d4_0.png9.28KB4.76KB▼ 48.74%
css/images/ui-icons_3399ff_0.png9.28KB4.76KB▼ 48.72%
css/images/ui-icons_333333_0.png9.28KB4.76KB▼ 48.69%
css/images/ui-icons_0E6D38_0.png9.28KB4.76KB▼ 48.71%
css/images/ui-icons_ffffff_0.png9.31KB4.76KB▼ 48.86%