84% canto

Code Review | Canto

WordPress plugin Canto scored84%from 54 tests.

About plugin

  • Plugin page: canto
  • Plugin version: 3.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Jun 9, 2018
  • Latest release: Oct 26, 2023
  • Number of updates: 55
  • Update frequency: every 35.7 days
  • Top authors: FlightbyCanto (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,344 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▲1.16ms] Passed 4 tests

Analyzing server-side resources used by Canto
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2944.00 ▲6.40
Dashboard /wp-admin3.58 ▲0.2851.82 ▲3.87
Posts /wp-admin/edit.php3.69 ▲0.3450.22 ▲9.26
Add New Post /wp-admin/post-new.php6.18 ▲0.3085.26 ▼13.06
Media Library /wp-admin/upload.php3.51 ▲0.2842.78 ▲7.44
Canto /wp-admin/options-general.php?page=canto_settings3.5038.48

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 62 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
canto_version
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Canto: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.55 ▼0.081.66 ▼0.0446.15 ▲6.23
Dashboard /wp-admin2,210 ▲325.65 ▼0.0696.43 ▼16.1941.46 ▼9.69
Posts /wp-admin/edit.php2,115 ▲152.04 ▲0.0135.31 ▲1.8430.68 ▼5.83
Add New Post /wp-admin/post-new.php6,378 ▲4,85227.68 ▲4.11991.25 ▲320.1543.39 ▼15.36
Media Library /wp-admin/upload.php1,412 ▲154.20 ▼0.0094.22 ▼4.7843.05 ▼1.18
Canto /wp-admin/options-general.php?page=canto_settings1,0193.1647.7529.16

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • canto_version
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 24× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(wp-admin/admin.php): failed to open stream: No such file or directory in wp-content/plugins/canto/includes/lib/copy-media.php on line 56
    • > PHP Warning
      include_once(wp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/canto/includes/lib/sizes.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/canto/includes/lib/media-upload.php:9
    • > PHP Notice
      Undefined index: wp_abspath in wp-content/plugins/canto/includes/lib/detail.php on line 3
    • > PHP Notice
      Undefined index: abspath in wp-content/plugins/canto/includes/lib/sizes.php on line 15
    • > PHP Warning
      require_once(/wp-admin/admin.php): failed to open stream: No such file or directory in wp-content/plugins/canto/includes/lib/download.php on line 5
    • > PHP Warning
      include_once(wp-admin/admin.php): failed to open stream: No such file or directory in wp-content/plugins/canto/includes/lib/sizes.php on line 15
    • > PHP Fatal error
      require_once(): Failed opening required '/wp-admin/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/canto/includes/lib/download.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/canto/includes/lib/sizes.php:21
    • > PHP Notice
      Undefined index: abspath in wp-content/plugins/canto/includes/lib/sizes.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: canto, cloud storage, photo library, digital asset management, image management...

canto/canto.php 92% from 13 tests

Analyzing the main PHP file in "Canto" version 3.0.6
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 169 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected6,492 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
SVG4003,385
PHP174756411,888
JavaScript1411267906
CSS4918204
HTML26051
LESS1101444
JSON10014

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity38.00
▷ Minimum class complexity11.00
▷ Maximum class complexity62.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods43
▷ Static methods24.65%
▷ Public methods4195.35%
▷ Protected methods00.00%
▷ Private methods24.65%
Functions16
▷ Named functions1593.75%
▷ Anonymous functions16.25%
Constants4
▷ Global constants4100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/document-icon.png2.31KB1.29KB▼ 43.99%
assets/canto-icon.png1.65KB0.83KB▼ 49.91%