84% canvas

Code Review | Canvas

WordPress plugin Canvas scored84%from 54 tests.

About plugin

  • Plugin page: canvas
  • Plugin version: 2.4.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 28, 2019
  • Latest release: Nov 20, 2023
  • Number of updates: 116
  • Update frequency: every 43.4 days
  • Top authors: codesupplyco (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10,000+ active /230,310 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.47MB] [CPU: ▲4.19ms] Passed 4 tests

An overview of server-side resources used by Canvas
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.02 ▲1.5646.84 ▲7.70
Dashboard /wp-admin4.76 ▲1.4156.36 ▼6.77
Posts /wp-admin/edit.php4.81 ▲1.4557.34 ▲7.21
Add New Post /wp-admin/post-new.php8.29 ▲2.40107.75 ▲10.00
Media Library /wp-admin/upload.php4.68 ▲1.4546.39 ▲8.63

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 281 new files
Database: no new tables, 7 new options
New WordPress options
canvas_db_version
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Canvas
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲19713.66 ▼0.6813.95 ▲11.9836.48 ▼0.62
Dashboard /wp-admin2,197 ▲235.63 ▲0.0390.67 ▼9.5241.59 ▼3.56
Posts /wp-admin/edit.php2,108 ▲81.98 ▲0.0336.58 ▼3.4330.27 ▼6.98
Add New Post /wp-admin/post-new.php6,355 ▲4,82927.19 ▲3.901,035.49 ▲374.3438.49 ▼17.37
Media Library /wp-admin/upload.php1,405 ▲24.17 ▲0.07104.69 ▲2.4676.14 ▲32.51

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • canvas_db_version
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 77× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas/components/content-formatting/class-block-heading.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas/components/posts/class-block-posts-sidebar.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/canvas/components/basic-elements/block-tabs/render.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas/components/layout-blocks/class-block-row.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas/components/slider-gallery/class-block-slider-gallery.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas/components/justified-gallery/class-block-justified-gallery.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/canvas/components/layout-blocks/block-column/render.php:13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/canvas/components/basic-elements/block-collapsibles/render.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/canvas/components/basic-elements/block-widgetized-area/render.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/canvas/components/posts/block-posts/layouts/grid.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
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
3 plugin tags: theme, page, template

canvas/canvas.php 92% from 13 tests

Analyzing the main PHP file in "Canvas" version 2.4.3
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 146 characters long)

Code Analysis Passed 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 detected24,398 lines of code in 264 files:
LanguageFilesBlank linesComment linesLines of code
CSS621,3867019,687
JSX921,4681,9697,847
PHP571,2031,9126,234
JavaScript50126223593
SVG10026
XML10010
JSON1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity20.54
▷ Minimum class complexity1.00
▷ Maximum class complexity142.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes00.00%
Methods142
▷ Static methods64.23%
▷ Public methods14199.30%
▷ Protected methods00.00%
▷ Private methods10.70%
Functions46
▷ Named functions4495.65%
▷ Anonymous functions24.35%
Constants6
▷ Global constants6100.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
No PNG files were detected