78% canvas-nestjs

Code Review | Canvas-Nest.js

WordPress plugin Canvas-Nest.js scored78%from 54 tests.

About plugin

  • Plugin page: canvas-nestjs
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.1
  • WordPress version: 6.3.1
  • First release: Jan 23, 2016
  • Latest release: Jan 25, 2016
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: wzwahl36 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /9,659 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.11ms] Passed 4 tests

A check of server-side resources used by Canvas-Nest.js
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.01 ▼2.89
Dashboard /wp-admin3.33 ▼0.0149.86 ▼11.71
Posts /wp-admin/edit.php3.38 ▲0.0350.76 ▼2.07
Add New Post /wp-admin/post-new.php5.91 ▲0.0385.40 ▼3.77
Media Library /wp-admin/upload.php3.26 ▲0.0336.35 ▼1.94
Canvas-Nest.js /wp-admin/options-general.php?page=WP_Canvas_Nest3.2538.86

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Canvas-Nest.js: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲9717.15 ▲2.8019.61 ▲18.0642.56 ▲3.79
Dashboard /wp-admin2,199 ▲225.62 ▼0.0486.46 ▼7.4438.50 ▼4.64
Posts /wp-admin/edit.php2,107 ▲71.96 ▼0.1634.26 ▼6.4833.36 ▼3.68
Add New Post /wp-admin/post-new.php1,529 ▲123.23 ▼0.06659.46 ▼52.5957.95 ▲6.21
Media Library /wp-admin/upload.php1,404 ▲44.19 ▲0.0098.38 ▼15.9545.62 ▼4.20
Canvas-Nest.js /wp-admin/options-general.php?page=WP_Canvas_Nest6971.516.7623.29

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=WP_Canvas_Nest
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/canvas-nestjs/templates/settings.php on line 5 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/canvas-nestjs/templates/settings.php(5): do_settings_fields()
    #1 wp-content/plugins/canvas-nestjs/settings.php(261): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): WP_Canvas_Nest_Settings->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

SRP 50% 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 fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/canvas-nestjs/templates/settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/canvas-nestjs/wp_canvas_nest.php:54

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === canvas-nestjs === )
The official readme.txt is a good inspiration

canvas-nestjs/wp_canvas_nest.php 92% from 13 tests

"Canvas-Nest.js" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("canvas-nestjs.php" instead of "wp_canvas_nest.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected276 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33250260
Markdown116016

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
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

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot/screenshot.png35.55KB15.61KB▼ 56.10%
screenshot/plugin_admin.png45.35KB15.63KB▼ 65.53%