73% shopcred

Code Review | ShopCred

WordPress plugin ShopCred scored73%from 54 tests.

About plugin

  • Plugin page: shopcred
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 8, 2022
  • Latest release: May 25, 2023
  • Number of updates: 15
  • Update frequency: every 11.3 days
  • Top authors: devscred (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /2,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
Installer ran successfully

Server metrics [RAM: ▲1.59MB] [CPU: ▲12.79ms] Passed 4 tests

An overview of server-side resources used by ShopCred
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.93 ▲1.4648.21 ▲4.39
Dashboard /wp-admin4.98 ▲1.6766.38 ▲16.05
Posts /wp-admin/edit.php5.02 ▲1.6672.22 ▲20.56
Add New Post /wp-admin/post-new.php7.57 ▲1.68100.71 ▲10.15
Media Library /wp-admin/upload.php4.82 ▲1.5856.66 ▲23.34
Dashboard /wp-admin/admin.php?page=shopcred-dashboard4.8748.46
Plugin Settings /wp-admin/admin.php?page=shopcred-dashboard-settings-page4.8852.49

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 227 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
shopcred_dynamic_css_time
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
Dynamic_CSS_posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for ShopCred
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,177 ▲41616.31 ▲1.576.50 ▲4.1442.19 ▼3.79
Dashboard /wp-admin2,462 ▲2827.65 ▲1.99167.15 ▲72.3391.04 ▲49.33
Posts /wp-admin/edit.php2,405 ▲3024.56 ▲2.6065.57 ▲23.0079.36 ▲36.07
Add New Post /wp-admin/post-new.php1,772 ▲24623.98 ▲0.39668.02 ▲0.8536.76 ▼14.22
Media Library /wp-admin/upload.php1,502 ▲995.69 ▲1.51106.65 ▲3.5486.82 ▲41.46
Dashboard /wp-admin/admin.php?page=shopcred-dashboard1,6535.7485.9895.86
Plugin Settings /wp-admin/admin.php?page=shopcred-dashboard-settings-page1,6005.7483.4076.67

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 did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • shopcred_dynamic_css_time
    • Dynamic_CSS_posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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 fix the following
  • 19× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/shopcred/admin/vue-ui/components/notice.php
    • > /wp-content/plugins/shopcred/admin/vue-ui/components/select.php
    • > /wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/before-component.php
    • > /wp-content/plugins/shopcred/admin/vue-ui/components/switcher.php
    • > /wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/alert-list.php
    • > /wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/after-component.php
    • > /wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/header.php
    • > /wp-content/plugins/shopcred/admin/vue-ui/components/collapse.php
    • > /wp-content/plugins/shopcred/admin/shopcred-dashboard/views/settings/plugin-settings-toggle.php
    • > /wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/alert-item.php
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/before-sidebar.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shopcred/admin/templates/settings-templates/general-settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/after-sidebar.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/sidebar.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/dashboard.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/shopcred/admin/shopcred-dashboard/views/welcome/main.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/shopcred-admin-category.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/shopcred/admin/shopcred-dashboard/views/settings/main.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/shopcred/admin/templates/blocks.php:16
    • > PHP Warning
      Use of undefined constant SPC_ADMIN_URL - assumed 'SPC_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/shopcred/admin/shopcred-dashboard/views/common/header.php on line 10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=shopcred-dashboard-settings-page
    • > Network (severe)
    wp-content/plugins/shopcred/admin/assets/js/setting-pages.js?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: blocks, exclusive blocks, shop, woocommerce, products...

shopcred/shopcred.php Passed 13 tests

This is the main PHP file of "ShopCred" version 1.1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
74 characters long description:
The Best Gutenberg Blocks Collection for WooCommerce from Exclusive Blocks

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
Good job! No executable or dangerous file extensions detected38,428 lines of code in 210 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript652,1571,70314,907
PHP702,2063,05912,276
CSS171,2501127,055
Sass40564193,885
SVG1810305

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity24.51
▷ Minimum class complexity1.00
▷ Maximum class complexity145.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes35
▷ Abstract classes25.71%
▷ Concrete classes3394.29%
▷ Final classes26.06%
Methods396
▷ Static methods6917.42%
▷ Public methods35890.40%
▷ Protected methods61.52%
▷ Private methods328.08%
Functions11
▷ Named functions654.55%
▷ Anonymous functions545.45%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.21MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
build/images/presets-3.62ef05fb.png22.39KB9.16KB▼ 59.10%
build/images/presets-4.043dc9fb.png21.71KB7.95KB▼ 63.40%
admin/assets/img/spc-dbrd-tmpl-r-side-img.png60.98KB20.15KB▼ 66.95%
build/images/presets-2.35d6f0b3.png19.27KB8.03KB▼ 58.34%
admin/shopcred-dashboard/assets/images/spc-dbrd-tmpl-r-side-img.png60.98KB20.15KB▼ 66.95%