68% cosmic-blocks

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

WordPress plugin Cosmic Blocks (40+) Content Editor Blocks Collection scored 68% from 53 tests.

About plugin

  • Plugin page: cosmic-blocks
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 5.8.1
  • First release: Dec 7, 2018
  • Latest release: Mar 10, 2021
  • Number of updates: 88
  • Update frequency: every 9.4 days
  • Top authors: berginformatik (100%)

Code review

53 tests

User reviews

3 reviews

Install metrics

200+ active / 9,465 total downloads

Benchmarks

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.82MB] [CPU: ▼274.54ms] Passed 4 tests

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 /3.71 ▲0.8839.46 ▲3.39
Dashboard /wp-admin4.04 ▲0.9948.08 ▲4.16
Posts /wp-admin/edit.php4.09 ▲0.9949.96 ▲4.93
Add New Post /wp-admin/post-new.php5.94 ▲0.5167.97 ▼1,103.51
Media Library /wp-admin/upload.php3.92 ▲0.9137.04 ▼2.21
Blocks /wp-admin/admin.php?page=cosmic_wp_blocks3.8952.08

Server storage [IO: ▲9.69MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 382 new files
Database: no new tables, 70 new options
New WordPress options
cosmic_blocks_split_list
cosmic_blocks_pricelist
cosmic_blocks_voting_slogans
cosmic_blocks_inline_notice
cosmic_blocks_front_block
cosmic_blocks_employee_list
cosmic_blocks_contacts_list
cosmic_blocks_donations_stripe_currency
cosmic_blocks_events_upcoming_tiles
cosmic_blocks_dependency_check
...

Browser metrics Passed 4 tests

An overview of browser requirements for Cosmic Blocks (40+) Content Editor Blocks Collection
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,891 ▲30916.61 ▲1.1112.67 ▲4.2750.40 ▲1.14
Dashboard /wp-admin3,017 ▲1646.25 ▲0.43133.20 ▼8.01104.52 ▼15.48
Posts /wp-admin/edit.php2,795 ▲892.73 ▲0.0472.10 ▼7.9190.01 ▼59.35
Add New Post /wp-admin/post-new.php1,847 ▲29317.87 ▼0.29406.25 ▼151.16110.65 ▼24.33
Media Library /wp-admin/upload.php1,862 ▲755.11 ▲0.08141.80 ▼11.99124.41 ▲14.62
Blocks /wp-admin/admin.php?page=cosmic_wp_blocks1,9142.2569.12134.18

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
These items require your attention
  • This plugin does not fully uninstall, leaving 16 options in the database
    • cosmic_blocks_front_block_simple_small
    • cosmic_blocks_front_block_custom_query
    • cosmic_blocks_front_block_custom_wide
    • cosmic_blocks_donations_stripe_secret
    • cosmic_blocks_editor_block_width
    • cosmic_blocks_editor_block_wide_width
    • cosmic_blocks_mobile_main_padding_top
    • cosmic_blocks_mobile_main_intro_padding_bottom
    • cosmic_blocks_main_intro_padding_bottom
    • cosmic_blocks_front_block_simple_wide
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/cosmic-blocks/assets/stripe-php-master/build.php
    • > /wp-content/plugins/cosmic-blocks/assets/stripe-php-master/update_certs.php
  • 183× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/Service/OrderService.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/OAuthErrorObject.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/Service/Terminal/ConnectionTokenService.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/BankAccount.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/WebhookEndpoint.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/Service/SetupIntentService.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/ExchangeRate.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/Service/ApplePayDomainService.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/Service/CountrySpecService.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/cosmic-blocks/assets/stripe-php-master/lib/Dispute.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 33 tag instead of maximum 10
You can look at the official readme.txt

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

The main PHP script in "Cosmic Blocks (40+) Content Editor Blocks Collection" version 1.2.2 is automatically included on every request by WordPress
115 characters long description:
High quality blocks collection of 40+ customizable WordPress 5.0 gutenberg content blocks for the new block editor.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/cosmic-blocks/assets/stripe-php-master/data/ca-certificates.crt
96,187 lines of code in 291 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5683730776,878
PHP2141,8128,5909,776
JSON3002,928
SVG3102,685
CSS84053401,876
PO File15101,7131,065
Markdown36210918
XML10031
make19027
YAML1003

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 101)
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.47
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity101.00
Code structure
Namespaces21
Interfaces6
Traits7
Classes196
▷ Abstract classes105.10%
▷ Concrete classes18694.90%
▷ Final classes00.00%
Methods682
▷ Static methods16123.61%
▷ Public methods62291.20%
▷ Protected methods273.96%
▷ Private methods334.84%
Functions30
▷ Named functions1550.00%
▷ Anonymous functions1550.00%
Constants655
▷ Global constants50.76%
▷ Class constants65099.24%
▷ Public constants650100.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
58 PNG files occupy 1.22MB with 0.66MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/block-employee-list.png9.75KB4.30KB▼ 55.91%
assets/images/mastercard.png6.33KB3.45KB▼ 45.48%
assets/images/block-date-tiles.png16.29KB6.31KB▼ 61.27%
assets/images/block-linklist-images-slide.png17.89KB7.43KB▼ 58.48%
assets/images/block-buttons.png9.86KB4.96KB▼ 49.66%