78% photocommerce

Code Review | PhotoCommerce

WordPress plugin PhotoCommerce scored78%from 54 tests.

About plugin

  • Plugin page: photocommerce
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 20, 2023
  • Latest release: Jul 11, 2023
  • Number of updates: 15
  • Update frequency: every 9.7 days
  • Top authors: vitrion (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /537 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.73ms] Passed 4 tests

An overview of server-side resources used by PhotoCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.00 ▲0.03
Dashboard /wp-admin3.31 ▲0.0045.50 ▼4.63
Posts /wp-admin/edit.php3.36 ▲0.0041.20 ▼4.63
Add New Post /wp-admin/post-new.php5.89 ▲0.0078.41 ▼10.53
Media Library /wp-admin/upload.php3.23 ▲0.0029.98 ▼3.13

Server storage [IO: ▲0.45MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for PhotoCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.74 ▲0.191.81 ▲0.2043.41 ▼1.06
Dashboard /wp-admin2,198 ▲215.62 ▼0.0494.73 ▲3.4341.36 ▼3.03
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0135.80 ▼1.0731.57 ▼1.52
Add New Post /wp-admin/post-new.php1,526 ▼023.17 ▲0.35625.83 ▼54.5155.40 ▲0.36
Media Library /wp-admin/upload.php1,403 ▼04.22 ▼0.0695.05 ▲1.1842.23 ▼2.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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 take a closer look at the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/photocommerce/admin/partials/generate_key.php
    • > /wp-content/plugins/photocommerce/admin/partials/revoke_key.php
    • > /wp-content/plugins/photocommerce/public/partials/photo-commerce-public-display.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/photocommerce/rest/class-photo-commerce-rest-categories.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/photocommerce/rest/class-photo-commerce-rest-products.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/photocommerce/admin/partials/photo-commerce-admin-display.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: product editing, woocommerce, product management, e-commerce

photocommerce/photo-commerce.php 85% from 13 tests

The main PHP file in "PhotoCommerce" ver. 1.0.6 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("photocommerce.php" instead of "photo-commerce.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin817 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP17234721807
JavaScript44609
CSS30141

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.40
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods53
▷ Static methods23.77%
▷ Public methods4279.25%
▷ Protected methods47.55%
▷ Private methods713.21%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.09MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png92.56KB27.10KB▼ 70.72%