10% cartloom

Code Review | Cartloom Plugin

WordPress plugin Cartloom Plugin scored10%from 54 tests.

About plugin

  • Plugin page: cartloom
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8.1
  • WordPress version: 6.3.1
  • First release: Feb 19, 2018
  • Latest release: Feb 20, 2018
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: yabdab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /766 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/cartloom/cartloom.php+27
    Use of undefined constant CARTLOOM_PLUGIN_VERSION - assumed 'CARTLOOM_PLUGIN_VERSION' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.95MB] [CPU: ▼64.03ms] Passed 4 tests

This is a short check of server-side resources used by Cartloom Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.425.37 ▼38.08
Dashboard /wp-admin2.07 ▼1.286.04 ▼65.91
Posts /wp-admin/edit.php2.07 ▼1.296.79 ▼44.35
Add New Post /wp-admin/post-new.php2.07 ▼3.825.21 ▼107.76
Media Library /wp-admin/upload.php2.07 ▼1.166.31 ▼27.72

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 313 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_cartloom_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cartloom Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲12213.45 ▼0.569.93 ▲7.7534.47 ▼10.84
Dashboard /wp-admin2,210 ▲335.60 ▼0.0383.82 ▼11.8043.72 ▲2.61
Posts /wp-admin/edit.php2,129 ▲322.20 ▲0.2437.31 ▲1.2639.62 ▲3.52
Add New Post /wp-admin/post-new.php1,557 ▲3123.29 ▼0.12679.41 ▼9.4566.11 ▲5.60
Media Library /wp-admin/upload.php1,426 ▲264.47 ▲0.27112.10 ▲6.2849.65 ▲4.92

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/cartloom/cartloom.php+27
    Use of undefined constant CARTLOOM_PLUGIN_VERSION - assumed 'CARTLOOM_PLUGIN_VERSION' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_cartloom_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/cartloom/public/partials/cartloom-public-display.php
    • > /wp-content/plugins/cartloom/admin/partials/cartloom-admin-display.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cartloom/includes/class-cartloom-widget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cartloom/lib/cmb2/init.php:103

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 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
The official readme.txt is a good inspiration

cartloom/cartloom.php Passed 13 tests

"Cartloom Plugin" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
95 characters long description:
Easily add Buy Buttons, Product Groups and Shopping Cart snippets to Wordpress Pages and Posts.

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
There were no executable files found in this plugin42,185 lines of code in 162 files:
LanguageFilesBlank linesComment linesLines of code
PO File11912,73116,33529,151
CSS102,0572,0588,746
PHP271,3662,7613,496
JavaScript5221164778
SVG10014

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity31.19
▷ Minimum class complexity1.00
▷ Maximum class complexity130.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods262
▷ Static methods249.16%
▷ Public methods24392.75%
▷ Protected methods93.44%
▷ Private methods103.82%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
17 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
lib/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
lib/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
lib/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
lib/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%