10% canvaspop-photo-printing-api

Code Review | CanvasPop Photo Printing API

WordPress plugin CanvasPop Photo Printing API scored10%from 54 tests.

About plugin

  • Plugin page: canvaspop-photo-p...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Feb 13, 2014
  • Latest release: Mar 30, 2016
  • Number of updates: 5
  • Update frequency: every 155.8 days
  • Top authors: karlcanvaspop (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,182 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/canvaspop-photo-printing-api/canvaspop-photo-printing-api.php+364
    Trying to access array offset on value of type bool

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

A check of server-side resources used by CanvasPop Photo Printing API
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.43 ▼0.0326.65 ▼14.08
Dashboard /wp-admin3.36 ▲0.0245.35 ▼13.38
Posts /wp-admin/edit.php3.47 ▲0.1245.22 ▼0.71
Add New Post /wp-admin/post-new.php5.94 ▲0.0579.16 ▼15.16
Media Library /wp-admin/upload.php3.28 ▲0.0546.72 ▲12.17

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 53 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
cp_options

Browser metrics Passed 4 tests

CanvasPop Photo Printing API: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲21413.62 ▼0.698.68 ▲7.0344.12 ▲3.13
Dashboard /wp-admin2,218 ▲325.99 ▲0.0898.39 ▼8.6182.89 ▲39.70
Posts /wp-admin/edit.php2,104 ▲152.02 ▼0.0235.59 ▼1.0032.98 ▼2.51
Add New Post /wp-admin/post-new.php1,681 ▲13921.93 ▲3.67724.19 ▲98.3652.55 ▼0.08
Media Library /wp-admin/upload.php1,406 ▲154.18 ▼0.0699.12 ▼0.9476.10 ▲36.15

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • cp_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/canvaspop-photo-printing-api/views/public.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/canvaspop-photo-printing-api/views/admin.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/canvaspop-photo-printing-api/canvaspop-photo-printing-api.php:69

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (`/screenshot-1.png`) image required
Please take inspiration from this readme.txt

canvaspop-photo-printing-api/canvaspop-photo-printing-api.php Passed 13 tests

Analyzing the main PHP file in "CanvasPop Photo Printing API" version 1.0.1
28 characters long description:
CanvasPop Photo Printing API

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
Success! There were no dangerous files found in this plugin1,130 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31010523
PHP673223258
CSS3102251
Markdown180098

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods637.50%
▷ Public methods1275.00%
▷ Protected methods00.00%
▷ Private methods425.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
27 compressed PNG files occupy 0.21MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/custom_background.png1.87KB2.12KB0.00%
assets/custom_rgb_b.png0.98KB0.74KB▼ 25.00%
assets/custom_submit.png0.97KB0.99KB0.00%
assets/colorpicker_background.png1.85KB2.14KB0.00%
assets/select2.png0.51KB0.33KB▼ 34.94%