74% invoiceem

Code Review | InvoiceEM - Portable WordPress Invoicing

WordPress plugin InvoiceEM - Portable WordPress Invoicing scored 74% from 54 tests.

About plugin

  • Plugin page: invoiceem
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3.3
  • WordPress version: 5.8.1
  • First release: Nov 23, 2019
  • Latest release: Jan 14, 2020
  • Number of updates: 18
  • Update frequency: every 2.9 days
  • Top authors: rnoakes3rd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 436 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

An overview of server-side resources used by InvoiceEM - Portable WordPress Invoicing
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.30 ▲1.4647.98 ▲13.16
Dashboard /wp-admin4.75 ▲1.6958.91 ▲9.31
Posts /wp-admin/edit.php4.80 ▲1.6857.32 ▼19.34
Add New Post /wp-admin/post-new.php7.04 ▲1.60109.10 ▼568.75
Media Library /wp-admin/upload.php4.62 ▲1.6242.90 ▲7.98
Payments /wp-admin/admin.php?page=invoiceem_payments5.1656.02
Edit Currency /wp-admin/admin.php?page=invoiceem_currencies4.5038.85
Settings /wp-admin/admin.php?page=invoiceem_settings5.0350.17
Invoices /wp-admin/admin.php?page=invoiceem_invoices5.2146.84
Projects /wp-admin/admin.php?page=invoiceem_projects5.1243.26
Reporting /wp-admin/admin.php?page=invoiceem_reporting4.9455.60
Edit Country /wp-admin/admin.php?page=invoiceem_countries4.5041.24
Add Invoice /wp-admin/admin.php?page=invoiceem_invoices&action=add5.3548.70
Extensions /wp-admin/admin.php?page=invoiceem_extensions4.9052.95
Add Payment /wp-admin/admin.php?page=invoiceem_payments&action=add5.0147.89

Server storage [IO: ▲3.54MB] [DB: ▲0.08MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 361 new files
Database: 7 new tables, 2 new options
New tables
wp_iem_payments
wp_iem_currencies
wp_iem_countries
wp_iem_clients
wp_iem_invoices
wp_iem_projects
wp_iem_payment_invoices
New WordPress options
invoiceem_settings_company
invoiceem_version

Browser metrics Passed 4 tests

A check of browser resources used by InvoiceEM - Portable WordPress Invoicing
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,767 ▲13016.14 ▲0.227.98 ▼2.1248.89 ▲1.68
Dashboard /wp-admin3,036 ▲1025.89 ▼0.09148.35 ▼8.67112.95 ▼10.20
Posts /wp-admin/edit.php2,803 ▲642.70 ▲0.0166.81 ▼13.6893.54 ▼37.14
Add New Post /wp-admin/post-new.php1,644 ▼3918.85 ▲0.41370.16 ▼27.26110.22 ▼1.75
Media Library /wp-admin/upload.php1,871 ▲645.03 ▲0.03158.75 ▲13.01126.36 ▲5.55
Payments /wp-admin/admin.php?page=invoiceem_payments1,5933.4994.4387.04
Edit Currency /wp-admin/admin.php?page=invoiceem_currencies280.900.0713.26
Settings /wp-admin/admin.php?page=invoiceem_settings1,9425.12111.97104.60
Invoices /wp-admin/admin.php?page=invoiceem_invoices1,6823.41105.3081.59
Projects /wp-admin/admin.php?page=invoiceem_projects1,6123.2193.9783.26
Reporting /wp-admin/admin.php?page=invoiceem_reporting1,7764.66150.18106.18
Edit Country /wp-admin/admin.php?page=invoiceem_countries280.900.0611.65
Add Invoice /wp-admin/admin.php?page=invoiceem_invoices&action=add2,5624.39152.21123.67
Extensions /wp-admin/admin.php?page=invoiceem_extensions1,7493.5782.18140.67
Add Payment /wp-admin/admin.php?page=invoiceem_payments&action=add1,8903.58127.53107.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 7 tables
    • wp_iem_countries
    • wp_iem_currencies
    • wp_iem_payments
    • wp_iem_invoices
    • wp_iem_clients
    • wp_iem_projects
    • wp_iem_payment_invoices
  • Zombie WordPress options detected upon uninstall: 2 options
    • invoiceem_settings_company
    • invoiceem_version

Smoke tests 75% 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)
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=invoiceem_currencies
    • > Network (severe)
    wp-admin/admin.php?page=invoiceem_currencies - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=invoiceem_countries
    • > Network (severe)
    wp-admin/admin.php?page=invoiceem_countries - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: invoicing, sliced, freelancer, payments, business...

invoiceem/invoiceem.php Passed 13 tests

Analyzing the main PHP file in "InvoiceEM - Portable WordPress Invoicing" version 1.0.6
140 characters long description:
InvoiceEM is the portable WordPress invoicing plugin. All records are stored in custom database tables instead of mixing records with posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected52,437 lines of code in 336 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2685,8145,25628,297
PHP543,6007,72417,087
CSS8973775,298
JSON3001,715
Markdown312040

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity45.43
▷ Minimum class complexity1.00
▷ Maximum class complexity199.00
Average method complexity5.58
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes44
▷ Abstract classes49.09%
▷ Concrete classes4090.91%
▷ Final classes40100.00%
Methods428
▷ Static methods9121.26%
▷ Public methods30370.79%
▷ Protected methods6916.12%
▷ Private methods5613.08%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants251
▷ Global constants10.40%
▷ Class constants25099.60%
▷ Public constants250100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
15 PNG files occupy 0.30MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/vendor/jquery-ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png0.32KB0.16KB▼ 50.46%
assets/debug/images/robert-noakes.png2.91KB2.87KB▼ 1.34%
assets/debug/images/YourWordPressDXP300x600.png136.86KB60.69KB▼ 55.65%
assets/vendor/jquery-ui/themes/smoothness/images/ui-icons_2e83ff_256x240.png4.57KB4.18KB▼ 8.43%
assets/vendor/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png4.57KB4.18KB▼ 8.43%