73% spice-blocks

Code Review | Spice Blocks

WordPress plugin Spice Blocks scored73%from 54 tests.

About plugin

  • Plugin page: spice-blocks
  • Plugin version: 1.3.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3+
  • WordPress version: 6.3.1
  • First release: Dec 5, 2022
  • Latest release: Nov 22, 2023
  • Number of updates: 14
  • Update frequency: every 27.4 days
  • Top authors: spicethemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,685 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲5.03MB] [CPU: ▲23.62ms] 75% from 4 tests

This is a short check of server-side resources used by Spice Blocks
Please fix the following
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.03MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.89 ▲5.4363.71 ▲21.16
Dashboard /wp-admin8.91 ▲5.5678.03 ▲16.13
Posts /wp-admin/edit.php8.92 ▲5.5578.36 ▲30.05
Add New Post /wp-admin/post-new.php9.47 ▲3.58122.05 ▲27.13
Media Library /wp-admin/upload.php8.92 ▲5.6867.73 ▲31.87
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9262.54

Server storage [IO: ▲9.13MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • There were 1 file (0.16KB) illegally modified outside of "wp-content/plugins/spice-blocks/" and "wp-content/uploads/"
    • (new file) wp-content/themes/twentytwentyone/spice-blocks-full-width-template.php
Filesystem: 244 new files
Database: no new tables, 9 new options
New WordPress options
fs_active_plugins
can_compress_scripts
widget_theysaidso_widget
fs_debug_mode
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
fs_accounts

Browser metrics Passed 4 tests

An overview of browser requirements for Spice Blocks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,172 ▲42513.77 ▼0.3723.71 ▲21.9535.62 ▼8.35
Dashboard /wp-admin2,389 ▲2155.53 ▼0.1385.35 ▼4.3642.77 ▲5.58
Posts /wp-admin/edit.php2,268 ▲1652.13 ▲0.1239.60 ▼2.0738.78 ▲2.80
Add New Post /wp-admin/post-new.php2,287 ▲76016.63 ▼6.56652.05 ▼13.69201.35 ▲142.47
Media Library /wp-admin/upload.php1,707 ▲3074.16 ▼0.0899.19 ▲1.8744.58 ▲1.05
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,2251.6528.4631.97

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/spice-blocks/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • fs_active_plugins
    • db_upgraded
    • theysaidso_admin_options
    • fs_accounts
    • widget_recent-comments
    • widget_recent-posts
    • fs_debug_mode
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% 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
Please fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/spice-blocks/admin/view.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/spice-blocks/inc/template/spice-blocks-full-width-template.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/spice-blocks/inc/block-import.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Contributors: Plugin contributors field is missing
You can look at the official readme.txt

spice-blocks/spice-blocks.php 92% from 13 tests

The main PHP file in "Spice Blocks" ver. 1.3.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 171 characters long)

Code Analysis 97% from 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
No dangerous file extensions were detected119,375 lines of code in 166 files:
LanguageFilesBlank linesComment linesLines of code
JSON30036,734
JavaScript153,4983,37036,053
PHP1228,07517,24533,869
CSS221,61214712,472
Markdown1680214
SVG324033

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity91.22
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes49
▷ Abstract classes24.08%
▷ Concrete classes4795.92%
▷ Final classes12.13%
Methods1,268
▷ Static methods19815.62%
▷ Public methods87869.24%
▷ Protected methods171.34%
▷ Private methods37329.42%
Functions111
▷ Named functions10998.20%
▷ Anonymous functions21.80%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
25 compressed PNG files occupy 0.52MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/bg-pattern.png7.46KB6.88KB▼ 7.78%
admin/assets/images/demo-section-image/clients.png8.75KB9.28KB0.00%
admin/assets/images/demo-section-image/hero.png26.17KB26.96KB0.00%
admin/assets/images/block-card.png26.25KB27.52KB0.00%
admin/assets/images/demo-section-image/cta.png21.61KB22.46KB0.00%