78% rcp-vat

Code Review | RCP VAT

WordPress plugin RCP VAT scored78%from 54 tests.

About plugin

  • Plugin page: rcp-vat
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.9
  • WordPress version: 6.3.1
  • First release: May 15, 2017
  • Latest release: Nov 26, 2018
  • Number of updates: 35
  • Update frequency: every 16.0 days
  • Top authors: munger41 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,192 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.25MB] [CPU: ▼5.63ms] Passed 4 tests

This is a short check of server-side resources used by RCP VAT
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2441.26 ▲2.30
Dashboard /wp-admin3.60 ▲0.3048.02 ▼4.26
Posts /wp-admin/edit.php3.65 ▲0.2948.58 ▲0.06
Add New Post /wp-admin/post-new.php6.14 ▲0.2583.45 ▼20.61
Media Library /wp-admin/upload.php3.46 ▲0.2335.65 ▲3.24

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for RCP VAT
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲15513.92 ▼0.4610.23 ▲8.2842.99 ▼7.30
Dashboard /wp-admin2,210 ▲225.80 ▼0.0596.52 ▼20.4038.14 ▼8.48
Posts /wp-admin/edit.php2,093 ▲42.14 ▲0.1735.29 ▼3.7533.43 ▲0.81
Add New Post /wp-admin/post-new.php1,527 ▼718.15 ▼5.05599.26 ▼72.1952.20 ▼6.72
Media Library /wp-admin/upload.php1,392 ▲74.20 ▲0.0193.92 ▼8.6341.76 ▼3.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/rcp-vat/public/partials/rcp-vat-public-display.php
    • > /wp-content/plugins/rcp-vat/admin/partials/rcp-vat-admin-display.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/tests/CountriesTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/tests/ValidatorTest.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\CacheInterface' not found in wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/src/Rates/Caches/NullCache.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/tests/RatesTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'DvK\\Vat\\Rates\\Exceptions\\Exception' not found in wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/src/Rates/Exceptions/ClientException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\CacheException' not found in wp-content/plugins/rcp-vat/libs/vendor/psr/simple-cache/src/InvalidArgumentException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'DvK\\Vat\\Rates\\Interfaces\\Client' not found in wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/src/Rates/Clients/JsonVat.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function rcp_is_registration() in wp-content/plugins/rcp-vat/rcp/register-total-details.php:16

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (Parameters added into payment RCP tab settings.)
The official readme.txt might help

rcp-vat/rcp-vat.php Passed 13 tests

"RCP VAT" version 1.2.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
94 characters long description:
VAT management in Stripe for Restrict Content Pro plugin. Sell inside EU respecting the rules.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected2,477 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP354871,1682,064
JSON400168
PO File1252576
Markdown324071
JavaScript2256663
XML10028
YAML1307
CSS2080

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.52
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces10
Interfaces4
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods118
▷ Static methods54.24%
▷ Public methods10891.53%
▷ Protected methods43.39%
▷ Private methods65.08%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin