83% cosmic-blocks

Code Review | Cosmic Blocks (40+) Content Editor Blocks Collection

WordPress plugin Cosmic Blocks (40+) Content Editor Blocks Collection scored83%from 54 tests.

About plugin

  • Plugin page: cosmic-blocks
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 7, 2018
  • Latest release: Sep 21, 2023
  • Number of updates: 94
  • Update frequency: every 18.6 days
  • Top authors: berginformatik (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /12,957 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.95MB] [CPU: ▼1.46ms] Passed 4 tests

Analyzing server-side resources used by Cosmic Blocks (40+) Content Editor Blocks Collection
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.52 ▲1.0544.45 ▲3.85
Dashboard /wp-admin4.22 ▲0.8749.50 ▼13.03
Posts /wp-admin/edit.php4.33 ▲0.9749.42 ▲2.28
Add New Post /wp-admin/post-new.php7.09 ▲1.19100.10 ▲1.73
Media Library /wp-admin/upload.php4.16 ▲0.9341.70 ▲3.18
Cosmic Blocks /wp-admin/options-general.php?page=cosmic_wp_blocks4.1334.95

Server storage [IO: ▲8.79MB] [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: 160 new files
Database: no new tables, 71 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Cosmic Blocks (40+) Content Editor Blocks Collection
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲15213.91 ▼0.449.55 ▲7.4435.91 ▼7.02
Dashboard /wp-admin2,204 ▲305.60 ▲0.0981.59 ▼9.6838.17 ▼0.47
Posts /wp-admin/edit.php2,112 ▲122.06 ▲0.0535.25 ▼2.5632.17 ▼5.10
Add New Post /wp-admin/post-new.php6,339 ▲4,81319.99 ▼3.15887.46 ▲233.8235.07 ▼21.53
Media Library /wp-admin/upload.php1,412 ▲94.22 ▲0.0296.38 ▼1.4844.08 ▲2.51
Cosmic Blocks /wp-admin/options-general.php?page=cosmic_wp_blocks1,5101.8325.3144.90

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 20 options in the database
    • cosmic_blocks_front_block_simple_small
    • cosmic_blocks_mobile_main_padding_top
    • cosmic_blocks_mobile_main_intro_padding_bottom
    • cosmic_blocks_main_padding_bottom
    • cosmic_blocks_editor_block_wide_width
    • cosmic_blocks_permalinks_flushed
    • can_compress_scripts
    • cosmic_blocks_main_intro_padding_bottom
    • db_upgraded
    • widget_recent-posts
    • ...

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/cosmic-blocks/custompages/fix-noopener.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found


Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Screenshots: No descriptions were found for these screenshots #68, #69 in cosmic-blocks/assets to your readme.txt
  • Tags: There are too many tags (32 tag instead of maximum 10)
The official readme.txt is a good inspiration

cosmic-blocks/cosmic-blocks.php Passed 13 tests

The main PHP file in "Cosmic Blocks (40+) Content Editor Blocks Collection" ver. 1.3.0 adds more information about the plugin and also serves as the entry point for this plugin
115 characters long description:
High quality blocks collection of 40+ customizable WordPress 5.0 gutenberg content blocks for the new block editor.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin86,811 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PO File14961,6731,033

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity88.50
▷ Minimum class complexity9.00
▷ Maximum class complexity188.00
Average method complexity11.00
▷ Minimum method complexity1.00
▷ Maximum method complexity99.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
▷ Static methods720.00%
▷ Public methods3497.14%
▷ Protected methods00.00%
▷ Private methods12.86%
▷ Named functions1560.00%
▷ Anonymous functions1040.00%
▷ Global constants3100.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
58 PNG files occupy 1.22MB with 0.59MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/block-advantages.png16.19KB7.33KB▼ 54.74%
assets/images/block-donations.png11.98KB6.33KB▼ 47.11%
assets/images/block-image.png4.79KB2.62KB▼ 45.21%
assets/images/block-social-share.png44.28KB27.08KB▼ 38.85%
assets/images/block-countup.png10.99KB4.96KB▼ 54.88%