68% spf-wct

Code Review | spfwct

WordPress plugin spfwct scored68%from 54 tests.

About plugin

  • Plugin page: spf-wct
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.7
  • WordPress version: 6.3.1
  • First release: Apr 3, 2021
  • Latest release: Apr 3, 2021
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: roidlab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /514 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.67MB] [CPU: ▲10.05ms] Passed 4 tests

An overview of server-side resources used by spfwct
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.14 ▲2.6855.08 ▲16.39
Dashboard /wp-admin5.98 ▲2.6760.30 ▲12.91
Posts /wp-admin/edit.php6.09 ▲2.7360.45 ▲15.59
Add New Post /wp-admin/post-new.php8.56 ▲2.67102.09 ▲5.35
Media Library /wp-admin/upload.php5.90 ▲2.6745.69 ▲6.33

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 413 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

spfwct: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.24 ▼1.142.21 ▲0.3043.59 ▼1.28
Dashboard /wp-admin2,207 ▲195.84 ▼0.0198.50 ▼12.2047.50 ▲3.92
Posts /wp-admin/edit.php2,092 ▲62.03 ▲0.0235.51 ▼1.2342.88 ▲9.59
Add New Post /wp-admin/post-new.php1,537 ▲423.18 ▼0.02750.23 ▲133.8750.25 ▲2.61
Media Library /wp-admin/upload.php1,392 ▲44.29 ▲0.09112.41 ▲11.5255.32 ▲12.48

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
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 7× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/build.php
    • > /wp-content/plugins/spf-wct/vendor/stripe-php-7.75.0/update_certs.php
    • > /wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/tests/bootstrap.php
    • > /wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/tests/bootstrap.no_autoload.php
    • > /wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/update_certs.php
    • > /wp-content/plugins/spf-wct/vendor/stripe-php-7.75.0/build.php
    • > /wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/examples/oauth.php
  • 306× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/lib/BitcoinReceiver.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/lib/Error/ApiConnection.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/spf-wct/vendor/stripe-php-7.75.0/lib/BalanceTransaction.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractServiceFactory' not found in wp-content/plugins/spf-wct/vendor/stripe-php-7.75.0/lib/Service/Reporting/ReportingServiceFactory.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/spf-wct/vendor/stripe-php-7.75.0/lib/Service/CountrySpecService.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Util\\LoggerInterface' not found in wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/lib/Util/DefaultLogger.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'SPF_WCT\\StirpeConfig' not found in wp-content/plugins/spf-wct/classes/ErrorBundle.class.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/spf-wct/vendor/stripe-php-7.75.0/lib/CreditNoteLineItem.php:23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/spf-wct/vendor/stripe-php-7.75.0/build.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/lib/BalanceTransaction.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% 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
These attributes need to be fixed:
  • Requires php: Invalid version format
You can take inspiration from this readme.txt

spf-wct/spfwct.php 85% from 13 tests

This is the main PHP file of "spfwct" 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 take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("spf-wct.php" instead of "spfwct.php")
  • Description: The description should be shorter than 140 characters (currently 238 characters long)

Code Analysis 5% from 3 tests

File types 0% from 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
Please make sure to remedy the following
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/spf-wct/vendor/stripe-php-7.75.0/data/ca-certificates.crt
      • wp-content/plugins/spf-wct/vendor/stripe-php-6.6.0/data/ca-certificates.crt
28,016 lines of code in 390 files:
LanguageFilesBlank linesComment linesLines of code
PHP3693,59511,57416,389
JavaScript41,1831,4909,553
Markdown688201,511
CSS2341352
JSON20084
XML30061
YAML37139
make19027

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity3.68
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces25
Interfaces9
Traits14
Classes334
▷ Abstract classes175.09%
▷ Concrete classes31794.91%
▷ Final classes00.00%
Methods1,373
▷ Static methods27720.17%
▷ Public methods1,25691.48%
▷ Protected methods493.57%
▷ Private methods684.95%
Functions17
▷ Named functions317.65%
▷ Anonymous functions1482.35%
Constants881
▷ Global constants101.14%
▷ Class constants87198.86%
▷ Public constants871100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.18MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/icon-visa.png1.17KB1.12KB▼ 4.09%
screenshot-3.png42.12KB16.91KB▼ 59.86%
screenshot-2.png51.34KB19.97KB▼ 61.10%
images/icons/icon_mastercard.png1.94KB1.57KB▼ 19.01%
images/icons/icon_american-express.png2.73KB2.14KB▼ 21.78%