83% blocks-collection

Code Review | Blocks Collection

WordPress plugin Blocks Collection scored83%from 54 tests.

About plugin

  • Plugin page: blocks-collection
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.1
  • WordPress version: 6.3.1
  • First release: May 26, 2020
  • Latest release: Jan 31, 2023
  • Number of updates: 9
  • Update frequency: every 108.9 days
  • Top authors: WeblineIndia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,086 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 gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼12.35ms] Passed 4 tests

An overview of server-side resources used by Blocks Collection
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0838.35 ▼3.86
Dashboard /wp-admin3.38 ▲0.0353.64 ▼13.99
Posts /wp-admin/edit.php3.49 ▲0.1351.88 ▼0.90
Add New Post /wp-admin/post-new.php5.96 ▲0.0788.86 ▼30.66
Media Library /wp-admin/upload.php3.30 ▲0.0738.00 ▲2.43

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Blocks Collection
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲5614.23 ▼0.121.99 ▲0.0438.97 ▲1.65
Dashboard /wp-admin2,211 ▲345.55 ▲0.0184.19 ▼14.8941.09 ▲1.22
Posts /wp-admin/edit.php2,119 ▲161.99 ▲0.0238.84 ▼5.6336.96 ▼0.54
Add New Post /wp-admin/post-new.php6,380 ▲4,85427.61 ▲4.62925.95 ▲206.1060.01 ▲4.07
Media Library /wp-admin/upload.php1,419 ▲254.28 ▲0.0899.49 ▼12.1045.26 ▼2.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/blocks-collection/includes/class-gbc-blocks.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed: You can take inspiration from this readme.txt

blocks-collection/blocks-collection.php 85% from 13 tests

The principal PHP file in "Blocks Collection" v. 1.0.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected332 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP895379275
CSS21056
JavaScript1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity3.20
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.39
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods2485.71%
▷ Protected methods00.00%
▷ Private methods414.29%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/logo.png0.24KB0.25KB0.00%