84% block-styles

Code Review | Block Styles

WordPress plugin Block Styles scored84%from 54 tests.

About plugin

  • Plugin page: block-styles
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Jun 12, 2020
  • Latest release: Jul 17, 2020
  • Number of updates: 4
  • Update frequency: every 11.3 days
  • Top authors: aristath (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,326 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.14MB] [CPU: ▼4.94ms] Passed 4 tests

Server-side resources used by Block Styles
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2041.64 ▼3.52
Dashboard /wp-admin3.40 ▲0.0950.14 ▲0.89
Posts /wp-admin/edit.php3.51 ▲0.1546.44 ▼0.78
Add New Post /wp-admin/post-new.php6.36 ▲0.4787.26 ▼16.36
Media Library /wp-admin/upload.php3.32 ▲0.0938.46 ▲1.34
Block Styles /wp-admin/options-general.php?page=block-styles3.32337.74

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 71 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Block Styles
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲6613.58 ▼0.854.75 ▲2.9042.08 ▼6.99
Dashboard /wp-admin2,207 ▲165.80 ▲0.9496.03 ▼5.1238.00 ▼6.54
Posts /wp-admin/edit.php2,093 ▲42.05 ▼0.0033.47 ▼2.6234.77 ▲1.44
Add New Post /wp-admin/post-new.php1,819 ▲28623.15 ▲0.03678.57 ▲84.8629.90 ▼19.35
Media Library /wp-admin/upload.php1,395 ▲104.14 ▼0.09103.77 ▲3.3246.50 ▲3.88
Block Styles /wp-admin/options-general.php?page=block-styles1,9882.1624.4634.99

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/block-styles/block-styles.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

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
4 plugin tags: performance, styles, blocks, sustainable

block-styles/block-styles.php Passed 13 tests

The main file in "Block Styles" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
46 characters long description:
Optimize the way your block styles get loaded.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin409 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP483303375
CSS340034

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.45
Average class complexity19.00
▷ Minimum class complexity13.00
▷ Maximum class complexity31.00
Average method complexity4.07
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1487.50%
▷ Protected methods00.00%
▷ Private methods212.50%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants3
▷ Global constants3100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/sponsors/wplemon.png2.65KB2.82KB0.00%