58% invoice-sync-for-xero-and-wpecommerce

Code Review | Invoice-Sync-for-Xero-and-WPeCommerce

WordPress plugin Invoice-Sync-for-Xero-and-WPeCommerce scored58%from 54 tests.

About plugin

  • Plugin page: invoice-sync-for-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0.8
  • WordPress version: 6.3.1
  • First release: Dec 10, 2015
  • Latest release: Dec 10, 2015
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: arif.vbridge (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,107 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼9.65ms] Passed 4 tests

A check of server-side resources used by Invoice-Sync-for-Xero-and-WPeCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0937.56 ▼6.76
Dashboard /wp-admin3.40 ▲0.0551.03 ▼17.60
Posts /wp-admin/edit.php3.45 ▲0.0951.19 ▼1.26
Add New Post /wp-admin/post-new.php5.98 ▲0.0994.06 ▼12.97
Media Library /wp-admin/upload.php3.32 ▲0.0940.51 ▲4.56
Help /wp-admin/admin.php?page=invoice-sync-for-xero-and-wpecommerce/isxwpe_plugin_help.php3.2931.79
Xero Sync History /wp-admin/admin.php?page=invoice-sync-for-xero-and-wpecommerce/isxwpe_invoice_history.php3.2936.41
Xero Auth /wp-admin/admin.php?page=invoice-sync-for-xero-and-wpecommerce/xero-invoice.php3.2935.55

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: 2 new tables, 6 new options
New tables
wp_xero_auth
wp_xero_history
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Invoice-Sync-for-Xero-and-WPeCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.25 ▼0.121.82 ▲0.1343.42 ▼0.08
Dashboard /wp-admin2,229 ▲555.62 ▲0.0591.93 ▼7.9941.13 ▼5.54
Posts /wp-admin/edit.php2,131 ▲311.99 ▲0.0439.54 ▲4.2335.62 ▼2.11
Add New Post /wp-admin/post-new.php1,560 ▲3418.31 ▼4.90633.91 ▼44.5278.73 ▲25.70
Media Library /wp-admin/upload.php1,425 ▲254.14 ▼0.08100.79 ▼8.4543.34 ▼5.39
Help /wp-admin/admin.php?page=invoice-sync-for-xero-and-wpecommerce/isxwpe_plugin_help.php8871.9926.1031.10
Xero Sync History /wp-admin/admin.php?page=invoice-sync-for-xero-and-wpecommerce/isxwpe_invoice_history.php8371.9026.3533.60
Xero Auth /wp-admin/admin.php?page=invoice-sync-for-xero-and-wpecommerce/xero-invoice.php8432.0023.0236.66

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_xero_history
    • wp_xero_auth
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

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 no errors were found, this is by no means 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
Please take a closer look at the following
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/invoice-sync-for-xero-and-wpecommerce/xero_library/private.php
    • > /wp-content/plugins/invoice-sync-for-xero-and-wpecommerce/xero_library/index.php
    • > /wp-content/plugins/invoice-sync-for-xero-and-wpecommerce/xero_library/public.php
    • > /wp-content/plugins/invoice-sync-for-xero-and-wpecommerce/xero_library/partner.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      file_get_contents(wp-content/plugins/invoice-sync-for-xero-and-wpecommerce/xero_library/certs/entrust-cert.pem): failed to open stream: No such file or directory in /var/www/wordpress/wp-content/plugins/invoice-sync-for-xero-and-wpecommerce/xero_library/lib/XeroOAuth.php on line 605
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/invoice-sync-for-xero-and-wpecommerce/xero-invoice.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: invoice, xero, wpecommerce

invoice-sync-for-xero-and-wpecommerce/xero-invoice.php 92% from 13 tests

This is the main PHP file of "Invoice-Sync-for-Xero-and-WPeCommerce" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("invoice-sync-for-xero-and-wpecommerce.php" instead of "xero-invoice.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/invoice-sync-for-xero-and-wpecommerce/xero_library/certs/ca-bundle.crt
3,381 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP112664702,138
CSS133501,142
Markdown2570101

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity37.50
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity5.17
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods35
▷ Static methods12.86%
▷ Public methods2982.86%
▷ Protected methods00.00%
▷ Private methods617.14%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants15100.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
2 PNG files occupy 0.17MB with 0.11MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/set_up_plugin.png129.41KB46.34KB▼ 64.19%
images/application_detalis.png46.29KB18.43KB▼ 60.19%