78% qi-blocks

Code Review | Qi Blocks

WordPress plugin Qi Blocks scored78%from 54 tests.

About plugin

  • Plugin page: qi-blocks
  • Plugin version: 1.2.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 6, 2022
  • Latest release: Nov 14, 2023
  • Number of updates: 41
  • Update frequency: every 10.6 days
  • Top authors: qodeinteractive (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30,000+ active /163,422 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

A check of server-side resources used by Qi Blocks
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.34 ▲1.8753.49 ▲12.11
Dashboard /wp-admin4.64 ▲1.3050.77 ▼8.36
Posts /wp-admin/edit.php4.69 ▲1.3356.59 ▲13.02
Add New Post /wp-admin/post-new.php8.54 ▲2.65111.09 ▲13.62
Media Library /wp-admin/upload.php4.57 ▲1.3440.97 ▲8.79

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 424 new files
Database: no new tables, 8 new options
New WordPress options
qi_blocks_global_styles
theysaidso_admin_options
qi_blocks_cropped_images
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Qi Blocks
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲17413.72 ▼0.999.58 ▲7.6237.69 ▼5.67
Dashboard /wp-admin2,197 ▲225.56 ▼0.1496.08 ▼24.9479.33 ▲34.78
Posts /wp-admin/edit.php2,120 ▲201.96 ▲0.0244.28 ▲5.9934.77 ▲1.59
Add New Post /wp-admin/post-new.php6,605 ▲5,07940.34 ▲17.361,486.77 ▲796.6549.90 ▼18.82
Media Library /wp-admin/upload.php1,420 ▲204.22 ▲0.03100.00 ▲6.0673.72 ▲33.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • qi_blocks_global_styles
    • can_compress_scripts
    • qi_blocks_cropped_images
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/qi-blocks/inc/slider/templates/swiper-pag.php
    • > /wp-content/plugins/qi-blocks/inc/slider/templates/parts/arrow-right.php
    • > /wp-content/plugins/qi-blocks/inc/slider/templates/parts/arrow-left.php
  • 161× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(QI_BLOCKS_INC_PATH/comments/class-qi-blocks-comments-rest-api.php): failed to open stream: No such file or directory in wp-content/plugins/qi-blocks/inc/comments/include.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_class() in wp-content/plugins/qi-blocks/inc/blocks/blog-list/variations/standard/layouts/standard.php:1
    • > PHP Warning
      include_once(): Failed opening 'QI_BLOCKS_INC_PATH/comments/class-qi-blocks-comments-rest-api.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/qi-blocks/inc/comments/include.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/qi-blocks/inc/admin/admin-pages/templates/footer.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/qi-blocks/inc/slider/templates/swiper-nav-outside.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/qi-blocks/inc/admin/admin-pages/templates/parts/footer-text.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_product_class() in wp-content/plugins/qi-blocks/inc/blocks/product-list/variations/info-below/layouts/info-below.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function qi_blocks_template_part() in wp-content/plugins/qi-blocks/inc/admin/admin-pages/sub-pages/widgets/templates/sidebar.php:3
    • > PHP Warning
      Use of undefined constant QI_BLOCKS_ADMIN_PATH - assumed 'QI_BLOCKS_ADMIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/qi-blocks/inc/admin/global-settings/include.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/qi-blocks/inc/admin/admin-pages/templates/parts/sidebar/social-instagram.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

qi-blocks/class-qi-blocks.php 92% from 13 tests

The main file in "Qi Blocks" v. 1.2.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("qi-blocks.php" instead of "class-qi-blocks.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin45,982 lines of code in 383 files:
LanguageFilesBlank linesComment linesLines of code
JSON20026,069
PHP1791,4801,06318,459
SVG6610704
JavaScript829449696
CSS5432854

PHP code Passed 2 tests

A short review 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.47
Average class complexity8.46
▷ Minimum class complexity1.00
▷ Maximum class complexity126.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity70.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes67
▷ Abstract classes11.49%
▷ Concrete classes6698.51%
▷ Final classes00.00%
Methods295
▷ Static methods6221.02%
▷ Public methods29499.66%
▷ Protected methods00.00%
▷ Private methods10.34%
Functions81
▷ Named functions6479.01%
▷ Anonymous functions1720.99%
Constants17
▷ Global constants17100.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
23 PNG files occupy 0.74MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/admin/admin-pages/assets/img/qi-blocks.png224.18KB56.27KB▼ 74.90%
inc/admin/admin-pages/assets/img/help-center-icon.png2.03KB0.94KB▼ 53.62%
inc/admin/admin-pages/sub-pages/setup-wizard/assets/img/wizard-step-5-bg.png65.22KB23.23KB▼ 64.38%
assets/img/placeholder.png13.83KB7.13KB▼ 48.48%
inc/admin/admin-pages/sub-pages/setup-wizard/assets/img/wizard-step-1-logo.png2.71KB1.93KB▼ 28.62%