77% canvasflow

Code Review | Canvasflow for WordPress

WordPress plugin Canvasflow for WordPress scored77%from 54 tests.

About plugin

  • Plugin page: canvasflow
  • Plugin version: 1.5.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.4.1
  • WordPress version: 6.3.1
  • First release: Jul 19, 2017
  • Latest release: May 12, 2020
  • Number of updates: 43
  • Update frequency: every 23.9 days
  • Top authors: canvasflow (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,110 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 gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▼4.28ms] Passed 4 tests

This is a short check of server-side resources used by Canvasflow for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1745.91 ▲4.11
Dashboard /wp-admin3.48 ▲0.1752.21 ▼2.31
Posts /wp-admin/edit.php3.60 ▲0.2351.27 ▼2.27
Add New Post /wp-admin/post-new.php6.16 ▲0.27100.34 ▼12.97
Media Library /wp-admin/upload.php3.40 ▲0.1739.69 ▲0.44
Posts Manager /wp-admin/admin.php?page=canvasflow-posts-manager3.5047.10
Settings /wp-admin/admin.php?page=canvasflow-settings3.5540.96
Upload Manager /wp-admin/admin.php?page=wp-canvasflow-plugin3.5137.42

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 17 new files
Database: 3 new tables, 7 new options
New tables
wp_canvasflow_version
wp_canvasflow_credentials
wp_canvasflow_posts
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
category_children
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Canvasflow for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5614.35 ▼0.001.65 ▼0.1841.23 ▼2.58
Dashboard /wp-admin2,211 ▲315.58 ▼0.0287.52 ▼8.3064.72 ▲21.48
Posts /wp-admin/edit.php2,146 ▲462.01 ▲0.0338.18 ▼2.8234.70 ▼5.08
Add New Post /wp-admin/post-new.php6,424 ▲4,88922.41 ▲4.21904.94 ▲261.3061.68 ▲1.32
Media Library /wp-admin/upload.php1,431 ▲284.18 ▼0.0398.91 ▼2.1869.98 ▲24.95
Posts Manager /wp-admin/admin.php?page=canvasflow-posts-manager1,1262.0425.2531.21
Settings /wp-admin/admin.php?page=canvasflow-settings8312.0125.2024.08
Upload Manager /wp-admin/admin.php?page=wp-canvasflow-plugin7892.1824.9524.63

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • category_children

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/canvasflow/includes/views/canvasflow-main-view.php
    • > /wp-content/plugins/canvasflow/includes/views/canvasflow-post-manager-view.php
  • 77× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: page in wp-content/plugins/canvasflow/includes/views/canvasflow-main-view.php on line 25
    • > PHP Notice
      Undefined variable: search in wp-content/plugins/canvasflow/includes/views/canvasflow-main-view.php on line 56
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Canvasflow' not found in wp-content/plugins/canvasflow/includes/canvasflow-main.php:2
    • > PHP Warning
      require_once(wp-content/plugins/canvasflow/includes/wp-config.php): failed to open stream: No such file or directory in wp-content/plugins/canvasflow/includes/canvasflow-db.php on line 6
    • > PHP Notice
      Undefined variable: search in wp-content/plugins/canvasflow/includes/views/canvasflow-post-manager-view.php on line 162
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/canvasflow/includes/canvasflow-shortcodes.php on line 10
    • > PHP Notice
      Undefined variable: total_of_pages in wp-content/plugins/canvasflow/includes/views/canvasflow-main-view.php on line 60
    • > PHP Notice
      Undefined variable: search in wp-content/plugins/canvasflow/includes/views/canvasflow-main-view.php on line 184
    • > PHP Warning
      sizeof(): Parameter must be an array or an object that implements Countable in wp-content/plugins/canvasflow/includes/views/canvasflow-main-view.php on line 213
    • > PHP Notice
      Undefined variable: order_by in wp-content/plugins/canvasflow/includes/views/canvasflow-post-manager-view.php on line 132

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Manage all of your posts in Canvasflow from your WordPress dashboard), #2 (Easily select which posts are eligible for upload to your Canvasflow publication), #3 (Override the style an article inherits on a per upload basis.), #4 (Real time sync status manages and notifies you of all content changes), #5 (Customise the plugin to match your workflow.)
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can look at the official readme.txt

canvasflow/canvasflow-plugin.php 85% from 13 tests

The principal PHP file in "Canvasflow for WordPress" v. 1.5.5 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("canvasflow.php" instead of "canvasflow-plugin.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
Success! There were no dangerous files found in this plugin3,813 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP12500483,384
Markdown1810223
CSS1210130
JavaScript114676

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity32.25
▷ Minimum class complexity8.00
▷ Maximum class complexity106.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods108
▷ Static methods00.00%
▷ Public methods9184.26%
▷ Protected methods00.00%
▷ Private methods1715.74%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/favicon.png0.90KB0.57KB▼ 36.97%