79% gravitate-blocks

Code Review | Gravitate Blocks

WordPress plugin Gravitate Blocks scored 79% from 54 tests.

About plugin

  • Plugin page: gravitate-blocks
  • Plugin version: 1.7.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7.2
  • WordPress version: 5.9.2
  • First release: Nov 2, 2015
  • Latest release: Feb 9, 2017
  • Number of updates: 38
  • Update frequency: every 12.2 days
  • Top authors: bferdinand (86.84%)Gravitate (15.79%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 2,428 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Gravitate Blocks
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3055.07 ▼5.74
Dashboard /wp-admin3.73 ▲0.3237.08 ▲3.48
Posts /wp-admin/edit.php3.95 ▲0.3142.44 ▲2.53
Add New Post /wp-admin/post-new.php7.19 ▲0.2194.39 ▼1,175.80
Media Library /wp-admin/upload.php3.64 ▲0.3526.46 ▲2.43

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 50 new files
Database: no new tables, 1 new option
New WordPress options
gravitate_blocks_settings

Browser metrics Passed 4 tests

Checking browser requirements for Gravitate Blocks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,848 ▲9415.93 ▼0.036.95 ▲0.862.36 ▼0.08
Dashboard /wp-admin2,930 ▲696.23 ▲0.04120.72 ▼14.22156.53 ▼8.88
Posts /wp-admin/edit.php2,739 ▲543.28 ▲0.0465.61 ▼1.30144.12 ▲0.43
Add New Post /wp-admin/post-new.php1,649 ▼4119.68 ▼0.99385.02 ▼68.70156.17 ▼0.84
Media Library /wp-admin/upload.php1,740 ▲425.52 ▲0.04143.27 ▲1.01193.70 ▲7.09

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • gravitate_blocks_settings

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/gravitate-blocks/library/includes/developer.php
  • 57× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_sub_field() in wp-content/plugins/gravitate-blocks/grav-blocks/title/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GRAV_BLOCKS' not found in wp-content/plugins/gravitate-blocks/grav-blocks/testimonials/block_fields.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_sub_field() in wp-content/plugins/gravitate-blocks/grav-blocks/testimonials/block.php:2
    • > PHP Notice
      Undefined variable: block_background_image in wp-content/plugins/gravitate-blocks/grav-blocks/calltoaction/block_fields.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'GRAV_BLOCKS' not found in wp-content/plugins/gravitate-blocks/grav-blocks/media/block_fields.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'GRAV_BLOCKS' not found in wp-content/plugins/gravitate-blocks/grav-blocks/media-content/block.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/gravitate-blocks/gravitate-blocks.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GRAV_BLOCKS' not found in wp-content/plugins/gravitate-blocks/grav-blocks/media-content/block_fields.php:62
    • > PHP Notice
      Undefined variable: block in wp-content/plugins/gravitate-blocks/grav-blocks/media-gallery/block_fields.php on line 43
    • > PHP Notice
      Undefined variable: block_background_image in wp-content/plugins/gravitate-blocks/grav-blocks/title/block_fields.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: gravitate, advanced custom fields, acf, content blocks

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

Analyzing the main PHP file in "Gravitate Blocks" version 1.7.5
22 characters long description:
Create Content Blocks.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin6,119 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP214305013,150
CSS5230411,953
Sass3232561
SVG12012397
JavaScript221626
JSON10021
Ruby181011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity132.00
▷ Minimum class complexity45.00
▷ Maximum class complexity255.00
Average method complexity6.17
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods76
▷ Static methods6180.26%
▷ Public methods7294.74%
▷ Protected methods00.00%
▷ Private methods45.26%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
library/images/gravitate-logo.png5.11KB2.51KB▼ 50.79%