77% myworks-sync-for-xero

Code Review | WooCommerce Sync for Xero - by MyWorks

WordPress plugin WooCommerce Sync for Xero - by MyWorks scored77%from 54 tests.

About plugin

  • Plugin page: myworks-sync-for-...
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 27, 2023
  • Latest release: Aug 22, 2023
  • Number of updates: 12
  • Update frequency: every 9.8 days
  • Top authors: myworksdesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /947 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by WooCommerce Sync for Xero - by MyWorks
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.00 ▲1.16
Dashboard /wp-admin3.31 ▲0.0047.03 ▼4.41
Posts /wp-admin/edit.php3.36 ▲0.0044.96 ▲0.40
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.25 ▼5.01
Media Library /wp-admin/upload.php3.23 ▲0.0035.07 ▲3.07

Server storage [IO: ▲25.01MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Filesystem usage must be lower than 25MB (currently using 25.01MB)
Filesystem: 1,230 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Sync for Xero - by MyWorks
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.29 ▼0.674.69 ▲2.9444.55 ▲0.70
Dashboard /wp-admin2,203 ▲155.79 ▼0.0299.10 ▼9.4840.33 ▲0.39
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0236.90 ▲0.0831.17 ▼1.91
Add New Post /wp-admin/post-new.php1,535 ▲223.15 ▼0.10615.68 ▼15.3352.06 ▲2.94
Media Library /wp-admin/upload.php1,388 ▲34.25 ▲0.0895.30 ▼28.8541.26 ▼26.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/myworks-sync-for-xero/admin/partials/myworks-woo-sync-for-xero-admin-display.php
    • > /wp-content/plugins/myworks-sync-for-xero/public/partials/myworks-woo-sync-for-xero-public-display.php
  • 710× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'XeroAPI\\XeroPHP\\Models\\Accounting\\ModelInterface' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNotes.php:44
    • > PHP Fatal error
      Uncaught Error: Interface 'XeroAPI\\XeroPHP\\Models\\PayrollUk\\ModelInterface' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Problem.php:45
    • > PHP Fatal error
      Uncaught Error: Interface 'XeroAPI\\XeroPHP\\Models\\AppStore\\ModelInterface' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/xeroapi/xero-php-oauth2/lib/Models/AppStore/SubscriptionItem.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/xeroapi/xero-php-oauth2/test/Model/TrackingOptionTest.php:41
    • > PHP Fatal error
      Uncaught Error: Interface 'XeroAPI\\XeroPHP\\Models\\PayrollUk\\ModelInterface' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Accounts.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/xeroapi/xero-php-oauth2/test/Model/RepeatingInvoiceTest.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/monolog/monolog/tests/Monolog/TestCase.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/xeroapi/xero-php-oauth2/test/Model/CISSettingTest.php:41
    • > PHP Fatal error
      Uncaught Error: Interface 'XeroAPI\\XeroPHP\\Models\\Accounting\\ModelInterface' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/xeroapi/xero-php-oauth2/lib/Models/Accounting/Journal.php:44
    • > PHP Fatal error
      Uncaught Error: Interface 'XeroAPI\\XeroPHP\\Models\\PayrollNz\\ModelInterface' not found in wp-content/plugins/myworks-sync-for-xero/includes/lib/xero-lib/vendor/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveSummary.php:44

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Conveniently and securely managed from within your WooCommerce admin area.) image missing
Please take inspiration from this readme.txt

myworks-sync-for-xero/myworks-sync-for-xero.php 85% from 13 tests

"WooCommerce Sync for Xero - by MyWorks" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.3" instead of "5.2")
  • Description: The description should be shorter than 140 characters (currently 241 characters long)

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin350,172 lines of code in 1,073 files:
LanguageFilesBlank linesComment linesLines of code
PHP98342,662155,200224,595
HTML910,69894699,986
CSS131,89183515,531
Markdown281,63504,925
SVG4002,674
JSON21102,290
JavaScript9148978
XML33052
Bourne Shell215834
YAML1007

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 7,411)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity26.15
▷ Minimum class complexity1.00
▷ Maximum class complexity7,411.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity99.00
Code structure
Namespaces51
Interfaces51
Traits10
Classes864
▷ Abstract classes70.81%
▷ Concrete classes85799.19%
▷ Final classes758.75%
Methods17,819
▷ Static methods3,07317.25%
▷ Public methods17,04395.65%
▷ Protected methods5683.19%
▷ Private methods2081.17%
Functions1,692
▷ Named functions17210.17%
▷ Anonymous functions1,52089.83%
Constants2,615
▷ Global constants80.31%
▷ Class constants2,60799.69%
▷ Public constants2,57698.81%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
99 PNG files occupy 2.27MB with 1.46MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/image/mapp-sta-b.png54.75KB0.66KB▼ 98.79%
admin/image/connection-icon3.png6.44KB3.30KB▼ 48.79%
admin/image/mwd-logo.png252.85KB266.86KB0.00%
admin/image/trash-icon.png2.92KB0.24KB▼ 91.65%
admin/image/menu-icon-sync_h.png22.83KB4.10KB▼ 82.05%