78% friendstore-for-woocommerce

Code Review | FriendStore for WooCommerce

WordPress plugin FriendStore for WooCommerce scored 78% from 54 tests.

About plugin

  • Plugin page: friendstore-for-w...
  • Plugin version: 1.4.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.4
  • WordPress version: 6.3.1
  • First release: Oct 25, 2019
  • Latest release: Aug 19, 2020
  • Number of updates: 27
  • Update frequency: every 11.1 days
  • Top authors: vietfriendteam (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active / 6,421 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by FriendStore for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.13 ▼8.44
Dashboard /wp-admin3.31 ▲0.0045.19 ▼1.43
Posts /wp-admin/edit.php3.36 ▲0.0045.21 ▲0.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.75 ▼19.29
Media Library /wp-admin/upload.php3.23 ▲0.0037.75 ▲3.05

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

FriendStore for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.131.79 ▲0.0441.79 ▲0.17
Dashboard /wp-admin2,206 ▲154.89 ▼0.01109.04 ▲6.4740.11 ▼0.31
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0439.88 ▼0.4833.73 ▼3.36
Add New Post /wp-admin/post-new.php1,524 ▼423.12 ▲4.82642.18 ▼12.7662.79 ▼1.32
Media Library /wp-admin/upload.php1,388 ▲34.30 ▲0.15121.93 ▼5.7046.98 ▼7.96

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/friendstore-for-woocommerce/templates/friendstore/addresses/dropdown-addresses.php
    • > /wp-content/plugins/friendstore-for-woocommerce/includes/admin/class.admin-notices.php
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/friendstore-for-woocommerce/assets/json/wards.php:11
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/friendstore-for-woocommerce/includes/admin/class.admin-user-addresses-list-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/friendstore-for-woocommerce/assets/json/districts.php:11
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/friendstore-for-woocommerce/templates/friendstore/addresses/dropdown-addresses.php on line 4
    • > PHP Notice
      Undefined variable: calculator_metakey in wp-content/plugins/friendstore-for-woocommerce/templates/friendstore/shipping-calculator/quick-settings.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/friendstore-for-woocommerce/templates/friendstore/shipping-calculator/bulk-settings.php:6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/friendstore-for-woocommerce/includes/admin/class.admin-user-addresses-list-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/friendstore-for-woocommerce/templates/friendstore/shipping-calculator/quick-settings.php:6
    • > PHP Notice
      Undefined variable: add_new_link in wp-content/plugins/friendstore-for-woocommerce/templates/friendstore/addresses/button-add-new.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/friendstore-for-woocommerce/templates/friendstore/addresses/button-add-new.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #10, #13, #14, #15, #16, #17, #18, #19 in friendstore-for-woocommerce/assets to your readme.txt
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

friendstore-for-woocommerce/friendstore-for-woocommerce.php 92% from 13 tests

The main PHP file in "FriendStore for WooCommerce" ver. 1.4.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4.0" instead of "4.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin35,511 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PO File19,03310,09318,097
PHP2763333816,408
JavaScript59656619
CSS297385
SVG1002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity29.86
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity4.01
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes17.14%
Methods134
▷ Static methods2014.93%
▷ Public methods12492.54%
▷ Protected methods00.00%
▷ Private methods107.46%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants981.82%
▷ Class constants218.18%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/delivery.png3.24KB3.35KB0.00%
assets/images/create-order.png0.98KB1.02KB0.00%
assets/images/delivery-truck.png1.85KB1.90KB0.00%