78% c9-blocks

Code Review | C9 Blocks

WordPress plugin C9 Blocks scored78%from 54 tests.

About plugin

  • Plugin page: c9-blocks
  • Plugin version: 1.7.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.4
  • WordPress version: 6.3.1
  • First release: Nov 16, 2019
  • Latest release: Nov 7, 2023
  • Number of updates: 73
  • Update frequency: every 19.9 days
  • Top authors: ttoomey (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /12,778 total downloads

Benchmarks

Plugin footprint 82% 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: ▲0.19MB] [CPU: ▲3.04ms] 75% from 4 tests

A check of server-side resources used by C9 Blocks
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 2,649.12ms on /wp-admin/themes.php?page=c9-blocks-getting-started)
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2240.66 ▲1.43
Dashboard /wp-admin3.49 ▲0.1948.53 ▲6.22
Posts /wp-admin/edit.php3.54 ▲0.1854.53 ▲4.62
Add New Post /wp-admin/post-new.php6.12 ▲0.2388.39 ▼0.13
Media Library /wp-admin/upload.php3.42 ▲0.1841.30 ▲6.71
C9 Blocks /wp-admin/themes.php?page=c9-blocks-getting-started4.062,649.12

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 468 new files
Database: no new tables, 7 new options
New WordPress options
c9_orig_colors
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for C9 Blocks
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16114.12 ▼0.1517.08 ▲15.5043.49 ▼0.28
Dashboard /wp-admin2,203 ▲265.51 ▼0.1385.54 ▼7.8539.57 ▼2.18
Posts /wp-admin/edit.php2,108 ▲81.94 ▼0.0039.15 ▲4.1634.60 ▼0.10
Add New Post /wp-admin/post-new.php7,041 ▲5,51527.10 ▲3.851,072.88 ▲357.3639.65 ▼20.20
Media Library /wp-admin/upload.php1,408 ▲84.23 ▲0.05107.95 ▼9.6144.88 ▼3.91
C9 Blocks /wp-admin/themes.php?page=c9-blocks-getting-started2,7601.9826.90157.07

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • c9_orig_colors
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/c9-blocks/composer-setup.php
    • > /wp-content/plugins/c9-blocks/tests/bootstrap.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/c9-blocks/src/blocks/block-sharing/index.php:89
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/c9-blocks/src/blocks/block-post-grid/index.php:585
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/c9-blocks/tests/test-class-check-dist-files-exist.php:11
    • > PHP Notice
      Undefined variable: argv in wp-content/plugins/c9-blocks/composer-setup.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/c9-blocks/tests/test-class-layout-endpoints.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/c9-blocks/src/blocks/block-vertical-tabs/components/vertical-tab/index.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/c9-blocks/src/blocks/block-horizontal-tabs/components/horizontal-tab/index.php:67

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: gutenberg blocks, editor, landing page, marketing, gutenberg...

c9-blocks/plugin.php 92% from 13 tests

The main PHP script in "C9 Blocks" version 1.7.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("c9-blocks.php" instead of "plugin.php")

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 plugin108,005 lines of code in 412 files:
LanguageFilesBlank linesComment linesLines of code
JSON40046,613
JavaScript2273,7602,07928,395
SVG12002812,793
CSS72,8621378,563
Sass341,325628,012
PHP113977512,642
PO File1325694724
Bourne Shell32311128
YAML16057
Markdown230053
XML24225

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity21.71
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity5.03
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods36
▷ Static methods513.89%
▷ Public methods1644.44%
▷ Protected methods2055.56%
▷ Private methods00.00%
Functions58
▷ Named functions5289.66%
▷ Anonymous functions610.34%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.20MB with 0.12MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/pick-column-layout.png56.62KB15.57KB▼ 72.50%
assets/c9-logo.png32.69KB16.14KB▼ 50.62%
assets/device-previews.png92.31KB23.11KB▼ 74.96%
assets/section-template-icons/1882E2F807C6F8D2.png28.09KB20.61KB▼ 26.62%