84% optty

Code Review | Optty

WordPress plugin Optty scored84%from 54 tests.

About plugin

  • Plugin page: optty
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1.0
  • WordPress version: 6.3.1
  • First release: Nov 11, 2022
  • Latest release: Nov 15, 2022
  • Number of updates: 7
  • Update frequency: every 0.7 days
  • Top authors: opttydev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /518 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.21MB] [CPU: ▼5.52ms] Passed 4 tests

Server-side resources used by Optty
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2442.38 ▼4.23
Dashboard /wp-admin3.55 ▲0.2449.47 ▼10.54
Posts /wp-admin/edit.php3.60 ▲0.2455.07 ▼1.38
Add New Post /wp-admin/post-new.php6.07 ▲0.1897.02 ▼5.78
Media Library /wp-admin/upload.php3.41 ▲0.1838.24 ▼1.54

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Optty
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.11 ▼0.271.82 ▼0.2742.52 ▼7.75
Dashboard /wp-admin2,198 ▲215.63 ▼0.0581.26 ▼16.4340.30 ▼5.96
Posts /wp-admin/edit.php2,103 ▲32.03 ▼0.0140.45 ▲1.8435.77 ▲0.93
Add New Post /wp-admin/post-new.php1,546 ▲123.30 ▲0.07693.55 ▲13.5754.02 ▼5.44
Media Library /wp-admin/upload.php1,397 ▼34.24 ▲0.10100.18 ▼10.2142.44 ▼6.08

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 76× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/optty/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/optty/vendor/guzzlehttp/psr7/src/CachingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\AdapterInterface' not found in wp-content/plugins/optty/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php:10
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/optty/vendor/symfony/polyfill-mbstring/bootstrap80.php on line 15
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/optty/vendor/guzzlehttp/guzzle/src/Client.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/optty/vendor/guzzlehttp/promises/src/FulfilledPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/optty/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/optty/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/optty/vendor/guzzlehttp/guzzle/src/Pool.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/optty/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
No tags were found

optty/optty.php Passed 13 tests

The principal PHP file in "Optty" v. 1.0.0 is loaded by WordPress automatically on each request
89 characters long description:
One platform integrating you to the world of Buy Now Pay Later Payment gateways globally.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected22,392 lines of code in 256 files:
LanguageFilesBlank linesComment linesLines of code
PHP2103,1048,95816,452
Markdown171,25503,797
JSON21001,799
JavaScript3351244
CSS115166
make212027
YAML1007
Sass1010

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity10.64
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces28
Interfaces35
Traits3
Classes146
▷ Abstract classes64.11%
▷ Concrete classes14095.89%
▷ Final classes7452.86%
Methods1,148
▷ Static methods31527.44%
▷ Public methods96383.89%
▷ Protected methods60.52%
▷ Private methods17915.59%
Functions279
▷ Named functions13949.82%
▷ Anonymous functions14050.18%
Constants121
▷ Global constants97.44%
▷ Class constants11292.56%
▷ Public constants8878.57%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin