10% cartara

Code Review | Cartara

WordPress plugin Cartara scored10%from 54 tests.

About plugin

  • Plugin page: cartara
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3
  • WordPress version: 6.3.1
  • First release: Dec 6, 2019
  • Latest release: Dec 23, 2019
  • Number of updates: 11
  • Update frequency: every 1.6 days
  • Top authors: cartarainc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /533 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-admin/includes/upgrade.php+2917
    Undefined index: index_type

Server metrics [RAM: ▼0.13MB] [CPU: ▼17.40ms] Passed 4 tests

This is a short check of server-side resources used by Cartara
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6043.19 ▲0.49
Dashboard /wp-admin3.91 ▲0.5649.74 ▼12.93
Posts /wp-admin/edit.php3.96 ▲0.6047.43 ▼0.71
Add New Post /wp-admin/post-new.php3.69 ▼2.2036.61 ▼56.44
Media Library /wp-admin/upload.php3.77 ▲0.5440.94 ▲2.35
Products /wp-admin/edit.php?post_type=cartara_product3.8840.15
API Settings /wp-admin/admin.php?page=api_setting3.7435.38
Cartara Shortcoder /wp-admin/admin.php?page=cartara_shortcoder3.8039.50
Action Surveys /wp-admin/admin.php?page=cartasurvey3.7435.45
Opt-In Forms /wp-admin/admin.php?page=optform3.7435.87
Cartara Survey Shortcoder /wp-admin/admin.php?page=cartara_survey_shortcoder3.8036.35
Categories /wp-admin/edit-tags.php?taxonomy=cartara_category&post_type=cartara_product3.7635.24
Dashboard /wp-admin/admin.php?page=cartara_menu3.7441.81

Server storage [IO: ▲2.98MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 66 new files
Database: 6 new tables, 8 new options
New tables
wp_cartara_optin_survey_data
wp_cartara_product_attribute
wp_cartara_optin_form_data
wp_cartara_incart_products
wp_cartara_product_attribute_group
wp_cartara_products
New WordPress options
widget_cartara_taxonomy
widget_theysaidso_widget
db_upgraded
widget_recent-comments
CARTARA_SYNC_VERSION
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Cartara: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,056 ▲27013.84 ▼0.5317.11 ▲15.1248.25 ▲3.61
Dashboard /wp-admin2,251 ▲745.78 ▲0.1290.36 ▼16.2043.12 ▼0.31
Posts /wp-admin/edit.php2,179 ▲792.38 ▲0.3738.48 ▼5.7331.31 ▼3.76
Add New Post /wp-admin/post-new.php1,581 ▲5323.35 ▲0.22696.29 ▲22.9660.12 ▲1.87
Media Library /wp-admin/upload.php1,475 ▲754.50 ▲0.2795.56 ▼18.4745.17 ▼4.65
Products /wp-admin/edit.php?post_type=cartara_product1,1682.4334.1727.43
API Settings /wp-admin/admin.php?page=api_setting9601.9128.1528.26
Cartara Shortcoder /wp-admin/admin.php?page=cartara_shortcoder1,6736.67131.0358.16
Action Surveys /wp-admin/admin.php?page=cartasurvey9121.9027.2431.32
Opt-In Forms /wp-admin/admin.php?page=optform9151.9126.9625.94
Cartara Survey Shortcoder /wp-admin/admin.php?page=cartara_survey_shortcoder1,6726.68128.5746.22
Categories /wp-admin/edit-tags.php?taxonomy=cartara_category&post_type=cartara_product1,3162.1430.9131.14
Dashboard /wp-admin/admin.php?page=cartara_menu9391.9127.2834.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_cartara_taxonomy
    • widget_recent-posts
    • CARTARA_SYNC_VERSION
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cartara/public/partials/cartara_product_3column_view.php
    • > /wp-content/plugins/cartara/public/partials/cartara_product_grid_view.php
    • > /wp-content/plugins/cartara/admin/partials/cartara_orders_page.php
    • > /wp-content/plugins/cartara/public/partials/cartara_product_1column_view.php
    • > /wp-content/plugins/cartara/admin/partials/cartara_metabox_for_images.php
  • 26× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cartara/includes/cartara-list-custom-taxonomy-widget.php:4
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/cartara/public/partials/cartara_product_3column_view.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/cartara/admin/partials/cartara_metabox_for_video.php:92
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/cartara/public/partials/cartara_product_grid_view.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/cartara/admin/partials/cartara_optin_survey_display_shortcode.php:26
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/cartara/public/partials/cartara_product_1column_view.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/cartara/admin/partials/cartara_metabox_for_images.php:157
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/cartara/admin/partials/cartara_opt_survey_form.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/cartara/admin/partials/cartara_sync-admin-display.php:19
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/cartara/public/partials/cartara_product_grid_view.php on line 21

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/edit-tags.php?taxonomy=cartara_category&post_type=cartara_product
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).tooltip is not a function" "TypeError: $(...).tooltip is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit-tags.php?taxonomy=cartara_category&post_type=cartara_product:58:28)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit-tags.php?taxonomy=cartara_category&post_type=cartara_product
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).tooltip is not a function
    • > GET request to /wp-admin/admin.php?page=cartara_menu
    • > Network (severe)
    wp-content/plugins/cartara/admin/fonts/fontawesome-webfont.woff2?v=4.7.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=cartara_menu
    • > Network (severe)
    wp-content/plugins/cartara/admin/fonts/fontawesome-webfont.woff?v=4.7.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=cartara_menu
    • > Network (severe)
    wp-content/plugins/cartara/admin/fonts/fontawesome-webfont.ttf?v=4.7.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Contributors: There were no tags found
  • Donate link: Invalid URI ("")
  • Contributors: Plugin contributors not specified
The official readme.txt might help

cartara/cartara.php 92% from 13 tests

The entry point to "Cartara" version 1.0.3 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 252 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected10,395 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
CSS82041705,885
PHP295858053,690
JavaScript420265820

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity30.00
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.46
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods118
▷ Static methods21.69%
▷ Public methods11395.76%
▷ Protected methods00.00%
▷ Private methods54.24%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.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
8 PNG files occupy 0.14MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/word_icon1.png21.88KB7.77KB▼ 64.47%
admin/images/word_icon2.png31.26KB12.04KB▼ 61.50%
admin/images/word_icon1.png21.88KB7.77KB▼ 64.47%
admin/images/word_icon4.png20.94KB7.88KB▼ 62.37%
admin/images/video-img.png17.56KB8.65KB▼ 50.76%