78% spr-invoice

Code Review | sprInvoice

WordPress plugin sprInvoice scored78%from 54 tests.

About plugin

  • Plugin page: spr-invoice
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Jul 23, 2014
  • Latest release: Jul 28, 2014
  • Number of updates: 4
  • Update frequency: every 4.0 days
  • Top authors: tophermade (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

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

Server metrics [RAM: ▼0.67MB] [CPU: ▼21.09ms] Passed 4 tests

Analyzing server-side resources used by sprInvoice
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.56 ▼0.43
Dashboard /wp-admin3.34 ▼0.0050.61 ▼8.32
Posts /wp-admin/edit.php3.39 ▲0.0450.53 ▲0.09
Add New Post /wp-admin/post-new.php3.13 ▼2.7635.55 ▼75.69
Media Library /wp-admin/upload.php3.26 ▲0.0435.99 ▲1.50
sprInvoice Settings /wp-admin/options-general.php?page=spr-invoice-admin3.2130.58
Add New /wp-admin/post-new.php?post_type=invoice3.1234.34
Invoice /wp-admin/edit.php?post_type=invoice3.3136.25

Server storage [IO: ▲0.18MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for sprInvoice
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8714.42 ▲0.041.81 ▼0.1444.77 ▲4.57
Dashboard /wp-admin2,229 ▲515.65 ▼0.1092.58 ▼13.8238.40 ▼1.65
Posts /wp-admin/edit.php2,134 ▲342.00 ▼0.0040.78 ▼3.1639.49 ▲3.24
Add New Post /wp-admin/post-new.php1,389 ▼16017.01 ▼6.39555.37 ▼46.1553.89 ▲0.88
Media Library /wp-admin/upload.php1,428 ▲254.22 ▲0.01102.57 ▼2.2841.46 ▼4.21
sprInvoice Settings /wp-admin/options-general.php?page=spr-invoice-admin8922.0525.2940.13
Add New /wp-admin/post-new.php?post_type=invoice1,8552.6854.4262.69
Invoice /wp-admin/edit.php?post_type=invoice1,0951.9930.5931.44

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=spr-invoice-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=spr-invoice-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/post-new.php?post_type=invoice
    • > Notice in wp-content/plugins/spr-invoice/sprinvoice.php+519
    Undefined index: spr_meta_email
    • > GET request to /wp-admin/post-new.php?post_type=invoice
    • > Notice in wp-content/plugins/spr-invoice/sprinvoice.php+527
    Undefined index: spr_meta_address_1
    • > GET request to /wp-admin/post-new.php?post_type=invoice
    • > Notice in wp-content/plugins/spr-invoice/sprinvoice.php+545
    Undefined index: rowname
    • > GET request to /wp-admin/post-new.php?post_type=invoice
    • > Notice in wp-content/plugins/spr-invoice/sprinvoice.php+546
    Undefined index: rowcount
    • > GET request to /wp-admin/post-new.php?post_type=invoice
    • > Notice in wp-content/plugins/spr-invoice/sprinvoice.php+547
    Undefined index: rowcost
    • > GET request to /wp-admin/post-new.php?post_type=invoice
    • > Warning in wp-content/plugins/spr-invoice/sprinvoice.php+552
    count(): Parameter must be an array or an object that implements Countable

SRP 50% 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 fix the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/spr-invoice/invoice-template.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/spr-invoice/invoice-template.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/spr-invoice/invoice-template.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/spr-invoice/sprinvoice.php:270

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 errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (What a generated invoice will look like), #2 (Creating a new invoice), #3 (General invoice settings for company/user information)
  • Plugin Name: You should set the name of your plugin on the first line ( === spr-invoice === )
The official readme.txt is a good inspiration

spr-invoice/sprinvoice.php 92% from 13 tests

The principal PHP file in "sprInvoice" v. 0.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("spr-invoice.php" instead of "sprinvoice.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,047 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP213527641
CSS32119406

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.14MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png41.82KB23.48KB▼ 43.85%
screenshot-1.png37.36KB19.51KB▼ 47.79%
screenshot-2.png62.35KB32.46KB▼ 47.95%