83% styles-library

Code Review | Styles Library

WordPress plugin Styles Library scored83%from 54 tests.

About plugin

  • Plugin page: styles-library
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.1
  • WordPress version: 6.3.1
  • First release: Oct 26, 2022
  • Latest release: Nov 11, 2022
  • Number of updates: 4
  • Update frequency: every 4.0 days
  • Top authors: blockstyles (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /958 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
Installer ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▲0.24ms] Passed 4 tests

An overview of server-side resources used by Styles Library
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2741.92 ▲4.63
Dashboard /wp-admin3.60 ▲0.2650.86 ▼10.99
Posts /wp-admin/edit.php3.70 ▲0.3447.84 ▲2.59
Add New Post /wp-admin/post-new.php6.42 ▲0.53233.84 ▲133.15
Media Library /wp-admin/upload.php3.50 ▲0.2739.40 ▲4.74
Categories /wp-admin/edit-tags.php?taxonomy=pattern-category&post_type=ea_block_pattern3.5138.26
Add New /wp-admin/post-new.php?post_type=ea_block_pattern6.41199.14
All Patterns /wp-admin/edit.php?post_type=ea_block_pattern3.5540.78
Keywords /wp-admin/edit-tags.php?taxonomy=pattern-keyword&post_type=ea_block_pattern3.5033.98

Server storage [IO: ▲7.31MB] [DB: ▲0.14MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 74 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Styles Library
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,132 ▲38624.20 ▲9.825.95 ▲4.2143.22 ▼0.86
Dashboard /wp-admin2,424 ▲24414.25 ▲9.21276.98 ▲148.6543.15 ▼4.08
Posts /wp-admin/edit.php2,357 ▲26811.67 ▲9.66126.67 ▲92.5734.77 ▼0.66
Add New Post /wp-admin/post-new.php1,757 ▲23823.42 ▲0.36565.91 ▼101.3839.10 ▼11.74
Media Library /wp-admin/upload.php1,599 ▲21113.06 ▲8.83145.59 ▲38.6741.27 ▼5.46
Categories /wp-admin/edit-tags.php?taxonomy=pattern-category&post_type=ea_block_pattern1,54211.55114.3930.26
Add New /wp-admin/post-new.php?post_type=ea_block_pattern1,61517.15764.2540.67
All Patterns /wp-admin/edit.php?post_type=ea_block_pattern1,41411.73109.1328.07
Keywords /wp-admin/edit-tags.php?taxonomy=pattern-keyword&post_type=ea_block_pattern1,51411.51114.5829.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=ea_block_pattern
    • > Console-api (warning) in wp-includes/js/dist/deprecated.min.js?ver=73ad3591e7bc95f4777a+1:627
    Using custom components as toolbar controls is deprecated since version 5.6. Please use ToolbarItem, ToolbarButton or ToolbarDropdownMenu components instead. See: https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: block patterns, gutenberg, blocks, block editor, patterns

styles-library/ea-styles-library.php 85% from 13 tests

The main file in "Styles Library" v. 2.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("styles-library.php" instead of "ea-styles-library.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin3,133 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP213236801,317
JavaScript201722081,222
Sass31090497
Markdown140077
SVG20111
JSON1005
CSS3004

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity19.50
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits1
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods74
▷ Static methods2229.73%
▷ Public methods6891.89%
▷ Protected methods45.41%
▷ Private methods22.70%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
20 PNG files occupy 7.13MB with 5.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress-org/screenshot-2.png539.32KB143.64KB▼ 73.37%
.wordpress-org/banner-772x250.png146.63KB48.24KB▼ 67.10%
.wordpress-org/screenshot-1.png525.50KB135.46KB▼ 74.22%
.wordpress-org/screenshot-4.png537.03KB140.66KB▼ 73.81%
.wordpress-org/banner-1544x500.png496.75KB157.26KB▼ 68.34%