84% canvas-portfolio

Code Review | Canvas Portfolio

WordPress plugin Canvas Portfolio scored84%from 54 tests.

About plugin

  • Plugin page: canvas-portfolio
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: Jul 7, 2020
  • Latest release: Jul 16, 2020
  • Number of updates: 7
  • Update frequency: every 32.3 days
  • Top authors: codesupplyco (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /770 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: ▼0.14MB] [CPU: ▼17.44ms] Passed 4 tests

Analyzing server-side resources used by Canvas Portfolio
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0334.99 ▼6.28
Dashboard /wp-admin3.23 ▼0.0834.85 ▼14.75
Posts /wp-admin/edit.php3.30 ▼0.0638.84 ▼11.93
Add New Post /wp-admin/post-new.php5.47 ▼0.4282.98 ▼36.80
Media Library /wp-admin/upload.php3.24 ▲0.0032.71 ▼3.46

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 47 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Canvas Portfolio
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8014.26 ▼0.121.93 ▲0.0539.51 ▼9.24
Dashboard /wp-admin2,222 ▲485.55 ▼0.1086.08 ▼1.0139.21 ▼5.25
Posts /wp-admin/edit.php2,131 ▲282.12 ▲0.1640.77 ▲2.9337.37 ▲6.58
Add New Post /wp-admin/post-new.php1,548 ▲1322.65 ▲4.42672.27 ▲12.0952.77 ▼7.84
Media Library /wp-admin/upload.php1,427 ▲364.21 ▲0.0398.89 ▼10.0944.90 ▼1.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas-portfolio/includes/class-canvas-portfolio-installer.php:26
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/canvas-portfolio/public/block/post-area-init.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas-portfolio/includes/register-post-fields.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas-portfolio/includes/portfolio-load-more.php:237
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cnvsport_portfolio_area_classes() in wp-content/plugins/canvas-portfolio/public/block/post-area-custom.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas-portfolio/public/class-canvas-portfolio-block.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas-portfolio/includes/register-category-fields.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cnvsport_portfolio_area_classes() in wp-content/plugins/canvas-portfolio/public/block/post-area-post.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvas-portfolio/includes/register-post-types.php:50
    • > PHP Fatal error
      Uncaught Error: Call to a member function item_class() on null in wp-content/plugins/canvas-portfolio/public/block/portfolio-entry.php:16

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 errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: canvas, responsive, projects, portfolio, gallery...

canvas-portfolio/canvas-portfolio.php 92% from 13 tests

"Canvas Portfolio" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 164 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
Good job! No executable or dangerous file extensions detected4,560 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP254321,0442,122
CSS6223331,267
JavaScript53742691,132
SVG10038
JSON1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods50
▷ Static methods24.00%
▷ Public methods4590.00%
▷ Protected methods00.00%
▷ Private methods510.00%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
There were not PNG files found in your plugin