94% canvas-portfolio

Code Review | Canvas Portfolio

WordPress plugin Canvas Portfolio scored 94% 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: 5.9.2
  • 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 / 449 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.33MB] [CPU: ▼300.27ms] Passed 4 tests

This is a short check of server-side resources used by Canvas Portfolio
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0459.35 ▼0.89
Dashboard /wp-admin3.29 ▼0.1227.98 ▼10.28
Posts /wp-admin/edit.php3.34 ▼0.2926.42 ▼13.29
Add New Post /wp-admin/post-new.php6.07 ▼0.9078.22 ▼1,173.49
Media Library /wp-admin/upload.php3.29 ▲0.0026.49 ▼4.03

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 47 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Canvas Portfolio
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,802 ▲4815.81 ▲0.186.52 ▲0.912.09 ▼0.54
Dashboard /wp-admin2,934 ▲736.16 ▼0.05115.94 ▼19.64155.92 ▼83.33
Posts /wp-admin/edit.php2,711 ▲213.24 ▲0.0086.05 ▲23.38141.49 ▼9.15
Add New Post /wp-admin/post-new.php1,782 ▲9222.70 ▲1.72427.31 ▼2.72161.81 ▼30.16
Media Library /wp-admin/upload.php1,737 ▲435.50 ▼0.05143.65 ▼18.91183.46 ▼15.67

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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× 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-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-categories.php:15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/canvas-portfolio/public/block/post-area-init.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/canvas-portfolio/public/block/post-area-none.php:18
    • > 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 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 undefined function esc_html_e() in wp-content/plugins/canvas-portfolio/public/block/post-area-none.php:18
    • > 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 Notice
      Undefined variable: attributes in wp-content/plugins/canvas-portfolio/public/block/post-area-init.php on line 15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: projects, image, canvas, responsive, gallery...

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

The main file in "Canvas Portfolio" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 164 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
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 brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
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
No PNG images were found in this plugin